hash
stringlengths
40
40
date
stringdate
2016-01-01 23:11:19
2025-03-21 19:56:31
author
stringclasses
133 values
commit_message
stringlengths
13
137
is_merge
bool
1 class
masked_commit_message
stringlengths
5
116
type
stringclasses
11 values
git_diff
stringlengths
113
3.11M
011d4b4ea4ce900fa326726a85d86d2f56e6e5f7
2016-05-03 10:02:51
Jeff Cross
feat(viewport): add viewport meta tag for mobile screens
false
add viewport meta tag for mobile screens
feat
diff --git a/addon/ng2/blueprints/ng2/files/__path__/index.html b/addon/ng2/blueprints/ng2/files/__path__/index.html index 734ccaf5d778..9c9ea0b4c0e7 100644 --- a/addon/ng2/blueprints/ng2/files/__path__/index.html +++ b/addon/ng2/blueprints/ng2/files/__path__/index.html @@ -7,6 +7,7 @@ {{content-for 'head'}} <link rel="icon" type="image/x-icon" href="favicon.ico"><% if (isMobile) { %> <link rel="manifest" href="/manifest.webapp"><% } %> + <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Service worker support is disabled by default. Install the worker script and uncomment to enable.
6f93972b1d748196a768f9e96c35c922a4cccd4a
2017-03-20 21:50:03
Hans Larsen
refactor: remove unused files
false
remove unused files
refactor
diff --git a/packages/@ngtools/webpack/src/reflector_host.ts b/packages/@ngtools/webpack/src/reflector_host.ts deleted file mode 100644 index 7381010b11b3..000000000000 --- a/packages/@ngtools/webpack/src/reflector_host.ts +++ /dev/null @@ -1,27 +0,0 @@ -// @ignoreDep @angular/compiler-cli -import {CodeGenerator} from '@angular/compiler-cli'; - - -/** - * Patch the CodeGenerator instance to use a custom reflector host. - */ -export function patchReflectorHost(codeGenerator: CodeGenerator) { - const reflectorHost = (codeGenerator as any).reflectorHost; - const oldGIP = reflectorHost.getImportPath; - - reflectorHost.getImportPath = function(containingFile: string, importedFile: string): string { - // Hack together SCSS and LESS files URLs so that they match what the default ReflectorHost - // is expected. We only do that for shimmed styles. - const m = importedFile.match(/(.*)(\.css|\.scss|\.less|\.stylus)((?:\.shim)?)(\..+)/); - if (!m) { - return oldGIP.call(this, containingFile, importedFile); - } - - // We call the original, with `css` in its name instead of the extension, and replace the - // extension from the result. - const [, baseDirAndName, styleExt, shim, ext] = m; - const result = oldGIP.call(this, containingFile, baseDirAndName + '.css' + shim + ext); - - return result.replace(/\.css($|\.)/, styleExt + '$1'); - }; -}
e8dff5718f3f1935f683f2cc53247d9e61f20234
2019-07-29 22:45:23
Filipe Silva
build: update to TS 3.5
false
update to TS 3.5
build
diff --git a/package.json b/package.json index 9d6cbc5772ca..30c0eca39302 100644 --- a/package.json +++ b/package.json @@ -77,11 +77,11 @@ "quicktype-core": "^6.0.15", "temp": "^0.9.0", "tslint": "^5.15.0", - "typescript": "3.4.5" + "typescript": "3.5.3" }, "devDependencies": { - "@angular/compiler": "~8.1.0", - "@angular/compiler-cli": "~8.1.0", + "@angular/compiler": "~8.2.0-rc.0", + "@angular/compiler-cli": "~8.2.0-rc.0", "@bazel/bazel": "0.24.1", "@bazel/buildifier": "^0.22.0", "@bazel/jasmine": "~0.26.0", diff --git a/packages/angular/cli/utilities/package-metadata.ts b/packages/angular/cli/utilities/package-metadata.ts index 0775c55792b7..26b3f446b135 100644 --- a/packages/angular/cli/utilities/package-metadata.ts +++ b/packages/angular/cli/utilities/package-metadata.ts @@ -191,7 +191,7 @@ export async function fetchPackageMetadata( if (response.versions) { for (const [version, manifest] of Object.entries(response.versions)) { - metadata.versions.set(version, normalizeManifest(manifest)); + metadata.versions.set(version, normalizeManifest(manifest as {})); } } diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 1bc308c435d5..a731d937734f 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -57,18 +57,19 @@ "worker-plugin": "3.1.0" }, "devDependencies": { - "@angular/animations": "~8.1.0", + "@angular/animations": "~8.2.0-rc.0", "@angular/cdk": "^8.0.0", - "@angular/common": "~8.1.0", - "@angular/compiler": "~8.1.0", - "@angular/compiler-cli": "~8.1.0", - "@angular/core": "~8.1.0", + "@angular/common": "~8.2.0-rc.0", + "@angular/compiler": "~8.2.0-rc.0", + "@angular/compiler-cli": "~8.2.0-rc.0", + "@angular/core": "~8.2.0-rc.0", + "@angular/forms": "~8.2.0-rc.0", "@angular/material": "^8.0.0", - "@angular/platform-browser": "~8.1.0", - "@angular/platform-browser-dynamic": "~8.1.0", - "@angular/platform-server": "~8.1.0", - "@angular/router": "~8.1.0", - "@angular/service-worker": "~8.1.0", + "@angular/platform-browser": "~8.2.0-rc.0", + "@angular/platform-browser-dynamic": "~8.2.0-rc.0", + "@angular/platform-server": "~8.2.0-rc.0", + "@angular/router": "~8.2.0-rc.0", + "@angular/service-worker": "~8.2.0-rc.0", "codelyzer": "^5.0.0", "bootstrap": "^4.0.0", "font-awesome": "^4.7.0", @@ -86,6 +87,6 @@ }, "peerDependencies": { "@angular/compiler-cli": "^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9", - "typescript": ">=3.1 < 3.5" + "typescript": ">=3.1 < 3.6" } } diff --git a/packages/angular_devkit/build_ng_packagr/package.json b/packages/angular_devkit/build_ng_packagr/package.json index 68f06ca6f381..4e0e0627a8e7 100644 --- a/packages/angular_devkit/build_ng_packagr/package.json +++ b/packages/angular_devkit/build_ng_packagr/package.json @@ -14,10 +14,10 @@ "ng-packagr": "^4.0.0 || ^5.0.0" }, "devDependencies": { - "@angular/compiler": "~8.1.0", - "@angular/compiler-cli": "~8.1.0", + "@angular/compiler": "~8.2.0-rc.0", + "@angular/compiler-cli": "~8.2.0-rc.0", "@angular-devkit/core": "0.0.0", - "ng-packagr": "^5.1.0", - "tslib": "^1.9.0" + "ng-packagr": "^5.3.0", + "tslib": "^1.10.0" } } diff --git a/packages/angular_devkit/build_optimizer/package.json b/packages/angular_devkit/build_optimizer/package.json index 5755fdc9af00..b0b73cc0d1c4 100644 --- a/packages/angular_devkit/build_optimizer/package.json +++ b/packages/angular_devkit/build_optimizer/package.json @@ -11,7 +11,7 @@ "dependencies": { "loader-utils": "1.2.3", "source-map": "0.5.6", - "typescript": "3.4.5", + "typescript": "3.5.3", "webpack-sources": "1.3.0" } } diff --git a/packages/angular_devkit/schematics/tools/fallback-engine-host.ts b/packages/angular_devkit/schematics/tools/fallback-engine-host.ts index 3e9f882452b5..c8e8d3a37430 100644 --- a/packages/angular_devkit/schematics/tools/fallback-engine-host.ts +++ b/packages/angular_devkit/schematics/tools/fallback-engine-host.ts @@ -94,7 +94,7 @@ export class FallbackEngineHost implements EngineHost<{}, {}> { // tslint:disable-next-line:no-any https://github.com/ReactiveX/rxjs/issues/3989 return ((observableOf(options) as any) .pipe(...this._hosts - .map(host => mergeMap(opt => host.transformOptions(schematic, opt, context))), + .map(host => mergeMap((opt: {}) => host.transformOptions(schematic, opt, context))), ) ) as {} as Observable<ResultT>; } diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts index 5c823fa3ec3d..8c5e560fb6f4 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts @@ -301,7 +301,7 @@ export abstract class FileSystemEngineHostBase implements FileSystemEngineHost { // tslint:disable-next-line:no-any https://github.com/ReactiveX/rxjs/issues/3989 return ((observableOf(options) as any) .pipe( - ...this._transforms.map(tFn => mergeMap(opt => { + ...this._transforms.map(tFn => mergeMap((opt: {}) => { const newOptions = tFn(schematic, opt, context); if (isObservable(newOptions)) { return newOptions; diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index 3d063ffe57d0..1b5b04237012 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -29,13 +29,13 @@ }, "peerDependencies": { "@angular/compiler-cli": "^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9", - "typescript": ">=3.4 < 3.5", + "typescript": ">=3.4 < 3.6", "webpack": "^4.0.0" }, "devDependencies": { - "@angular/compiler": "~8.1.0", - "@angular/compiler-cli": "~8.1.0", - "typescript": "3.4.5", + "@angular/compiler": "~8.2.0-rc.0", + "@angular/compiler-cli": "~8.2.0-rc.0", + "typescript": "3.5.3", "webpack": "4.38.0" } } diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts index 314ccf298cf2..58ccd42344b0 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.4"; + const versionMajorMinor = "3.5"; /** The version of the TypeScript compiler release */ const version: string; } @@ -72,7 +72,7 @@ declare namespace ts { pos: number; end: number; } - type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.NoSubstitutionTemplateLiteral | SyntaxKind.Unknown | KeywordSyntaxKind; + type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | 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.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | 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.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | 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 | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword; type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; enum SyntaxKind { @@ -135,281 +135,283 @@ declare namespace ts { QuestionToken = 56, ColonToken = 57, AtToken = 58, - EqualsToken = 59, - PlusEqualsToken = 60, - MinusEqualsToken = 61, - AsteriskEqualsToken = 62, - AsteriskAsteriskEqualsToken = 63, - SlashEqualsToken = 64, - PercentEqualsToken = 65, - LessThanLessThanEqualsToken = 66, - GreaterThanGreaterThanEqualsToken = 67, - GreaterThanGreaterThanGreaterThanEqualsToken = 68, - AmpersandEqualsToken = 69, - BarEqualsToken = 70, - CaretEqualsToken = 71, - Identifier = 72, - BreakKeyword = 73, - CaseKeyword = 74, - CatchKeyword = 75, - ClassKeyword = 76, - ConstKeyword = 77, - ContinueKeyword = 78, - DebuggerKeyword = 79, - DefaultKeyword = 80, - DeleteKeyword = 81, - DoKeyword = 82, - ElseKeyword = 83, - EnumKeyword = 84, - ExportKeyword = 85, - ExtendsKeyword = 86, - FalseKeyword = 87, - FinallyKeyword = 88, - ForKeyword = 89, - FunctionKeyword = 90, - IfKeyword = 91, - ImportKeyword = 92, - InKeyword = 93, - InstanceOfKeyword = 94, - NewKeyword = 95, - NullKeyword = 96, - ReturnKeyword = 97, - SuperKeyword = 98, - SwitchKeyword = 99, - ThisKeyword = 100, - ThrowKeyword = 101, - TrueKeyword = 102, - TryKeyword = 103, - TypeOfKeyword = 104, - VarKeyword = 105, - VoidKeyword = 106, - WhileKeyword = 107, - WithKeyword = 108, - ImplementsKeyword = 109, - InterfaceKeyword = 110, - LetKeyword = 111, - PackageKeyword = 112, - PrivateKeyword = 113, - ProtectedKeyword = 114, - PublicKeyword = 115, - StaticKeyword = 116, - YieldKeyword = 117, - AbstractKeyword = 118, - AsKeyword = 119, - AnyKeyword = 120, - AsyncKeyword = 121, - AwaitKeyword = 122, - BooleanKeyword = 123, - ConstructorKeyword = 124, - DeclareKeyword = 125, - GetKeyword = 126, - InferKeyword = 127, - IsKeyword = 128, - KeyOfKeyword = 129, - ModuleKeyword = 130, - NamespaceKeyword = 131, - NeverKeyword = 132, - ReadonlyKeyword = 133, - RequireKeyword = 134, - NumberKeyword = 135, - ObjectKeyword = 136, - SetKeyword = 137, - StringKeyword = 138, - SymbolKeyword = 139, - TypeKeyword = 140, - UndefinedKeyword = 141, - UniqueKeyword = 142, - UnknownKeyword = 143, - FromKeyword = 144, - GlobalKeyword = 145, - BigIntKeyword = 146, - OfKeyword = 147, - QualifiedName = 148, - ComputedPropertyName = 149, - TypeParameter = 150, - Parameter = 151, - Decorator = 152, - PropertySignature = 153, - PropertyDeclaration = 154, - MethodSignature = 155, - MethodDeclaration = 156, - Constructor = 157, - GetAccessor = 158, - SetAccessor = 159, - CallSignature = 160, - ConstructSignature = 161, - IndexSignature = 162, - TypePredicate = 163, - TypeReference = 164, - FunctionType = 165, - ConstructorType = 166, - TypeQuery = 167, - TypeLiteral = 168, - ArrayType = 169, - TupleType = 170, - OptionalType = 171, - RestType = 172, - UnionType = 173, - IntersectionType = 174, - ConditionalType = 175, - InferType = 176, - ParenthesizedType = 177, - ThisType = 178, - TypeOperator = 179, - IndexedAccessType = 180, - MappedType = 181, - LiteralType = 182, - ImportType = 183, - ObjectBindingPattern = 184, - ArrayBindingPattern = 185, - BindingElement = 186, - ArrayLiteralExpression = 187, - ObjectLiteralExpression = 188, - PropertyAccessExpression = 189, - ElementAccessExpression = 190, - CallExpression = 191, - NewExpression = 192, - TaggedTemplateExpression = 193, - TypeAssertionExpression = 194, - ParenthesizedExpression = 195, - FunctionExpression = 196, - ArrowFunction = 197, - DeleteExpression = 198, - TypeOfExpression = 199, - VoidExpression = 200, - AwaitExpression = 201, - PrefixUnaryExpression = 202, - PostfixUnaryExpression = 203, - BinaryExpression = 204, - ConditionalExpression = 205, - TemplateExpression = 206, - YieldExpression = 207, - SpreadElement = 208, - ClassExpression = 209, - OmittedExpression = 210, - ExpressionWithTypeArguments = 211, - AsExpression = 212, - NonNullExpression = 213, - MetaProperty = 214, - SyntheticExpression = 215, - TemplateSpan = 216, - SemicolonClassElement = 217, - Block = 218, - VariableStatement = 219, - EmptyStatement = 220, - ExpressionStatement = 221, - IfStatement = 222, - DoStatement = 223, - WhileStatement = 224, - ForStatement = 225, - ForInStatement = 226, - ForOfStatement = 227, - ContinueStatement = 228, - BreakStatement = 229, - ReturnStatement = 230, - WithStatement = 231, - SwitchStatement = 232, - LabeledStatement = 233, - ThrowStatement = 234, - TryStatement = 235, - DebuggerStatement = 236, - VariableDeclaration = 237, - VariableDeclarationList = 238, - FunctionDeclaration = 239, - ClassDeclaration = 240, - InterfaceDeclaration = 241, - TypeAliasDeclaration = 242, - EnumDeclaration = 243, - ModuleDeclaration = 244, - ModuleBlock = 245, - CaseBlock = 246, - NamespaceExportDeclaration = 247, - ImportEqualsDeclaration = 248, - ImportDeclaration = 249, - ImportClause = 250, - NamespaceImport = 251, - NamedImports = 252, - ImportSpecifier = 253, - ExportAssignment = 254, - ExportDeclaration = 255, - NamedExports = 256, - ExportSpecifier = 257, - MissingDeclaration = 258, - ExternalModuleReference = 259, - JsxElement = 260, - JsxSelfClosingElement = 261, - JsxOpeningElement = 262, - JsxClosingElement = 263, - JsxFragment = 264, - JsxOpeningFragment = 265, - JsxClosingFragment = 266, - JsxAttribute = 267, - JsxAttributes = 268, - JsxSpreadAttribute = 269, - JsxExpression = 270, - CaseClause = 271, - DefaultClause = 272, - HeritageClause = 273, - CatchClause = 274, - PropertyAssignment = 275, - ShorthandPropertyAssignment = 276, - SpreadAssignment = 277, - EnumMember = 278, - UnparsedPrologue = 279, - UnparsedPrepend = 280, - UnparsedText = 281, - UnparsedInternalText = 282, - UnparsedSyntheticReference = 283, - SourceFile = 284, - Bundle = 285, - UnparsedSource = 286, - InputFiles = 287, - JSDocTypeExpression = 288, - JSDocAllType = 289, - JSDocUnknownType = 290, - JSDocNullableType = 291, - JSDocNonNullableType = 292, - JSDocOptionalType = 293, - JSDocFunctionType = 294, - JSDocVariadicType = 295, - JSDocComment = 296, - JSDocTypeLiteral = 297, - JSDocSignature = 298, - JSDocTag = 299, - JSDocAugmentsTag = 300, - JSDocClassTag = 301, - JSDocCallbackTag = 302, - JSDocEnumTag = 303, - JSDocParameterTag = 304, - JSDocReturnTag = 305, - JSDocThisTag = 306, - JSDocTypeTag = 307, - JSDocTemplateTag = 308, - JSDocTypedefTag = 309, - JSDocPropertyTag = 310, - SyntaxList = 311, - NotEmittedStatement = 312, - PartiallyEmittedExpression = 313, - CommaListExpression = 314, - MergeDeclarationMarker = 315, - EndOfDeclarationMarker = 316, - Count = 317, - FirstAssignment = 59, - LastAssignment = 71, - FirstCompoundAssignment = 60, - LastCompoundAssignment = 71, - FirstReservedWord = 73, - LastReservedWord = 108, - FirstKeyword = 73, - LastKeyword = 147, - FirstFutureReservedWord = 109, - LastFutureReservedWord = 117, - FirstTypeNode = 163, - LastTypeNode = 183, + /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */ + BacktickToken = 59, + EqualsToken = 60, + PlusEqualsToken = 61, + MinusEqualsToken = 62, + AsteriskEqualsToken = 63, + AsteriskAsteriskEqualsToken = 64, + SlashEqualsToken = 65, + PercentEqualsToken = 66, + LessThanLessThanEqualsToken = 67, + GreaterThanGreaterThanEqualsToken = 68, + GreaterThanGreaterThanGreaterThanEqualsToken = 69, + AmpersandEqualsToken = 70, + BarEqualsToken = 71, + CaretEqualsToken = 72, + Identifier = 73, + BreakKeyword = 74, + CaseKeyword = 75, + CatchKeyword = 76, + ClassKeyword = 77, + ConstKeyword = 78, + ContinueKeyword = 79, + DebuggerKeyword = 80, + DefaultKeyword = 81, + DeleteKeyword = 82, + DoKeyword = 83, + ElseKeyword = 84, + EnumKeyword = 85, + ExportKeyword = 86, + ExtendsKeyword = 87, + FalseKeyword = 88, + FinallyKeyword = 89, + ForKeyword = 90, + FunctionKeyword = 91, + IfKeyword = 92, + ImportKeyword = 93, + InKeyword = 94, + InstanceOfKeyword = 95, + NewKeyword = 96, + NullKeyword = 97, + ReturnKeyword = 98, + SuperKeyword = 99, + SwitchKeyword = 100, + ThisKeyword = 101, + ThrowKeyword = 102, + TrueKeyword = 103, + TryKeyword = 104, + TypeOfKeyword = 105, + VarKeyword = 106, + VoidKeyword = 107, + WhileKeyword = 108, + WithKeyword = 109, + ImplementsKeyword = 110, + InterfaceKeyword = 111, + LetKeyword = 112, + PackageKeyword = 113, + PrivateKeyword = 114, + ProtectedKeyword = 115, + PublicKeyword = 116, + StaticKeyword = 117, + YieldKeyword = 118, + AbstractKeyword = 119, + AsKeyword = 120, + AnyKeyword = 121, + AsyncKeyword = 122, + AwaitKeyword = 123, + BooleanKeyword = 124, + ConstructorKeyword = 125, + DeclareKeyword = 126, + GetKeyword = 127, + InferKeyword = 128, + IsKeyword = 129, + KeyOfKeyword = 130, + ModuleKeyword = 131, + NamespaceKeyword = 132, + NeverKeyword = 133, + ReadonlyKeyword = 134, + RequireKeyword = 135, + NumberKeyword = 136, + ObjectKeyword = 137, + SetKeyword = 138, + StringKeyword = 139, + SymbolKeyword = 140, + TypeKeyword = 141, + UndefinedKeyword = 142, + UniqueKeyword = 143, + UnknownKeyword = 144, + FromKeyword = 145, + GlobalKeyword = 146, + BigIntKeyword = 147, + OfKeyword = 148, + QualifiedName = 149, + ComputedPropertyName = 150, + TypeParameter = 151, + Parameter = 152, + Decorator = 153, + PropertySignature = 154, + PropertyDeclaration = 155, + MethodSignature = 156, + MethodDeclaration = 157, + Constructor = 158, + GetAccessor = 159, + SetAccessor = 160, + CallSignature = 161, + ConstructSignature = 162, + IndexSignature = 163, + TypePredicate = 164, + TypeReference = 165, + FunctionType = 166, + ConstructorType = 167, + TypeQuery = 168, + TypeLiteral = 169, + ArrayType = 170, + TupleType = 171, + OptionalType = 172, + RestType = 173, + UnionType = 174, + IntersectionType = 175, + ConditionalType = 176, + InferType = 177, + ParenthesizedType = 178, + ThisType = 179, + TypeOperator = 180, + IndexedAccessType = 181, + MappedType = 182, + LiteralType = 183, + ImportType = 184, + ObjectBindingPattern = 185, + ArrayBindingPattern = 186, + BindingElement = 187, + ArrayLiteralExpression = 188, + ObjectLiteralExpression = 189, + PropertyAccessExpression = 190, + ElementAccessExpression = 191, + CallExpression = 192, + NewExpression = 193, + TaggedTemplateExpression = 194, + TypeAssertionExpression = 195, + ParenthesizedExpression = 196, + FunctionExpression = 197, + ArrowFunction = 198, + DeleteExpression = 199, + TypeOfExpression = 200, + VoidExpression = 201, + AwaitExpression = 202, + PrefixUnaryExpression = 203, + PostfixUnaryExpression = 204, + BinaryExpression = 205, + ConditionalExpression = 206, + TemplateExpression = 207, + YieldExpression = 208, + SpreadElement = 209, + ClassExpression = 210, + OmittedExpression = 211, + ExpressionWithTypeArguments = 212, + AsExpression = 213, + NonNullExpression = 214, + MetaProperty = 215, + SyntheticExpression = 216, + TemplateSpan = 217, + SemicolonClassElement = 218, + Block = 219, + VariableStatement = 220, + EmptyStatement = 221, + ExpressionStatement = 222, + IfStatement = 223, + DoStatement = 224, + WhileStatement = 225, + ForStatement = 226, + ForInStatement = 227, + ForOfStatement = 228, + ContinueStatement = 229, + BreakStatement = 230, + ReturnStatement = 231, + WithStatement = 232, + SwitchStatement = 233, + LabeledStatement = 234, + ThrowStatement = 235, + TryStatement = 236, + DebuggerStatement = 237, + VariableDeclaration = 238, + VariableDeclarationList = 239, + FunctionDeclaration = 240, + ClassDeclaration = 241, + InterfaceDeclaration = 242, + TypeAliasDeclaration = 243, + EnumDeclaration = 244, + ModuleDeclaration = 245, + ModuleBlock = 246, + CaseBlock = 247, + NamespaceExportDeclaration = 248, + ImportEqualsDeclaration = 249, + ImportDeclaration = 250, + ImportClause = 251, + NamespaceImport = 252, + NamedImports = 253, + ImportSpecifier = 254, + ExportAssignment = 255, + ExportDeclaration = 256, + NamedExports = 257, + ExportSpecifier = 258, + MissingDeclaration = 259, + ExternalModuleReference = 260, + JsxElement = 261, + JsxSelfClosingElement = 262, + JsxOpeningElement = 263, + JsxClosingElement = 264, + JsxFragment = 265, + JsxOpeningFragment = 266, + JsxClosingFragment = 267, + JsxAttribute = 268, + JsxAttributes = 269, + JsxSpreadAttribute = 270, + JsxExpression = 271, + CaseClause = 272, + DefaultClause = 273, + HeritageClause = 274, + CatchClause = 275, + PropertyAssignment = 276, + ShorthandPropertyAssignment = 277, + SpreadAssignment = 278, + EnumMember = 279, + UnparsedPrologue = 280, + UnparsedPrepend = 281, + UnparsedText = 282, + UnparsedInternalText = 283, + UnparsedSyntheticReference = 284, + SourceFile = 285, + Bundle = 286, + UnparsedSource = 287, + InputFiles = 288, + JSDocTypeExpression = 289, + JSDocAllType = 290, + JSDocUnknownType = 291, + JSDocNullableType = 292, + JSDocNonNullableType = 293, + JSDocOptionalType = 294, + JSDocFunctionType = 295, + JSDocVariadicType = 296, + JSDocComment = 297, + JSDocTypeLiteral = 298, + JSDocSignature = 299, + JSDocTag = 300, + JSDocAugmentsTag = 301, + JSDocClassTag = 302, + JSDocCallbackTag = 303, + JSDocEnumTag = 304, + JSDocParameterTag = 305, + JSDocReturnTag = 306, + JSDocThisTag = 307, + JSDocTypeTag = 308, + JSDocTemplateTag = 309, + JSDocTypedefTag = 310, + JSDocPropertyTag = 311, + SyntaxList = 312, + NotEmittedStatement = 313, + PartiallyEmittedExpression = 314, + CommaListExpression = 315, + MergeDeclarationMarker = 316, + EndOfDeclarationMarker = 317, + Count = 318, + FirstAssignment = 60, + LastAssignment = 72, + FirstCompoundAssignment = 61, + LastCompoundAssignment = 72, + FirstReservedWord = 74, + LastReservedWord = 109, + FirstKeyword = 74, + LastKeyword = 148, + FirstFutureReservedWord = 110, + LastFutureReservedWord = 118, + FirstTypeNode = 164, + LastTypeNode = 184, FirstPunctuation = 18, - LastPunctuation = 71, + LastPunctuation = 72, FirstToken = 0, - LastToken = 147, + LastToken = 148, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -417,12 +419,12 @@ declare namespace ts { FirstTemplateToken = 14, LastTemplateToken = 17, FirstBinaryOperator = 28, - LastBinaryOperator = 71, - FirstNode = 148, - FirstJSDocNode = 288, - LastJSDocNode = 310, - FirstJSDocTagNode = 299, - LastJSDocTagNode = 310, + LastBinaryOperator = 72, + FirstNode = 149, + FirstJSDocNode = 289, + LastJSDocNode = 311, + FirstJSDocTagNode = 300, + LastJSDocTagNode = 311, } enum NodeFlags { None = 0, @@ -626,7 +628,7 @@ declare namespace ts { initializer?: Expression; } interface ObjectLiteralElement extends NamedDeclaration { - _objectLiteralBrandBrand: any; + _objectLiteralBrand: any; name?: PropertyName; } /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ @@ -1601,7 +1603,7 @@ declare namespace ts { } interface JSDocTypeTag extends JSDocTag { kind: SyntaxKind.JSDocTypeTag; - typeExpression?: JSDocTypeExpression; + typeExpression: JSDocTypeExpression; } interface JSDocTypedefTag extends JSDocTag, NamedDeclaration { parent: JSDoc; @@ -1877,13 +1879,18 @@ declare namespace ts { sourceFile: SourceFile; references?: ReadonlyArray<ResolvedProjectReference | undefined>; } + type CustomTransformerFactory = (context: TransformationContext) => CustomTransformer; + interface CustomTransformer { + transformSourceFile(node: SourceFile): SourceFile; + transformBundle(node: Bundle): Bundle; + } interface CustomTransformers { /** Custom transformers to evaluate before built-in .js transformations. */ - before?: TransformerFactory<SourceFile>[]; + before?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; /** Custom transformers to evaluate after built-in .js transformations. */ - after?: TransformerFactory<SourceFile>[]; + after?: (TransformerFactory<SourceFile> | CustomTransformerFactory)[]; /** Custom transformers to evaluate after built-in .d.ts transformations. */ - afterDeclarations?: TransformerFactory<Bundle | SourceFile>[]; + afterDeclarations?: (TransformerFactory<Bundle | SourceFile> | CustomTransformerFactory)[]; } interface SourceMapSpan { /** Line number in the .js file. */ @@ -1962,6 +1969,7 @@ declare namespace ts { */ getExportSymbolOfSymbol(symbol: Symbol): Symbol; getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined; + getTypeOfAssignmentPattern(pattern: AssignmentPattern): Type; getTypeAtLocation(node: Node): Type; getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; @@ -2359,7 +2367,8 @@ declare namespace ts { objectType: Type; indexType: Type; constraint?: Type; - simplified?: Type; + simplifiedForReading?: Type; + simplifiedForWriting?: Type; } type TypeVariable = TypeParameter | IndexedAccessType; interface IndexType extends InstantiableType { @@ -2382,8 +2391,8 @@ declare namespace ts { root: ConditionalRoot; checkType: Type; extendsType: Type; - trueType: Type; - falseType: Type; + resolvedTrueType: Type; + resolvedFalseType: Type; } interface SubstitutionType extends InstantiableType { typeVariable: TypeVariable; @@ -2410,12 +2419,13 @@ declare namespace ts { enum InferencePriority { NakedTypeVariable = 1, HomomorphicMappedType = 2, - MappedTypeConstraint = 4, - ReturnType = 8, - LiteralKeyof = 16, - NoConstraints = 32, - AlwaysStrict = 64, - PriorityImpliesCombination = 28 + PartialHomomorphicMappedType = 4, + MappedTypeConstraint = 8, + ReturnType = 16, + LiteralKeyof = 32, + NoConstraints = 64, + AlwaysStrict = 128, + PriorityImpliesCombination = 56 } /** @deprecated Use FileExtensionInfo instead. */ type JsFileExtensionInfo = FileExtensionInfo; @@ -2489,6 +2499,7 @@ declare namespace ts { interface CompilerOptions { allowJs?: boolean; allowSyntheticDefaultImports?: boolean; + allowUmdGlobalAccess?: boolean; allowUnreachableCode?: boolean; allowUnusedLabels?: boolean; alwaysStrict?: boolean; @@ -2621,9 +2632,10 @@ declare namespace ts { ES2017 = 4, ES2018 = 5, ES2019 = 6, - ESNext = 7, + ES2020 = 7, + ESNext = 8, JSON = 100, - Latest = 7 + Latest = 8 } enum LanguageVariant { Standard = 0, @@ -2756,6 +2768,7 @@ declare namespace ts { resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference): (ResolvedTypeReferenceDirective | undefined)[]; getEnvironmentVariable?(name: string): string | undefined; createHash?(data: string): string; + getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined; } interface SourceMapRange extends TextRange { source?: SourceMapSource; @@ -3159,7 +3172,7 @@ declare namespace ts { reScanJsxToken(): JsxTokenSyntaxKind; reScanLessThanToken(): SyntaxKind; scanJsxToken(): JsxTokenSyntaxKind; - scanJSDocToken(): JsDocSyntaxKind; + scanJsDocToken(): JSDocSyntaxKind; scan(): SyntaxKind; getText(): string; setText(text: string | undefined, start?: number, length?: number): void; @@ -3627,7 +3640,7 @@ declare namespace ts { /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined; + function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine | undefined; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -3661,7 +3674,7 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine; + function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>, extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine; /** * Parse the contents of a config file (tsconfig.json). * @param jsonNode The contents of the config file to parse @@ -3669,7 +3682,20 @@ declare namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine; + function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>, extendedConfigCache?: Map<ExtendedConfigCacheEntry>): ParsedCommandLine; + interface ParsedTsconfig { + raw: any; + options?: CompilerOptions; + typeAcquisition?: TypeAcquisition; + /** + * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet + */ + extendedConfigPath?: string; + } + interface ExtendedConfigCacheEntry { + extendedResult: TsConfigSourceFile; + extendedConfig: ParsedTsconfig | undefined; + } function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; errors: Diagnostic[]; @@ -3714,7 +3740,7 @@ declare namespace ts { get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined; set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; } - function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; + function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache; function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; @@ -3837,7 +3863,7 @@ declare namespace ts { function updateArrayLiteral(node: ArrayLiteralExpression, elements: ReadonlyArray<Expression>): ArrayLiteralExpression; function createObjectLiteral(properties?: ReadonlyArray<ObjectLiteralElementLike>, multiLine?: boolean): ObjectLiteralExpression; function updateObjectLiteral(node: ObjectLiteralExpression, properties: ReadonlyArray<ObjectLiteralElementLike>): ObjectLiteralExpression; - function createPropertyAccess(expression: Expression, name: string | Identifier | undefined): PropertyAccessExpression; + function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression; function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression; function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression; function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression; @@ -4052,7 +4078,7 @@ declare namespace ts { function createInputFiles(javascriptText: string, declarationText: string): InputFiles; function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; - function updateBundle(node: Bundle, sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource>): Bundle; + function updateBundle(node: Bundle, sourceFiles: ReadonlyArray<SourceFile>, prepends?: ReadonlyArray<UnparsedSource | InputFiles>): Bundle; function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>): CallExpression; function createImmediatelyInvokedFunctionExpression(statements: ReadonlyArray<Statement>, param: ParameterDeclaration, paramValue: Expression): CallExpression; function createImmediatelyInvokedArrowFunction(statements: ReadonlyArray<Statement>): CallExpression; @@ -4540,13 +4566,12 @@ declare namespace ts.server { type ActionSet = "action::set"; type ActionInvalidate = "action::invalidate"; type ActionPackageInstalled = "action::packageInstalled"; - type ActionValueInspected = "action::valueInspected"; type EventTypesRegistry = "event::typesRegistry"; type EventBeginInstallTypes = "event::beginInstallTypes"; type EventEndInstallTypes = "event::endInstallTypes"; type EventInitializationFailed = "event::initializationFailed"; interface TypingInstallerResponse { - readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | ActionValueInspected | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; + readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; } interface TypingInstallerRequestWithProjectName { readonly projectName: string; @@ -4785,6 +4810,7 @@ declare namespace ts { getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): SignatureHelpItems | undefined; getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo; findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): ReadonlyArray<RenameLocation> | undefined; + getSmartSelectionRange(fileName: string, position: number): SelectionRange; getDefinitionAtPosition(fileName: string, position: number): ReadonlyArray<DefinitionInfo> | undefined; getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined; getTypeDefinitionAtPosition(fileName: string, position: number): ReadonlyArray<DefinitionInfo> | undefined; @@ -4979,16 +5005,9 @@ declare namespace ts { changes: ReadonlyArray<FileTextChanges>; commands?: ReadonlyArray<CodeActionCommand>; } - type CodeActionCommand = InstallPackageAction | GenerateTypesAction; + type CodeActionCommand = InstallPackageAction; interface InstallPackageAction { } - interface GenerateTypesAction extends GenerateTypesOptions { - } - interface GenerateTypesOptions { - readonly file: string; - readonly fileToGenerateTypesFor: string; - readonly outputFileName: string; - } /** * A set of one or more available refactoring actions, grouped under a parent refactoring. */ @@ -5236,6 +5255,10 @@ declare namespace ts { displayParts: SymbolDisplayPart[]; isOptional: boolean; } + interface SelectionRange { + textSpan: TextSpan; + parent?: SelectionRange; + } /** * Represents a single signature to show in signature help. * The id is used for subsequent calls into the language service to ask questions about the @@ -5612,10 +5635,6 @@ declare namespace ts { function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput; function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; } -declare namespace ts { - function generateTypesForModule(name: string, moduleValue: unknown, formatSettings: FormatCodeSettings): string; - function generateTypesForGlobal(name: string, globalValue: unknown, formatSettings: FormatCodeSettings): string; -} declare namespace ts { /** The version of the language service API */ const servicesVersion = "0.8"; diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js index da4767072f7c..56ae492c34c3 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js @@ -73,7 +73,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.4"; + ts.versionMajorMinor = "3.5"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".3"; })(ts || (ts = {})); @@ -205,7 +205,7 @@ var ts; entry.nextEntry.previousEntry = previousEntry; } // When the deleted entry was the last one, we need to - // adust the lastEntry reference. + // adjust the lastEntry reference. if (this.lastEntry === entry) { this.lastEntry = previousEntry; } @@ -315,7 +315,7 @@ var ts; ts.firstDefinedIterator = firstDefinedIterator; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assertEqual(arrayA.length, arrayB.length); + ts.Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } @@ -323,7 +323,7 @@ var ts; } ts.zipWith = zipWith; function zipToIterator(arrayA, arrayB) { - Debug.assertEqual(arrayA.length, arrayB.length); + ts.Debug.assertEqual(arrayA.length, arrayB.length); var i = 0; return { next: function () { @@ -337,7 +337,7 @@ var ts; } ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { - Debug.assert(keys.length === values.length); + ts.Debug.assert(keys.length === values.length); var map = createMap(); for (var i = 0; i < keys.length; ++i) { map.set(keys[i], values[i]); @@ -411,7 +411,7 @@ var ts; return result; } } - return Debug.fail(); + return ts.Debug.fail(); } ts.findMap = findMap; function contains(array, value, equalityComparer) { @@ -841,7 +841,7 @@ var ts; continue; case -1 /* LessThan */: // If `array` is sorted, `next` should **never** be less than `last`. - return Debug.fail("Array is unsorted."); + return ts.Debug.fail("Array is unsorted."); } deduplicated.push(last = next); } @@ -908,13 +908,13 @@ var ts; loopB: for (var offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) { if (offsetB > 0) { // Ensure `arrayB` is properly sorted. - Debug.assertGreaterThanOrEqual(comparer(arrayB[offsetB], arrayB[offsetB - 1]), 0 /* EqualTo */); + ts.Debug.assertGreaterThanOrEqual(comparer(arrayB[offsetB], arrayB[offsetB - 1]), 0 /* EqualTo */); } loopA: for (var startA = offsetA; offsetA < arrayA.length; offsetA++) { if (offsetA > startA) { // Ensure `arrayA` is properly sorted. We only need to perform this check if // `offsetA` has changed since we entered the loop. - Debug.assertGreaterThanOrEqual(comparer(arrayA[offsetA], arrayA[offsetA - 1]), 0 /* EqualTo */); + ts.Debug.assertGreaterThanOrEqual(comparer(arrayA[offsetA], arrayA[offsetA - 1]), 0 /* EqualTo */); } switch (comparer(arrayB[offsetB], arrayA[offsetA])) { case -1 /* LessThan */: @@ -1084,7 +1084,7 @@ var ts; } ts.firstOrUndefined = firstOrUndefined; function first(array) { - Debug.assert(array.length !== 0); + ts.Debug.assert(array.length !== 0); return array[0]; } ts.first = first; @@ -1096,7 +1096,7 @@ var ts; } ts.lastOrUndefined = lastOrUndefined; function last(array) { - Debug.assert(array.length !== 0); + ts.Debug.assert(array.length !== 0); return array[array.length - 1]; } ts.last = last; @@ -1421,7 +1421,7 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - return Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'."); } ts.cast = cast; /** Does nothing. */ @@ -1458,38 +1458,13 @@ var ts; }; } ts.memoize = memoize; - function chain(a, b, c, d, e) { + function compose(a, b, c, d, e) { if (e) { var args_2 = []; for (var i = 0; i < arguments.length; i++) { args_2[i] = arguments[i]; } - return function (t) { return compose.apply(void 0, map(args_2, function (f) { return f(t); })); }; - } - else if (d) { - return function (t) { return compose(a(t), b(t), c(t), d(t)); }; - } - else if (c) { - return function (t) { return compose(a(t), b(t), c(t)); }; - } - else if (b) { - return function (t) { return compose(a(t), b(t)); }; - } - else if (a) { - return function (t) { return compose(a(t)); }; - } - else { - return function (_) { return function (u) { return u; }; }; - } - } - ts.chain = chain; - function compose(a, b, c, d, e) { - if (e) { - var args_3 = []; - for (var i = 0; i < arguments.length; i++) { - args_3[i] = arguments[i]; - } - return function (t) { return reduceLeft(args_3, function (u, f) { return f(u); }, t); }; + return function (t) { return reduceLeft(args_2, function (u, f) { return f(u); }, t); }; } else if (d) { return function (t) { return d(c(b(a(t)))); }; @@ -1515,92 +1490,6 @@ var ts; AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; })(AssertionLevel = ts.AssertionLevel || (ts.AssertionLevel = {})); - var Debug; - (function (Debug) { - Debug.currentAssertionLevel = 0 /* None */; - Debug.isDebugging = false; - function shouldAssert(level) { - return Debug.currentAssertionLevel >= level; - } - Debug.shouldAssert = shouldAssert; - function assert(expression, message, verboseDebugInfo, stackCrawlMark) { - if (!expression) { - if (verboseDebugInfo) { - message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); - } - fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); - } - } - Debug.assert = assert; - function assertEqual(a, b, msg, msg2) { - if (a !== b) { - var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; - fail("Expected " + a + " === " + b + ". " + message); - } - } - Debug.assertEqual = assertEqual; - function assertLessThan(a, b, msg) { - if (a >= b) { - fail("Expected " + a + " < " + b + ". " + (msg || "")); - } - } - Debug.assertLessThan = assertLessThan; - function assertLessThanOrEqual(a, b) { - if (a > b) { - fail("Expected " + a + " <= " + b); - } - } - Debug.assertLessThanOrEqual = assertLessThanOrEqual; - function assertGreaterThanOrEqual(a, b) { - if (a < b) { - fail("Expected " + a + " >= " + b); - } - } - Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; - function fail(message, stackCrawlMark) { - debugger; - var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); - if (Error.captureStackTrace) { - Error.captureStackTrace(e, stackCrawlMark || fail); - } - throw e; - } - Debug.fail = fail; - function assertDefined(value, message) { - if (value === undefined || value === null) - return fail(message); - return value; - } - Debug.assertDefined = assertDefined; - function assertEachDefined(value, message) { - for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { - var v = value_1[_i]; - assertDefined(v, message); - } - return value; - } - Debug.assertEachDefined = assertEachDefined; - function assertNever(member, message, stackCrawlMark) { - if (message === void 0) { message = "Illegal value:"; } - var detail = typeof member === "object" && "kind" in member && "pos" in member ? "SyntaxKind: " + Debug.showSyntaxKind(member) : JSON.stringify(member); - return fail(message + " " + detail, stackCrawlMark || assertNever); - } - Debug.assertNever = assertNever; - function getFunctionName(func) { - if (typeof func !== "function") { - return ""; - } - else if (func.hasOwnProperty("name")) { - return func.name; - } - else { - var text = Function.prototype.toString.call(func); - var match = /^function\s+([\w\$]+)\s*\(/.exec(text); - return match ? match[1] : ""; - } - } - Debug.getFunctionName = getFunctionName; - })(Debug = ts.Debug || (ts.Debug = {})); function equateValues(a, b) { return a === b; } @@ -1857,7 +1746,7 @@ var ts; bestCandidate = candidate; } else { - Debug.assert(distance < bestDistance); // Else `levenshteinWithMax` should return undefined + ts.Debug.assert(distance < bestDistance); // Else `levenshteinWithMax` should return undefined bestDistance = distance; bestCandidate = candidate; } @@ -2001,7 +1890,7 @@ var ts; * E.g.: matchedText(tryParsePattern("foo*baz"), "foobarbaz") === "bar" */ function matchedText(pattern, candidate) { - Debug.assert(isPatternMatch(pattern, candidate)); + ts.Debug.assert(isPatternMatch(pattern, candidate)); return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; @@ -2094,6 +1983,267 @@ var ts; return result; } ts.fill = fill; + function cartesianProduct(arrays) { + var result = []; + cartesianProductWorker(arrays, result, /*outer*/ undefined, 0); + return result; + } + ts.cartesianProduct = cartesianProduct; + function cartesianProductWorker(arrays, result, outer, index) { + for (var _i = 0, _a = arrays[index]; _i < _a.length; _i++) { + var element = _a[_i]; + var inner = void 0; + if (outer) { + inner = outer.slice(); + inner.push(element); + } + else { + inner = [element]; + } + if (index === arrays.length - 1) { + result.push(inner); + } + else { + cartesianProductWorker(arrays, result, inner, index + 1); + } + } + } +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var Debug; + (function (Debug) { + Debug.currentAssertionLevel = 0 /* None */; + Debug.isDebugging = false; + function shouldAssert(level) { + return Debug.currentAssertionLevel >= level; + } + Debug.shouldAssert = shouldAssert; + function assert(expression, message, verboseDebugInfo, stackCrawlMark) { + if (!expression) { + if (verboseDebugInfo) { + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); + } + fail(message ? "False expression: " + message : "False expression.", stackCrawlMark || assert); + } + } + Debug.assert = assert; + function assertEqual(a, b, msg, msg2) { + if (a !== b) { + var message = msg ? msg2 ? msg + " " + msg2 : msg : ""; + fail("Expected " + a + " === " + b + ". " + message); + } + } + Debug.assertEqual = assertEqual; + function assertLessThan(a, b, msg) { + if (a >= b) { + fail("Expected " + a + " < " + b + ". " + (msg || "")); + } + } + Debug.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a, b) { + if (a > b) { + fail("Expected " + a + " <= " + b); + } + } + Debug.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a, b) { + if (a < b) { + fail("Expected " + a + " >= " + b); + } + } + Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual; + function fail(message, stackCrawlMark) { + debugger; + var e = new Error(message ? "Debug Failure. " + message : "Debug Failure."); + if (Error.captureStackTrace) { + Error.captureStackTrace(e, stackCrawlMark || fail); + } + throw e; + } + Debug.fail = fail; + function assertDefined(value, message) { + if (value === undefined || value === null) + return fail(message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; + function assertNever(member, message, stackCrawlMark) { + if (message === void 0) { message = "Illegal value:"; } + var detail = typeof member === "object" && "kind" in member && "pos" in member && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); + return fail(message + " " + detail, stackCrawlMark || assertNever); + } + Debug.assertNever = assertNever; + function getFunctionName(func) { + if (typeof func !== "function") { + return ""; + } + else if (func.hasOwnProperty("name")) { + return func.name; + } + else { + var text = Function.prototype.toString.call(func); + var match = /^function\s+([\w\$]+)\s*\(/.exec(text); + return match ? match[1] : ""; + } + } + Debug.getFunctionName = getFunctionName; + function formatSymbol(symbol) { + return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }"; + } + Debug.formatSymbol = formatSymbol; + /** + * Formats an enum value as a string for debugging and debug assertions. + */ + function formatEnum(value, enumObject, isFlags) { + if (value === void 0) { value = 0; } + var members = getEnumMembers(enumObject); + if (value === 0) { + return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; + } + if (isFlags) { + var result = ""; + var remainingFlags = value; + for (var i = members.length - 1; i >= 0 && remainingFlags !== 0; i--) { + var _a = members[i], enumValue = _a[0], enumName = _a[1]; + if (enumValue !== 0 && (remainingFlags & enumValue) === enumValue) { + remainingFlags &= ~enumValue; + result = "" + enumName + (result ? "|" : "") + result; + } + } + if (remainingFlags === 0) { + return result; + } + } + else { + for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { + var _b = members_1[_i], enumValue = _b[0], enumName = _b[1]; + if (enumValue === value) { + return enumName; + } + } + } + return value.toString(); + } + Debug.formatEnum = formatEnum; + function getEnumMembers(enumObject) { + var result = []; + for (var name in enumObject) { + var value = enumObject[name]; + if (typeof value === "number") { + result.push([value, name]); + } + } + return ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); }); + } + function formatSyntaxKind(kind) { + return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false); + } + Debug.formatSyntaxKind = formatSyntaxKind; + function formatNodeFlags(flags) { + return formatEnum(flags, ts.NodeFlags, /*isFlags*/ true); + } + Debug.formatNodeFlags = formatNodeFlags; + function formatModifierFlags(flags) { + return formatEnum(flags, ts.ModifierFlags, /*isFlags*/ true); + } + Debug.formatModifierFlags = formatModifierFlags; + function formatTransformFlags(flags) { + return formatEnum(flags, ts.TransformFlags, /*isFlags*/ true); + } + Debug.formatTransformFlags = formatTransformFlags; + function formatEmitFlags(flags) { + return formatEnum(flags, ts.EmitFlags, /*isFlags*/ true); + } + Debug.formatEmitFlags = formatEmitFlags; + function formatSymbolFlags(flags) { + return formatEnum(flags, ts.SymbolFlags, /*isFlags*/ true); + } + Debug.formatSymbolFlags = formatSymbolFlags; + function formatTypeFlags(flags) { + return formatEnum(flags, ts.TypeFlags, /*isFlags*/ true); + } + Debug.formatTypeFlags = formatTypeFlags; + function formatObjectFlags(flags) { + return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); + } + Debug.formatObjectFlags = formatObjectFlags; + function failBadSyntaxKind(node, message) { + return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", failBadSyntaxKind); + } + Debug.failBadSyntaxKind = failBadSyntaxKind; + Debug.assertEachNode = shouldAssert(1 /* Normal */) + ? function (nodes, test, message) { return assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, Debug.assertEachNode); } + : ts.noop; + Debug.assertNode = shouldAssert(1 /* Normal */) + ? function (node, test, message) { return assert(test === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, Debug.assertNode); } + : ts.noop; + Debug.assertOptionalNode = shouldAssert(1 /* Normal */) + ? function (node, test, message) { return assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, Debug.assertOptionalNode); } + : ts.noop; + Debug.assertOptionalToken = shouldAssert(1 /* Normal */) + ? function (node, kind, message) { return assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, Debug.assertOptionalToken); } + : ts.noop; + Debug.assertMissingNode = shouldAssert(1 /* Normal */) + ? function (node, message) { return assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, Debug.assertMissingNode); } + : ts.noop; + var isDebugInfoEnabled = false; + /** + * Injects debug information into frequently used types. + */ + function enableDebugInfo() { + if (isDebugInfoEnabled) + return; + // Add additional properties in debug mode to assist with debugging. + Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { + __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } + }); + Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { + __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, + __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, + }); + var nodeConstructors = [ + ts.objectAllocator.getNodeConstructor(), + ts.objectAllocator.getIdentifierConstructor(), + ts.objectAllocator.getTokenConstructor(), + ts.objectAllocator.getSourceFileConstructor() + ]; + for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) { + var ctor = nodeConstructors_1[_i]; + if (!ctor.prototype.hasOwnProperty("__debugKind")) { + Object.defineProperties(ctor.prototype, { + __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, + __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, + __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getModifierFlagsNoCache(this)); } }, + __debugTransformFlags: { get: function () { return formatTransformFlags(this.transformFlags); } }, + __debugIsParseTreeNode: { get: function () { return ts.isParseTreeNode(this); } }, + __debugEmitFlags: { get: function () { return formatEmitFlags(ts.getEmitFlags(this)); } }, + __debugGetText: { + value: function (includeTrivia) { + if (ts.nodeIsSynthesized(this)) + return ""; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; + } + } + }); + } + } + isDebugInfoEnabled = true; + } + Debug.enableDebugInfo = enableDebugInfo; + })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -2646,309 +2796,311 @@ var ts; SyntaxKind[SyntaxKind["QuestionToken"] = 56] = "QuestionToken"; SyntaxKind[SyntaxKind["ColonToken"] = 57] = "ColonToken"; SyntaxKind[SyntaxKind["AtToken"] = 58] = "AtToken"; + /** Only the JSDoc scanner produces BacktickToken. The normal scanner produces NoSubstitutionTemplateLiteral and related kinds. */ + SyntaxKind[SyntaxKind["BacktickToken"] = 59] = "BacktickToken"; // Assignments - SyntaxKind[SyntaxKind["EqualsToken"] = 59] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 60] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 61] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 62] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 63] = "AsteriskAsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 64] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 65] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 66] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 67] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 68] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 69] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 70] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 71] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 60] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 61] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 62] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 63] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 64] = "AsteriskAsteriskEqualsToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 65] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 66] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 67] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 68] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 69] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 70] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 71] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 72] = "CaretEqualsToken"; // Identifiers - SyntaxKind[SyntaxKind["Identifier"] = 72] = "Identifier"; + SyntaxKind[SyntaxKind["Identifier"] = 73] = "Identifier"; // Reserved words - SyntaxKind[SyntaxKind["BreakKeyword"] = 73] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 74] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 75] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 76] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 77] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 78] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 79] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 80] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 81] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 82] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 83] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 84] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 85] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 86] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 87] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 88] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 89] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 90] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 91] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 92] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 93] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 94] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 95] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 96] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 97] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 98] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 99] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 100] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 101] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 102] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 103] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 104] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 105] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 106] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 107] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 108] = "WithKeyword"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 74] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 75] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 76] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 77] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 78] = "ConstKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 79] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 80] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 81] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 82] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 83] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 84] = "ElseKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 85] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 86] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 87] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 88] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 89] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 90] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 91] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 92] = "IfKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 93] = "ImportKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 94] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 95] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 96] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 97] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 98] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 99] = "SuperKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 100] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 101] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 102] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 103] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 104] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 105] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 106] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 107] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 108] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 109] = "WithKeyword"; // Strict mode reserved words - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 109] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 110] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 111] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 112] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 113] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 114] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 115] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 116] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 117] = "YieldKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 110] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 111] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 112] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 113] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 114] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 115] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 116] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 117] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 118] = "YieldKeyword"; // Contextual keywords - SyntaxKind[SyntaxKind["AbstractKeyword"] = 118] = "AbstractKeyword"; - SyntaxKind[SyntaxKind["AsKeyword"] = 119] = "AsKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 120] = "AnyKeyword"; - SyntaxKind[SyntaxKind["AsyncKeyword"] = 121] = "AsyncKeyword"; - SyntaxKind[SyntaxKind["AwaitKeyword"] = 122] = "AwaitKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 123] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 124] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 125] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 126] = "GetKeyword"; - SyntaxKind[SyntaxKind["InferKeyword"] = 127] = "InferKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 128] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 129] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 130] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 131] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 132] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 133] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 134] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 135] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 136] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 137] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 138] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 139] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 140] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 141] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 142] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 143] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 144] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 145] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 146] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 147] = "OfKeyword"; + SyntaxKind[SyntaxKind["AbstractKeyword"] = 119] = "AbstractKeyword"; + SyntaxKind[SyntaxKind["AsKeyword"] = 120] = "AsKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 121] = "AnyKeyword"; + SyntaxKind[SyntaxKind["AsyncKeyword"] = 122] = "AsyncKeyword"; + SyntaxKind[SyntaxKind["AwaitKeyword"] = 123] = "AwaitKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 124] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 125] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 126] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 127] = "GetKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 128] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 129] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 130] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 131] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 132] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 133] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 134] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 135] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 136] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 137] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 138] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 139] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 140] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 141] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 142] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 143] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 144] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 145] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 146] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 147] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 148] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 148] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 149] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 149] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 150] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 150] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 151] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 152] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 151] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 152] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 153] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 153] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 154] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 155] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 156] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 157] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 158] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 159] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 160] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 161] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 162] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 154] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 155] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 156] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 157] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 158] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 159] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 160] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 161] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 162] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 163] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 163] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 164] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 165] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 166] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 167] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 168] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 169] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 170] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 171] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 172] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 173] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 174] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 175] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 176] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 177] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 178] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 179] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 180] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 181] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 182] = "LiteralType"; - SyntaxKind[SyntaxKind["ImportType"] = 183] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 164] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 165] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 166] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 167] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 168] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 169] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 170] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 171] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 172] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 173] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 174] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 175] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 176] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 177] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 178] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 179] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 180] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 181] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 182] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 183] = "LiteralType"; + SyntaxKind[SyntaxKind["ImportType"] = 184] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 184] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 185] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 186] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 185] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 186] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 187] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 187] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 188] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 189] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 190] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 191] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 192] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 193] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 194] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 195] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 196] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 197] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 198] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 199] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 200] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 201] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 202] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 203] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 204] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 205] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 206] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 207] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 208] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 209] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 210] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 211] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 212] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 213] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 214] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 215] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 188] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 189] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 190] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 191] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 192] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 193] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 194] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 195] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 196] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 197] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 198] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 199] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 200] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 201] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 202] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 203] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 204] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 205] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 206] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 207] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 208] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 209] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 210] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 211] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 212] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 213] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 214] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 215] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 216] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 216] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 217] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 217] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 218] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 218] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 219] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 220] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 221] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 222] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 223] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 224] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 225] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 226] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 227] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 228] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 229] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 230] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 231] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 232] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 233] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 234] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 235] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 236] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 237] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 238] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 239] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 240] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 241] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 242] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 243] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 244] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 245] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 246] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 247] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 248] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 249] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 250] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 251] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 252] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 253] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 254] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 255] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 256] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 257] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 258] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 219] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 220] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 221] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 222] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 223] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 224] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 225] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 226] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 227] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 228] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 229] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 230] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 231] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 232] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 233] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 234] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 235] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 236] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 237] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 238] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 239] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 240] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 241] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 242] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 243] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 244] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 245] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 246] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 247] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 248] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 249] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 250] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 251] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 252] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 253] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 254] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 255] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 256] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 257] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 258] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 259] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 259] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 260] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 260] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 261] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 262] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 263] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 264] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 265] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 266] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 267] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 268] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 269] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 270] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 261] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 262] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 263] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 264] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 265] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 266] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 267] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 268] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 269] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 270] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 271] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 271] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 272] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 273] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 274] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 272] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 273] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 274] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 275] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 275] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 276] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 277] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 276] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 277] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 278] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 278] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 279] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 279] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 280] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 281] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 282] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 283] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 280] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 281] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 282] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 283] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 284] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 284] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 285] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 286] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 287] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 285] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 286] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 287] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 288] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 288] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 289] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 289] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 290] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 290] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 291] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 292] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 293] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 294] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 295] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 296] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 297] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 298] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 299] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 300] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 301] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 302] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 303] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 304] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 305] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 306] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 307] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 308] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 309] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 310] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 291] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 292] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 293] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 294] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 295] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 296] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 297] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 298] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 299] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 300] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 301] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 302] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 303] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 304] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 305] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 306] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 307] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 308] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 309] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 310] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 311] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 311] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 312] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 312] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 313] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 314] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 315] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 316] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 313] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 314] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 315] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 316] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 317] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 317] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 318] = "Count"; // Markers - SyntaxKind[SyntaxKind["FirstAssignment"] = 59] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = 71] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 60] = "FirstCompoundAssignment"; - SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 71] = "LastCompoundAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = 73] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = 108] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = 73] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 147] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 109] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 117] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 163] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 183] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstAssignment"] = 60] = "FirstAssignment"; + SyntaxKind[SyntaxKind["LastAssignment"] = 72] = "LastAssignment"; + SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 61] = "FirstCompoundAssignment"; + SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 72] = "LastCompoundAssignment"; + SyntaxKind[SyntaxKind["FirstReservedWord"] = 74] = "FirstReservedWord"; + SyntaxKind[SyntaxKind["LastReservedWord"] = 109] = "LastReservedWord"; + SyntaxKind[SyntaxKind["FirstKeyword"] = 74] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 148] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 110] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 118] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 164] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 184] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = 71] = "LastPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = 72] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 147] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 148] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -2956,14 +3108,14 @@ var ts; SyntaxKind[SyntaxKind["FirstTemplateToken"] = 14] = "FirstTemplateToken"; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 28] = "FirstBinaryOperator"; - SyntaxKind[SyntaxKind["LastBinaryOperator"] = 71] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 148] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 288] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 310] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 299] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 310] = "LastJSDocTagNode"; - /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 118] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 147] = "LastContextualKeyword"; + SyntaxKind[SyntaxKind["LastBinaryOperator"] = 72] = "LastBinaryOperator"; + SyntaxKind[SyntaxKind["FirstNode"] = 149] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 289] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 311] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 300] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 311] = "LastJSDocTagNode"; + /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 119] = "FirstContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 148] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -3106,6 +3258,8 @@ var ts; FlowFlags[FlowFlags["Shared"] = 1024] = "Shared"; FlowFlags[FlowFlags["PreFinally"] = 2048] = "PreFinally"; FlowFlags[FlowFlags["AfterFinally"] = 4096] = "AfterFinally"; + /** @internal */ + FlowFlags[FlowFlags["Cached"] = 8192] = "Cached"; FlowFlags[FlowFlags["Label"] = 12] = "Label"; FlowFlags[FlowFlags["Condition"] = 96] = "Condition"; })(FlowFlags = ts.FlowFlags || (ts.FlowFlags = {})); @@ -3358,19 +3512,22 @@ var ts; CheckFlags[CheckFlags["SyntheticProperty"] = 2] = "SyntheticProperty"; CheckFlags[CheckFlags["SyntheticMethod"] = 4] = "SyntheticMethod"; CheckFlags[CheckFlags["Readonly"] = 8] = "Readonly"; - CheckFlags[CheckFlags["Partial"] = 16] = "Partial"; - CheckFlags[CheckFlags["HasNonUniformType"] = 32] = "HasNonUniformType"; - CheckFlags[CheckFlags["HasLiteralType"] = 64] = "HasLiteralType"; - CheckFlags[CheckFlags["ContainsPublic"] = 128] = "ContainsPublic"; - CheckFlags[CheckFlags["ContainsProtected"] = 256] = "ContainsProtected"; - CheckFlags[CheckFlags["ContainsPrivate"] = 512] = "ContainsPrivate"; - CheckFlags[CheckFlags["ContainsStatic"] = 1024] = "ContainsStatic"; - CheckFlags[CheckFlags["Late"] = 2048] = "Late"; - CheckFlags[CheckFlags["ReverseMapped"] = 4096] = "ReverseMapped"; - CheckFlags[CheckFlags["OptionalParameter"] = 8192] = "OptionalParameter"; - CheckFlags[CheckFlags["RestParameter"] = 16384] = "RestParameter"; + CheckFlags[CheckFlags["ReadPartial"] = 16] = "ReadPartial"; + CheckFlags[CheckFlags["WritePartial"] = 32] = "WritePartial"; + CheckFlags[CheckFlags["HasNonUniformType"] = 64] = "HasNonUniformType"; + CheckFlags[CheckFlags["HasLiteralType"] = 128] = "HasLiteralType"; + CheckFlags[CheckFlags["ContainsPublic"] = 256] = "ContainsPublic"; + CheckFlags[CheckFlags["ContainsProtected"] = 512] = "ContainsProtected"; + CheckFlags[CheckFlags["ContainsPrivate"] = 1024] = "ContainsPrivate"; + CheckFlags[CheckFlags["ContainsStatic"] = 2048] = "ContainsStatic"; + CheckFlags[CheckFlags["Late"] = 4096] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 8192] = "ReverseMapped"; + CheckFlags[CheckFlags["OptionalParameter"] = 16384] = "OptionalParameter"; + CheckFlags[CheckFlags["RestParameter"] = 32768] = "RestParameter"; + CheckFlags[CheckFlags["DeferredType"] = 65536] = "DeferredType"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; - CheckFlags[CheckFlags["Discriminant"] = 96] = "Discriminant"; + CheckFlags[CheckFlags["Discriminant"] = 192] = "Discriminant"; + CheckFlags[CheckFlags["Partial"] = 48] = "Partial"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; (function (InternalSymbolName) { @@ -3480,7 +3637,9 @@ var ts; TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ - TypeFlags[TypeFlags["ObjectFlagsType"] = 3768320] = "ObjectFlagsType"; + TypeFlags[TypeFlags["ObjectFlagsType"] = 3899392] = "ObjectFlagsType"; + /* @internal */ + TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; @@ -3528,7 +3687,7 @@ var ts; /* @internal */ ObjectFlags[ObjectFlags["ContainsObjectLiteral"] = 262144] = "ContainsObjectLiteral"; /* @internal */ - ObjectFlags[ObjectFlags["ContainsAnyFunctionType"] = 524288] = "ContainsAnyFunctionType"; + ObjectFlags[ObjectFlags["NonInferrableType"] = 524288] = "NonInferrableType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 393216] = "RequiresWidening"; @@ -3536,14 +3695,18 @@ var ts; ObjectFlags[ObjectFlags["PropagatingFlags"] = 917504] = "PropagatingFlags"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ - var Variance; - (function (Variance) { - Variance[Variance["Invariant"] = 0] = "Invariant"; - Variance[Variance["Covariant"] = 1] = "Covariant"; - Variance[Variance["Contravariant"] = 2] = "Contravariant"; - Variance[Variance["Bivariant"] = 3] = "Bivariant"; - Variance[Variance["Independent"] = 4] = "Independent"; - })(Variance = ts.Variance || (ts.Variance = {})); + var VarianceFlags; + (function (VarianceFlags) { + VarianceFlags[VarianceFlags["Invariant"] = 0] = "Invariant"; + VarianceFlags[VarianceFlags["Covariant"] = 1] = "Covariant"; + VarianceFlags[VarianceFlags["Contravariant"] = 2] = "Contravariant"; + VarianceFlags[VarianceFlags["Bivariant"] = 3] = "Bivariant"; + VarianceFlags[VarianceFlags["Independent"] = 4] = "Independent"; + VarianceFlags[VarianceFlags["VarianceMask"] = 7] = "VarianceMask"; + VarianceFlags[VarianceFlags["Unmeasurable"] = 8] = "Unmeasurable"; + VarianceFlags[VarianceFlags["Unreliable"] = 16] = "Unreliable"; + VarianceFlags[VarianceFlags["AllowsStructuralFallback"] = 24] = "AllowsStructuralFallback"; + })(VarianceFlags = ts.VarianceFlags || (ts.VarianceFlags = {})); /* @internal */ var JsxReferenceKind; (function (JsxReferenceKind) { @@ -3565,12 +3728,13 @@ var ts; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; InferencePriority[InferencePriority["HomomorphicMappedType"] = 2] = "HomomorphicMappedType"; - InferencePriority[InferencePriority["MappedTypeConstraint"] = 4] = "MappedTypeConstraint"; - InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; - InferencePriority[InferencePriority["LiteralKeyof"] = 16] = "LiteralKeyof"; - InferencePriority[InferencePriority["NoConstraints"] = 32] = "NoConstraints"; - InferencePriority[InferencePriority["AlwaysStrict"] = 64] = "AlwaysStrict"; - InferencePriority[InferencePriority["PriorityImpliesCombination"] = 28] = "PriorityImpliesCombination"; + InferencePriority[InferencePriority["PartialHomomorphicMappedType"] = 4] = "PartialHomomorphicMappedType"; + InferencePriority[InferencePriority["MappedTypeConstraint"] = 8] = "MappedTypeConstraint"; + InferencePriority[InferencePriority["ReturnType"] = 16] = "ReturnType"; + InferencePriority[InferencePriority["LiteralKeyof"] = 32] = "LiteralKeyof"; + InferencePriority[InferencePriority["NoConstraints"] = 64] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 128] = "AlwaysStrict"; + InferencePriority[InferencePriority["PriorityImpliesCombination"] = 56] = "PriorityImpliesCombination"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); /* @internal */ var InferenceFlags; @@ -3687,9 +3851,10 @@ var ts; ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; ScriptTarget[ScriptTarget["ES2018"] = 5] = "ES2018"; ScriptTarget[ScriptTarget["ES2019"] = 6] = "ES2019"; - ScriptTarget[ScriptTarget["ESNext"] = 7] = "ESNext"; + ScriptTarget[ScriptTarget["ES2020"] = 7] = "ES2020"; + ScriptTarget[ScriptTarget["ESNext"] = 8] = "ESNext"; ScriptTarget[ScriptTarget["JSON"] = 100] = "JSON"; - ScriptTarget[ScriptTarget["Latest"] = 7] = "Latest"; + ScriptTarget[ScriptTarget["Latest"] = 8] = "Latest"; })(ScriptTarget = ts.ScriptTarget || (ts.ScriptTarget = {})); var LanguageVariant; (function (LanguageVariant) { @@ -4102,17 +4267,10 @@ var ts; PragmaKindFlags[PragmaKindFlags["All"] = 7] = "All"; PragmaKindFlags[PragmaKindFlags["Default"] = 7] = "Default"; })(PragmaKindFlags = ts.PragmaKindFlags || (ts.PragmaKindFlags = {})); - /** - * This function only exists to cause exact types to be inferred for all the literals within `commentPragmas` - */ - /* @internal */ - function _contextuallyTypePragmas(args) { - return args; - } // While not strictly a type, this is here because `PragmaMap` needs to be here to be used with `SourceFile`, and we don't // fancy effectively defining it twice, once in value-space and once in type-space /* @internal */ - ts.commentPragmas = _contextuallyTypePragmas({ + ts.commentPragmas = { "reference": { args: [ { name: "types", optional: true, captureSpan: true }, @@ -4140,7 +4298,7 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - }); + }; })(ts || (ts = {})); var ts; (function (ts) { @@ -5187,7 +5345,7 @@ var ts; _0_modifier_cannot_appear_on_a_data_property: diag(1043, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_data_property_1043", "'{0}' modifier cannot appear on a data property."), _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."), A_0_modifier_cannot_be_used_with_an_interface_declaration: diag(1045, ts.DiagnosticCategory.Error, "A_0_modifier_cannot_be_used_with_an_interface_declaration_1045", "A '{0}' modifier cannot be used with an interface declaration."), - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: diag(1046, ts.DiagnosticCategory.Error, "A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file_1046", "A 'declare' modifier is required for a top level declaration in a .d.ts file."), + Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, ts.DiagnosticCategory.Error, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."), A_rest_parameter_cannot_be_optional: diag(1047, ts.DiagnosticCategory.Error, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."), A_rest_parameter_cannot_have_an_initializer: diag(1048, ts.DiagnosticCategory.Error, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."), A_set_accessor_must_have_exactly_one_parameter: diag(1049, ts.DiagnosticCategory.Error, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."), @@ -5316,7 +5474,7 @@ var ts; Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided: diag(1205, ts.DiagnosticCategory.Error, "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205", "Cannot re-export a type when the '--isolatedModules' flag is provided."), 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."), - Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided_1208", "Cannot compile namespaces when the '--isolatedModules' flag is provided."), + 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."), @@ -5325,7 +5483,7 @@ var ts; Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, ts.DiagnosticCategory.Error, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, ts.DiagnosticCategory.Error, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: diag(1219, ts.DiagnosticCategory.Error, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning."), + 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: diag(1219, ts.DiagnosticCategory.Error, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "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."), Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: diag(1220, ts.DiagnosticCategory.Error, "Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher_1220", "Generators are only available when targeting ECMAScript 2015 or higher."), Generators_are_not_allowed_in_an_ambient_context: diag(1221, ts.DiagnosticCategory.Error, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, ts.DiagnosticCategory.Error, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), @@ -5364,6 +5522,8 @@ 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"), 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_expression_is_only_allowed_within_an_async_function: diag(1308, ts.DiagnosticCategory.Error, "await_expression_is_only_allowed_within_an_async_function_1308", "'await' expression is only allowed within an async function."), can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: diag(1312, ts.DiagnosticCategory.Error, "can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment_1312", "'=' can only be used in an object literal property inside a destructuring assignment."), @@ -5408,7 +5568,8 @@ var ts; A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts.DiagnosticCategory.Error, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), A_bigint_literal_must_be_an_integer: diag(1353, ts.DiagnosticCategory.Error, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, ts.DiagnosticCategory.Error, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."), - A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal: diag(1355, ts.DiagnosticCategory.Error, "A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal_1355", "A 'const' assertion can only be applied to a string, number, boolean, array, or object literal."), + A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, ts.DiagnosticCategory.Error, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."), + Did_you_mean_to_mark_this_function_as_async: diag(1356, ts.DiagnosticCategory.Error, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5690,6 +5851,7 @@ var ts; 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."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5802,6 +5964,7 @@ var ts; Circularity_originates_in_type_at_this_location: diag(2751, ts.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), The_first_export_default_is_here: diag(2752, ts.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), Another_export_default_is_here: diag(2753, ts.DiagnosticCategory.Error, "Another_export_default_is_here_2753", "Another export default is here."), + super_may_not_use_type_arguments: diag(2754, ts.DiagnosticCategory.Error, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."), 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}'."), @@ -5886,6 +6049,7 @@ var ts; Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, ts.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, ts.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."), Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."), + The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, ts.DiagnosticCategory.Error, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."), The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), @@ -5919,6 +6083,8 @@ var ts; Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, ts.DiagnosticCategory.Error, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."), Unknown_build_option_0: diag(5072, ts.DiagnosticCategory.Error, "Unknown_build_option_0_5072", "Unknown build option '{0}'."), Build_option_0_requires_a_value_of_type_1: diag(5073, ts.DiagnosticCategory.Error, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."), + Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, ts.DiagnosticCategory.Error, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option `--tsBuildInfoFile` is specified."), + _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, ts.DiagnosticCategory.Error, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."), 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."), @@ -6095,7 +6261,6 @@ var ts; Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), - Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, ts.DiagnosticCategory.Message, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), All_imports_in_import_declaration_are_unused: diag(6192, ts.DiagnosticCategory.Error, "All_imports_in_import_declaration_are_unused_6192", "All imports in import declaration are unused.", /*reportsUnnecessary*/ true), Found_1_error_Watching_for_file_changes: diag(6193, ts.DiagnosticCategory.Message, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."), @@ -6122,6 +6287,9 @@ var ts; Using_compiler_options_of_project_reference_redirect_0: diag(6215, ts.DiagnosticCategory.Message, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."), Found_1_error: diag(6216, ts.DiagnosticCategory.Message, "Found_1_error_6216", "Found 1 error."), Found_0_errors: diag(6217, ts.DiagnosticCategory.Message, "Found_0_errors_6217", "Found {0} errors."), + Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, ts.DiagnosticCategory.Message, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"), + Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, ts.DiagnosticCategory.Message, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"), + package_json_had_a_falsy_0_field: diag(6220, ts.DiagnosticCategory.Message, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."), 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"), 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}"), @@ -6210,6 +6378,9 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), + Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}' ?"), + 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}'."), 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_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6371,8 +6542,6 @@ var ts; Add_all_missing_imports: diag(95064, ts.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), Convert_to_async_function: diag(95065, ts.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), Convert_all_to_async_functions: diag(95066, ts.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), - Generate_types_for_0: diag(95067, ts.DiagnosticCategory.Message, "Generate_types_for_0_95067", "Generate types for '{0}'"), - Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), @@ -6380,6 +6549,13 @@ var ts; Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), Convert_parameters_to_destructured_object: diag(95075, ts.DiagnosticCategory.Message, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"), + Allow_accessing_UMD_globals_from_modules: diag(95076, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_95076", "Allow accessing UMD globals from modules."), + Extract_type: diag(95077, ts.DiagnosticCategory.Message, "Extract_type_95077", "Extract type"), + Extract_to_type_alias: diag(95078, ts.DiagnosticCategory.Message, "Extract_to_type_alias_95078", "Extract to type alias"), + Extract_to_typedef: diag(95079, ts.DiagnosticCategory.Message, "Extract_to_typedef_95079", "Extract to typedef"), + 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."), + Quoted_constructors_have_previously_been_interpreted_as_methods_which_is_incorrect_In_TypeScript_3_6_they_will_be_correctly_parsed_as_constructors_In_the_meantime_consider_using_constructor_to_write_a_constructor_or_constructor_to_write_a_method: diag(18005, ts.DiagnosticCategory.Error, "Quoted_constructors_have_previously_been_interpreted_as_methods_which_is_incorrect_In_TypeScript_3_6_18005", "Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '[\"constructor\"]()' to write a method."), + 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'."), }; })(ts || (ts = {})); var ts; @@ -6387,7 +6563,7 @@ var ts; var _a; /* @internal */ function tokenIsIdentifierOrKeyword(token) { - return token >= 72 /* Identifier */; + return token >= 73 /* Identifier */; } ts.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; /* @internal */ @@ -6396,85 +6572,85 @@ var ts; } ts.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan; var textToKeywordObj = (_a = { - abstract: 118 /* AbstractKeyword */, - any: 120 /* AnyKeyword */, - as: 119 /* AsKeyword */, - bigint: 146 /* BigIntKeyword */, - boolean: 123 /* BooleanKeyword */, - break: 73 /* BreakKeyword */, - case: 74 /* CaseKeyword */, - catch: 75 /* CatchKeyword */, - class: 76 /* ClassKeyword */, - continue: 78 /* ContinueKeyword */, - const: 77 /* ConstKeyword */ + abstract: 119 /* AbstractKeyword */, + any: 121 /* AnyKeyword */, + as: 120 /* AsKeyword */, + bigint: 147 /* BigIntKeyword */, + boolean: 124 /* BooleanKeyword */, + break: 74 /* BreakKeyword */, + case: 75 /* CaseKeyword */, + catch: 76 /* CatchKeyword */, + class: 77 /* ClassKeyword */, + continue: 79 /* ContinueKeyword */, + const: 78 /* ConstKeyword */ }, - _a["" + "constructor"] = 124 /* ConstructorKeyword */, - _a.debugger = 79 /* DebuggerKeyword */, - _a.declare = 125 /* DeclareKeyword */, - _a.default = 80 /* DefaultKeyword */, - _a.delete = 81 /* DeleteKeyword */, - _a.do = 82 /* DoKeyword */, - _a.else = 83 /* ElseKeyword */, - _a.enum = 84 /* EnumKeyword */, - _a.export = 85 /* ExportKeyword */, - _a.extends = 86 /* ExtendsKeyword */, - _a.false = 87 /* FalseKeyword */, - _a.finally = 88 /* FinallyKeyword */, - _a.for = 89 /* ForKeyword */, - _a.from = 144 /* FromKeyword */, - _a.function = 90 /* FunctionKeyword */, - _a.get = 126 /* GetKeyword */, - _a.if = 91 /* IfKeyword */, - _a.implements = 109 /* ImplementsKeyword */, - _a.import = 92 /* ImportKeyword */, - _a.in = 93 /* InKeyword */, - _a.infer = 127 /* InferKeyword */, - _a.instanceof = 94 /* InstanceOfKeyword */, - _a.interface = 110 /* InterfaceKeyword */, - _a.is = 128 /* IsKeyword */, - _a.keyof = 129 /* KeyOfKeyword */, - _a.let = 111 /* LetKeyword */, - _a.module = 130 /* ModuleKeyword */, - _a.namespace = 131 /* NamespaceKeyword */, - _a.never = 132 /* NeverKeyword */, - _a.new = 95 /* NewKeyword */, - _a.null = 96 /* NullKeyword */, - _a.number = 135 /* NumberKeyword */, - _a.object = 136 /* ObjectKeyword */, - _a.package = 112 /* PackageKeyword */, - _a.private = 113 /* PrivateKeyword */, - _a.protected = 114 /* ProtectedKeyword */, - _a.public = 115 /* PublicKeyword */, - _a.readonly = 133 /* ReadonlyKeyword */, - _a.require = 134 /* RequireKeyword */, - _a.global = 145 /* GlobalKeyword */, - _a.return = 97 /* ReturnKeyword */, - _a.set = 137 /* SetKeyword */, - _a.static = 116 /* StaticKeyword */, - _a.string = 138 /* StringKeyword */, - _a.super = 98 /* SuperKeyword */, - _a.switch = 99 /* SwitchKeyword */, - _a.symbol = 139 /* SymbolKeyword */, - _a.this = 100 /* ThisKeyword */, - _a.throw = 101 /* ThrowKeyword */, - _a.true = 102 /* TrueKeyword */, - _a.try = 103 /* TryKeyword */, - _a.type = 140 /* TypeKeyword */, - _a.typeof = 104 /* TypeOfKeyword */, - _a.undefined = 141 /* UndefinedKeyword */, - _a.unique = 142 /* UniqueKeyword */, - _a.unknown = 143 /* UnknownKeyword */, - _a.var = 105 /* VarKeyword */, - _a.void = 106 /* VoidKeyword */, - _a.while = 107 /* WhileKeyword */, - _a.with = 108 /* WithKeyword */, - _a.yield = 117 /* YieldKeyword */, - _a.async = 121 /* AsyncKeyword */, - _a.await = 122 /* AwaitKeyword */, - _a.of = 147 /* OfKeyword */, + _a["" + "constructor"] = 125 /* ConstructorKeyword */, + _a.debugger = 80 /* DebuggerKeyword */, + _a.declare = 126 /* DeclareKeyword */, + _a.default = 81 /* DefaultKeyword */, + _a.delete = 82 /* DeleteKeyword */, + _a.do = 83 /* DoKeyword */, + _a.else = 84 /* ElseKeyword */, + _a.enum = 85 /* EnumKeyword */, + _a.export = 86 /* ExportKeyword */, + _a.extends = 87 /* ExtendsKeyword */, + _a.false = 88 /* FalseKeyword */, + _a.finally = 89 /* FinallyKeyword */, + _a.for = 90 /* ForKeyword */, + _a.from = 145 /* FromKeyword */, + _a.function = 91 /* FunctionKeyword */, + _a.get = 127 /* GetKeyword */, + _a.if = 92 /* IfKeyword */, + _a.implements = 110 /* ImplementsKeyword */, + _a.import = 93 /* ImportKeyword */, + _a.in = 94 /* InKeyword */, + _a.infer = 128 /* InferKeyword */, + _a.instanceof = 95 /* InstanceOfKeyword */, + _a.interface = 111 /* InterfaceKeyword */, + _a.is = 129 /* IsKeyword */, + _a.keyof = 130 /* KeyOfKeyword */, + _a.let = 112 /* LetKeyword */, + _a.module = 131 /* ModuleKeyword */, + _a.namespace = 132 /* NamespaceKeyword */, + _a.never = 133 /* NeverKeyword */, + _a.new = 96 /* NewKeyword */, + _a.null = 97 /* NullKeyword */, + _a.number = 136 /* NumberKeyword */, + _a.object = 137 /* ObjectKeyword */, + _a.package = 113 /* PackageKeyword */, + _a.private = 114 /* PrivateKeyword */, + _a.protected = 115 /* ProtectedKeyword */, + _a.public = 116 /* PublicKeyword */, + _a.readonly = 134 /* ReadonlyKeyword */, + _a.require = 135 /* RequireKeyword */, + _a.global = 146 /* GlobalKeyword */, + _a.return = 98 /* ReturnKeyword */, + _a.set = 138 /* SetKeyword */, + _a.static = 117 /* StaticKeyword */, + _a.string = 139 /* StringKeyword */, + _a.super = 99 /* SuperKeyword */, + _a.switch = 100 /* SwitchKeyword */, + _a.symbol = 140 /* SymbolKeyword */, + _a.this = 101 /* ThisKeyword */, + _a.throw = 102 /* ThrowKeyword */, + _a.true = 103 /* TrueKeyword */, + _a.try = 104 /* TryKeyword */, + _a.type = 141 /* TypeKeyword */, + _a.typeof = 105 /* TypeOfKeyword */, + _a.undefined = 142 /* UndefinedKeyword */, + _a.unique = 143 /* UniqueKeyword */, + _a.unknown = 144 /* UnknownKeyword */, + _a.var = 106 /* VarKeyword */, + _a.void = 107 /* VoidKeyword */, + _a.while = 108 /* WhileKeyword */, + _a.with = 109 /* WithKeyword */, + _a.yield = 118 /* YieldKeyword */, + _a.async = 122 /* AsyncKeyword */, + _a.await = 123 /* AwaitKeyword */, + _a.of = 148 /* OfKeyword */, _a); var textToKeyword = ts.createMapFromTemplate(textToKeywordObj); - var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 28 /* LessThanToken */, ">": 30 /* GreaterThanToken */, "<=": 31 /* LessThanEqualsToken */, ">=": 32 /* GreaterThanEqualsToken */, "==": 33 /* EqualsEqualsToken */, "!=": 34 /* ExclamationEqualsToken */, "===": 35 /* EqualsEqualsEqualsToken */, "!==": 36 /* ExclamationEqualsEqualsToken */, "=>": 37 /* EqualsGreaterThanToken */, "+": 38 /* PlusToken */, "-": 39 /* MinusToken */, "**": 41 /* AsteriskAsteriskToken */, "*": 40 /* AsteriskToken */, "/": 42 /* SlashToken */, "%": 43 /* PercentToken */, "++": 44 /* PlusPlusToken */, "--": 45 /* MinusMinusToken */, "<<": 46 /* LessThanLessThanToken */, "</": 29 /* LessThanSlashToken */, ">>": 47 /* GreaterThanGreaterThanToken */, ">>>": 48 /* GreaterThanGreaterThanGreaterThanToken */, "&": 49 /* AmpersandToken */, "|": 50 /* BarToken */, "^": 51 /* CaretToken */, "!": 52 /* ExclamationToken */, "~": 53 /* TildeToken */, "&&": 54 /* AmpersandAmpersandToken */, "||": 55 /* BarBarToken */, "?": 56 /* QuestionToken */, ":": 57 /* ColonToken */, "=": 59 /* EqualsToken */, "+=": 60 /* PlusEqualsToken */, "-=": 61 /* MinusEqualsToken */, "*=": 62 /* AsteriskEqualsToken */, "**=": 63 /* AsteriskAsteriskEqualsToken */, "/=": 64 /* SlashEqualsToken */, "%=": 65 /* PercentEqualsToken */, "<<=": 66 /* LessThanLessThanEqualsToken */, ">>=": 67 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 69 /* AmpersandEqualsToken */, "|=": 70 /* BarEqualsToken */, "^=": 71 /* CaretEqualsToken */, "@": 58 /* AtToken */ })); + var textToToken = ts.createMapFromTemplate(__assign({}, textToKeywordObj, { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 28 /* LessThanToken */, ">": 30 /* GreaterThanToken */, "<=": 31 /* LessThanEqualsToken */, ">=": 32 /* GreaterThanEqualsToken */, "==": 33 /* EqualsEqualsToken */, "!=": 34 /* ExclamationEqualsToken */, "===": 35 /* EqualsEqualsEqualsToken */, "!==": 36 /* ExclamationEqualsEqualsToken */, "=>": 37 /* EqualsGreaterThanToken */, "+": 38 /* PlusToken */, "-": 39 /* MinusToken */, "**": 41 /* AsteriskAsteriskToken */, "*": 40 /* AsteriskToken */, "/": 42 /* SlashToken */, "%": 43 /* PercentToken */, "++": 44 /* PlusPlusToken */, "--": 45 /* MinusMinusToken */, "<<": 46 /* LessThanLessThanToken */, "</": 29 /* LessThanSlashToken */, ">>": 47 /* GreaterThanGreaterThanToken */, ">>>": 48 /* GreaterThanGreaterThanGreaterThanToken */, "&": 49 /* AmpersandToken */, "|": 50 /* BarToken */, "^": 51 /* CaretToken */, "!": 52 /* ExclamationToken */, "~": 53 /* TildeToken */, "&&": 54 /* AmpersandAmpersandToken */, "||": 55 /* BarBarToken */, "?": 56 /* QuestionToken */, ":": 57 /* ColonToken */, "=": 60 /* EqualsToken */, "+=": 61 /* PlusEqualsToken */, "-=": 62 /* MinusEqualsToken */, "*=": 63 /* AsteriskEqualsToken */, "**=": 64 /* AsteriskAsteriskEqualsToken */, "/=": 65 /* SlashEqualsToken */, "%=": 66 /* PercentEqualsToken */, "<<=": 67 /* LessThanLessThanEqualsToken */, ">>=": 68 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 70 /* AmpersandEqualsToken */, "|=": 71 /* BarEqualsToken */, "^=": 72 /* CaretEqualsToken */, "@": 58 /* AtToken */ })); /* As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers IdentifierStart :: @@ -7088,8 +7264,8 @@ var ts; getTokenValue: function () { return tokenValue; }, hasExtendedUnicodeEscape: function () { return (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0; }, hasPrecedingLineBreak: function () { return (tokenFlags & 1 /* PrecedingLineBreak */) !== 0; }, - isIdentifier: function () { return token === 72 /* Identifier */ || token > 108 /* LastReservedWord */; }, - isReservedWord: function () { return token >= 73 /* FirstReservedWord */ && token <= 108 /* LastReservedWord */; }, + isIdentifier: function () { return token === 73 /* Identifier */ || token > 109 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 74 /* FirstReservedWord */ && token <= 109 /* LastReservedWord */; }, isUnterminated: function () { return (tokenFlags & 4 /* Unterminated */) !== 0; }, getTokenFlags: function () { return tokenFlags; }, reScanGreaterToken: reScanGreaterToken, @@ -7100,7 +7276,7 @@ var ts; reScanJsxToken: reScanJsxToken, reScanLessThanToken: reScanLessThanToken, scanJsxToken: scanJsxToken, - scanJSDocToken: scanJSDocToken, + scanJsDocToken: scanJsDocToken, scan: scan, getText: getText, setText: setText, @@ -7540,7 +7716,7 @@ var ts; } } } - return token = 72 /* Identifier */; + return token = 73 /* Identifier */; } function scanBinaryOrOctalDigits(base) { var value = ""; @@ -7689,7 +7865,7 @@ var ts; return token = scanTemplateAndSetTokenValue(); case 37 /* percent */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 65 /* PercentEqualsToken */; + return pos += 2, token = 66 /* PercentEqualsToken */; } pos++; return token = 43 /* PercentToken */; @@ -7698,7 +7874,7 @@ var ts; return pos += 2, token = 54 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 69 /* AmpersandEqualsToken */; + return pos += 2, token = 70 /* AmpersandEqualsToken */; } pos++; return token = 49 /* AmpersandToken */; @@ -7710,11 +7886,11 @@ var ts; return token = 21 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 62 /* AsteriskEqualsToken */; + return pos += 2, token = 63 /* AsteriskEqualsToken */; } if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 63 /* AsteriskAsteriskEqualsToken */; + return pos += 3, token = 64 /* AsteriskAsteriskEqualsToken */; } return pos += 2, token = 41 /* AsteriskAsteriskToken */; } @@ -7730,7 +7906,7 @@ var ts; return pos += 2, token = 44 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 60 /* PlusEqualsToken */; + return pos += 2, token = 61 /* PlusEqualsToken */; } pos++; return token = 38 /* PlusToken */; @@ -7742,7 +7918,7 @@ var ts; return pos += 2, token = 45 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 61 /* MinusEqualsToken */; + return pos += 2, token = 62 /* MinusEqualsToken */; } pos++; return token = 39 /* MinusToken */; @@ -7806,7 +7982,7 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 64 /* SlashEqualsToken */; + return pos += 2, token = 65 /* SlashEqualsToken */; } pos++; return token = 42 /* SlashToken */; @@ -7883,7 +8059,7 @@ var ts; } if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 66 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 67 /* LessThanLessThanEqualsToken */; } return pos += 2, token = 46 /* LessThanLessThanToken */; } @@ -7917,7 +8093,7 @@ var ts; return pos += 2, token = 37 /* EqualsGreaterThanToken */; } pos++; - return token = 59 /* EqualsToken */; + return token = 60 /* EqualsToken */; case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); @@ -7941,7 +8117,7 @@ var ts; return token = 23 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 71 /* CaretEqualsToken */; + return pos += 2, token = 72 /* CaretEqualsToken */; } pos++; return token = 51 /* CaretToken */; @@ -7962,7 +8138,7 @@ var ts; return pos += 2, token = 55 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 70 /* BarEqualsToken */; + return pos += 2, token = 71 /* BarEqualsToken */; } pos++; return token = 50 /* BarToken */; @@ -8016,12 +8192,12 @@ var ts; if (text.charCodeAt(pos) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } return pos += 2, token = 48 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 67 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 68 /* GreaterThanGreaterThanEqualsToken */; } pos++; return token = 47 /* GreaterThanGreaterThanToken */; @@ -8034,7 +8210,7 @@ var ts; return token; } function reScanSlashToken() { - if (token === 42 /* SlashToken */ || token === 64 /* SlashEqualsToken */) { + if (token === 42 /* SlashToken */ || token === 65 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -8183,7 +8359,7 @@ var ts; return scan(); } } - function scanJSDocToken() { + function scanJsDocToken() { startPos = tokenPos = pos; tokenFlags = 0; if (pos >= end) { @@ -8219,21 +8395,16 @@ var ts; case 60 /* lessThan */: return token = 28 /* LessThanToken */; case 61 /* equals */: - return token = 59 /* EqualsToken */; + return token = 60 /* EqualsToken */; case 44 /* comma */: return token = 27 /* CommaToken */; case 46 /* dot */: return token = 24 /* DotToken */; case 96 /* backtick */: - while (pos < end && text.charCodeAt(pos) !== 96 /* backtick */) { - pos++; - } - tokenValue = text.substring(tokenPos + 1, pos); - pos++; - return token = 14 /* NoSubstitutionTemplateLiteral */; + return token = 59 /* BacktickToken */; } - if (isIdentifierStart(ch, 7 /* Latest */)) { - while (isIdentifierPart(text.charCodeAt(pos), 7 /* Latest */) && pos < end) { + if (isIdentifierStart(ch, 8 /* Latest */)) { + while (isIdentifierPart(text.charCodeAt(pos), 8 /* Latest */) && pos < end) { pos++; } tokenValue = text.substring(tokenPos, pos); @@ -8418,11 +8589,16 @@ var ts; } ts.toPath = toPath; function changesAffectModuleResolution(oldOptions, newOptions) { - return oldOptions.configFilePath !== newOptions.configFilePath || ts.moduleResolutionOptionDeclarations.some(function (o) { + return oldOptions.configFilePath !== newOptions.configFilePath || + optionsHaveModuleResolutionChanges(oldOptions, newOptions); + } + ts.changesAffectModuleResolution = changesAffectModuleResolution; + function optionsHaveModuleResolutionChanges(oldOptions, newOptions) { + return ts.moduleResolutionOptionDeclarations.some(function (o) { return !ts.isJsonEqual(ts.getCompilerOptionValue(oldOptions, o), ts.getCompilerOptionValue(newOptions, o)); }); } - ts.changesAffectModuleResolution = changesAffectModuleResolution; + ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -8591,7 +8767,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 284 /* SourceFile */) { + while (node && node.kind !== 285 /* SourceFile */) { node = node.parent; } return node; @@ -8599,11 +8775,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 218 /* Block */: - case 246 /* CaseBlock */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 219 /* Block */: + case 247 /* CaseBlock */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: return true; } return false; @@ -8771,7 +8947,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 === 311 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 312 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -8790,7 +8966,7 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return node.kind === 288 /* JSDocTypeExpression */ || (node.parent && isJSDocTypeExpressionOrChild(node.parent)); + return node.kind === 289 /* JSDocTypeExpression */ || (node.parent && isJSDocTypeExpressionOrChild(node.parent)); } function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } @@ -8882,7 +9058,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 237 /* VariableDeclaration */ && node.parent.kind === 274 /* CatchClause */; + return node.kind === 238 /* VariableDeclaration */ && node.parent.kind === 275 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -8914,11 +9090,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 === 244 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 245 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 284 /* SourceFile */ || - node.kind === 244 /* ModuleDeclaration */ || + return node.kind === 285 /* SourceFile */ || + node.kind === 245 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -8935,9 +9111,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 284 /* SourceFile */: + case 285 /* SourceFile */: return ts.isExternalModule(node.parent); - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -8953,22 +9129,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 284 /* SourceFile */: - case 246 /* CaseBlock */: - case 274 /* CatchClause */: - case 244 /* ModuleDeclaration */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 285 /* SourceFile */: + case 247 /* CaseBlock */: + case 275 /* CatchClause */: + case 245 /* ModuleDeclaration */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return true; - case 218 /* Block */: + case 219 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -8978,9 +9154,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 302 /* JSDocCallbackTag */: - case 309 /* JSDocTypedefTag */: - case 298 /* JSDocSignature */: + case 303 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 299 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -8990,25 +9166,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 155 /* MethodSignature */: - case 162 /* IndexSignature */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 294 /* JSDocFunctionType */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 308 /* JSDocTemplateTag */: - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 156 /* MethodSignature */: + case 163 /* IndexSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 295 /* JSDocFunctionType */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 309 /* JSDocTemplateTag */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -9018,8 +9194,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: return true; default: return false; @@ -9028,15 +9204,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 219 /* VariableStatement */: - case 240 /* ClassDeclaration */: - case 239 /* FunctionDeclaration */: - case 244 /* ModuleDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 220 /* VariableStatement */: + case 241 /* ClassDeclaration */: + case 240 /* FunctionDeclaration */: + case 245 /* ModuleDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: return true; default: return false; @@ -9066,13 +9242,13 @@ var ts; ts.getNameFromIndexInfo = getNameFromIndexInfo; function getTextOfPropertyName(name) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 149 /* ComputedPropertyName */: + case 150 /* 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"); @@ -9083,11 +9259,11 @@ var ts; ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); default: throw ts.Debug.assertNever(name); @@ -9132,7 +9308,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 218 /* Block */) { + if (node.body && node.body.kind === 219 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -9146,7 +9322,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 284 /* SourceFile */: + case 285 /* 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 @@ -9155,25 +9331,25 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 237 /* VariableDeclaration */: - case 186 /* BindingElement */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: - case 278 /* EnumMember */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 242 /* TypeAliasDeclaration */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 238 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 279 /* EnumMember */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 243 /* TypeAliasDeclaration */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: errorNode = node.name; break; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -9222,11 +9398,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 191 /* CallExpression */ && n.expression.kind === 98 /* SuperKeyword */; + return n.kind === 192 /* CallExpression */ && n.expression.kind === 99 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 191 /* CallExpression */ && n.expression.kind === 92 /* ImportKeyword */; + return n.kind === 192 /* CallExpression */ && n.expression.kind === 93 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isLiteralImportTypeNode(n) { @@ -9234,7 +9410,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 221 /* ExpressionStatement */ + return node.kind === 222 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -9243,11 +9419,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 151 /* Parameter */ || - node.kind === 150 /* TypeParameter */ || - node.kind === 196 /* FunctionExpression */ || - node.kind === 197 /* ArrowFunction */ || - node.kind === 195 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 152 /* Parameter */ || + node.kind === 151 /* TypeParameter */ || + node.kind === 197 /* FunctionExpression */ || + node.kind === 198 /* ArrowFunction */ || + node.kind === 196 /* 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 '/**/' @@ -9263,48 +9439,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)('|")(.+?)\2.*?\/>/; var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)('|")(.+?)\2\s*\/>/; function isPartOfTypeNode(node) { - if (163 /* FirstTypeNode */ <= node.kind && node.kind <= 183 /* LastTypeNode */) { + if (164 /* FirstTypeNode */ <= node.kind && node.kind <= 184 /* LastTypeNode */) { return true; } switch (node.kind) { - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 138 /* StringKeyword */: - case 123 /* BooleanKeyword */: - case 139 /* SymbolKeyword */: - case 136 /* ObjectKeyword */: - case 141 /* UndefinedKeyword */: - case 132 /* NeverKeyword */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 139 /* StringKeyword */: + case 124 /* BooleanKeyword */: + case 140 /* SymbolKeyword */: + case 137 /* ObjectKeyword */: + case 142 /* UndefinedKeyword */: + case 133 /* NeverKeyword */: return true; - case 106 /* VoidKeyword */: - return node.parent.kind !== 200 /* VoidExpression */; - case 211 /* ExpressionWithTypeArguments */: + case 107 /* VoidKeyword */: + return node.parent.kind !== 201 /* VoidExpression */; + case 212 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 150 /* TypeParameter */: - return node.parent.kind === 181 /* MappedType */ || node.parent.kind === 176 /* InferType */; + case 151 /* TypeParameter */: + return node.parent.kind === 182 /* MappedType */ || node.parent.kind === 177 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container - case 72 /* Identifier */: + case 73 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 149 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 190 /* 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 === 72 /* Identifier */ || node.kind === 148 /* QualifiedName */ || node.kind === 189 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 73 /* Identifier */ || node.kind === 149 /* QualifiedName */ || node.kind === 190 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 148 /* QualifiedName */: - case 189 /* PropertyAccessExpression */: - case 100 /* ThisKeyword */: { + case 149 /* QualifiedName */: + case 190 /* PropertyAccessExpression */: + case 101 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 167 /* TypeQuery */) { + if (parent.kind === 168 /* TypeQuery */) { return false; } - if (parent.kind === 183 /* ImportType */) { + if (parent.kind === 184 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -9313,40 +9489,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 (163 /* FirstTypeNode */ <= parent.kind && parent.kind <= 183 /* LastTypeNode */) { + if (164 /* FirstTypeNode */ <= parent.kind && parent.kind <= 184 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return node === parent.constraint; - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: return node === parent.constraint; - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 151 /* Parameter */: - case 237 /* VariableDeclaration */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 152 /* Parameter */: + case 238 /* VariableDeclaration */: return node === parent.type; - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return node === parent.type; - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: return node === parent.type; - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: return node === parent.type; - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -9371,23 +9547,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return visitor(node); - case 246 /* CaseBlock */: - case 218 /* Block */: - case 222 /* IfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 231 /* WithStatement */: - case 232 /* SwitchStatement */: - case 271 /* CaseClause */: - case 272 /* DefaultClause */: - case 233 /* LabeledStatement */: - case 235 /* TryStatement */: - case 274 /* CatchClause */: + case 247 /* CaseBlock */: + case 219 /* Block */: + case 223 /* IfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 232 /* WithStatement */: + case 233 /* SwitchStatement */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: + case 234 /* LabeledStatement */: + case 236 /* TryStatement */: + case 275 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -9397,26 +9573,26 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 243 /* EnumDeclaration */: - case 241 /* InterfaceDeclaration */: - case 244 /* ModuleDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 244 /* EnumDeclaration */: + case 242 /* InterfaceDeclaration */: + case 245 /* ModuleDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 149 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 150 /* 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); @@ -9439,10 +9615,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 169 /* ArrayType */) { + if (node && node.kind === 170 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 164 /* TypeReference */) { + else if (node && node.kind === 165 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -9452,12 +9628,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 241 /* InterfaceDeclaration */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 168 /* TypeLiteral */: + case 242 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 169 /* TypeLiteral */: return node.members; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return node.properties; } } @@ -9465,14 +9641,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 186 /* BindingElement */: - case 278 /* EnumMember */: - case 151 /* Parameter */: - case 275 /* PropertyAssignment */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 276 /* ShorthandPropertyAssignment */: - case 237 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 279 /* EnumMember */: + case 152 /* Parameter */: + case 276 /* PropertyAssignment */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 277 /* ShorthandPropertyAssignment */: + case 238 /* VariableDeclaration */: return true; } } @@ -9484,8 +9660,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 238 /* VariableDeclarationList */ - && node.parent.parent.kind === 219 /* VariableStatement */; + return node.parent.kind === 239 /* VariableDeclarationList */ + && node.parent.parent.kind === 220 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -9496,13 +9672,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: return true; } return false; @@ -9513,7 +9689,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 233 /* LabeledStatement */) { + if (node.statement.kind !== 234 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -9521,17 +9697,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 218 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 219 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 156 /* MethodDeclaration */ && node.parent.kind === 188 /* ObjectLiteralExpression */; + return node && node.kind === 157 /* MethodDeclaration */ && node.parent.kind === 189 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 156 /* MethodDeclaration */ && - (node.parent.kind === 188 /* ObjectLiteralExpression */ || - node.parent.kind === 209 /* ClassExpression */); + return node.kind === 157 /* MethodDeclaration */ && + (node.parent.kind === 189 /* ObjectLiteralExpression */ || + node.parent.kind === 210 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -9544,7 +9720,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 275 /* PropertyAssignment */) { + if (property.kind === 276 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -9576,19 +9752,23 @@ var ts; return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; + function getContainingFunctionDeclaration(node) { + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); + } + ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 284 /* SourceFile */); + ts.Debug.assert(node.kind !== 285 /* 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 149 /* ComputedPropertyName */: + case 150 /* 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 @@ -9603,9 +9783,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 152 /* Decorator */: + case 153 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 151 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 152 /* 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; @@ -9616,26 +9796,26 @@ var ts; node = node.parent; } break; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 244 /* ModuleDeclaration */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: - case 243 /* EnumDeclaration */: - case 284 /* SourceFile */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 245 /* ModuleDeclaration */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: + case 244 /* EnumDeclaration */: + case 285 /* SourceFile */: return node; } } @@ -9645,9 +9825,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 157 /* Constructor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 158 /* Constructor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: return container; } } @@ -9669,27 +9849,27 @@ var ts; return node; } switch (node.kind) { - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: node = node.parent; break; - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return node; - case 152 /* Decorator */: + case 153 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 151 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 152 /* 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; @@ -9705,21 +9885,21 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 196 /* FunctionExpression */ || func.kind === 197 /* ArrowFunction */) { + if (func.kind === 197 /* FunctionExpression */ || func.kind === 198 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 195 /* ParenthesizedExpression */) { + while (parent.kind === 196 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 191 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 192 /* CallExpression */ && parent.expression === prev) { return parent; } } } ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperOrSuperProperty(node) { - return node.kind === 98 /* SuperKeyword */ + return node.kind === 99 /* SuperKeyword */ || isSuperProperty(node); } ts.isSuperOrSuperProperty = isSuperOrSuperProperty; @@ -9728,8 +9908,8 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 189 /* PropertyAccessExpression */ || kind === 190 /* ElementAccessExpression */) - && node.expression.kind === 98 /* SuperKeyword */; + return (kind === 190 /* PropertyAccessExpression */ || kind === 191 /* ElementAccessExpression */) + && node.expression.kind === 99 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; /** @@ -9737,20 +9917,20 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 189 /* PropertyAccessExpression */ || kind === 190 /* ElementAccessExpression */) - && node.expression.kind === 100 /* ThisKeyword */; + return (kind === 190 /* PropertyAccessExpression */ || kind === 191 /* ElementAccessExpression */) + && node.expression.kind === 101 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return node.typeName; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; - case 72 /* Identifier */: - case 148 /* QualifiedName */: + case 73 /* Identifier */: + case 149 /* QualifiedName */: return node; } return undefined; @@ -9758,10 +9938,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return node.tag; - case 262 /* JsxOpeningElement */: - case 261 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -9770,25 +9950,25 @@ var ts; ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: // classes are valid targets return true; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 240 /* ClassDeclaration */; - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 156 /* MethodDeclaration */: + return parent.kind === 241 /* ClassDeclaration */; + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 157 /* 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 === 240 /* ClassDeclaration */; - case 151 /* Parameter */: + && parent.kind === 241 /* ClassDeclaration */; + case 152 /* 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 === 157 /* Constructor */ - || parent.kind === 156 /* MethodDeclaration */ - || parent.kind === 159 /* SetAccessor */) - && grandparent.kind === 240 /* ClassDeclaration */; + && (parent.kind === 158 /* Constructor */ + || parent.kind === 157 /* MethodDeclaration */ + || parent.kind === 160 /* SetAccessor */) + && grandparent.kind === 241 /* ClassDeclaration */; } return false; } @@ -9804,10 +9984,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 156 /* MethodDeclaration */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 160 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -9816,9 +9996,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 262 /* JsxOpeningElement */ || - parent.kind === 261 /* JsxSelfClosingElement */ || - parent.kind === 263 /* JsxClosingElement */) { + if (parent.kind === 263 /* JsxOpeningElement */ || + parent.kind === 262 /* JsxSelfClosingElement */ || + parent.kind === 264 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -9826,57 +10006,57 @@ var ts; ts.isJSXTagName = isJSXTagName; function isExpressionNode(node) { switch (node.kind) { - case 98 /* SuperKeyword */: - case 96 /* NullKeyword */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 99 /* SuperKeyword */: + case 97 /* NullKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 187 /* ArrayLiteralExpression */: - case 188 /* ObjectLiteralExpression */: - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 193 /* TaggedTemplateExpression */: - case 212 /* AsExpression */: - case 194 /* TypeAssertionExpression */: - case 213 /* NonNullExpression */: - case 195 /* ParenthesizedExpression */: - case 196 /* FunctionExpression */: - case 209 /* ClassExpression */: - case 197 /* ArrowFunction */: - case 200 /* VoidExpression */: - case 198 /* DeleteExpression */: - case 199 /* TypeOfExpression */: - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: - case 204 /* BinaryExpression */: - case 205 /* ConditionalExpression */: - case 208 /* SpreadElement */: - case 206 /* TemplateExpression */: + case 188 /* ArrayLiteralExpression */: + case 189 /* ObjectLiteralExpression */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 194 /* TaggedTemplateExpression */: + case 213 /* AsExpression */: + case 195 /* TypeAssertionExpression */: + case 214 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: + case 197 /* FunctionExpression */: + case 210 /* ClassExpression */: + case 198 /* ArrowFunction */: + case 201 /* VoidExpression */: + case 199 /* DeleteExpression */: + case 200 /* TypeOfExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: + case 205 /* BinaryExpression */: + case 206 /* ConditionalExpression */: + case 209 /* SpreadElement */: + case 207 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: - case 210 /* OmittedExpression */: - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - case 264 /* JsxFragment */: - case 207 /* YieldExpression */: - case 201 /* AwaitExpression */: - case 214 /* MetaProperty */: + case 211 /* OmittedExpression */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + case 265 /* JsxFragment */: + case 208 /* YieldExpression */: + case 202 /* AwaitExpression */: + case 215 /* MetaProperty */: return true; - case 148 /* QualifiedName */: - while (node.parent.kind === 148 /* QualifiedName */) { + case 149 /* QualifiedName */: + while (node.parent.kind === 149 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 167 /* TypeQuery */ || isJSXTagName(node); - case 72 /* Identifier */: - if (node.parent.kind === 167 /* TypeQuery */ || isJSXTagName(node)) { + return node.parent.kind === 168 /* TypeQuery */ || isJSXTagName(node); + case 73 /* Identifier */: + if (node.parent.kind === 168 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return isInExpressionContext(node); default: return false; @@ -9886,49 +10066,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 237 /* VariableDeclaration */: - case 151 /* Parameter */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 278 /* EnumMember */: - case 275 /* PropertyAssignment */: - case 186 /* BindingElement */: + case 238 /* VariableDeclaration */: + case 152 /* Parameter */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 279 /* EnumMember */: + case 276 /* PropertyAssignment */: + case 187 /* BindingElement */: return parent.initializer === node; - case 221 /* ExpressionStatement */: - case 222 /* IfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 230 /* ReturnStatement */: - case 231 /* WithStatement */: - case 232 /* SwitchStatement */: - case 271 /* CaseClause */: - case 234 /* ThrowStatement */: + case 222 /* ExpressionStatement */: + case 223 /* IfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 231 /* ReturnStatement */: + case 232 /* WithStatement */: + case 233 /* SwitchStatement */: + case 272 /* CaseClause */: + case 235 /* ThrowStatement */: return parent.expression === node; - case 225 /* ForStatement */: + case 226 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 238 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 239 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 238 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 239 /* VariableDeclarationList */) || forInStatement.expression === node; - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: return node === parent.expression; - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: return node === parent.expression; - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return node === parent.expression; - case 152 /* Decorator */: - case 270 /* JsxExpression */: - case 269 /* JsxSpreadAttribute */: - case 277 /* SpreadAssignment */: + case 153 /* Decorator */: + case 271 /* JsxExpression */: + case 270 /* JsxSpreadAttribute */: + case 278 /* SpreadAssignment */: return true; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -9936,7 +10116,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 248 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 259 /* ExternalModuleReference */; + return node.kind === 249 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 260 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -9945,7 +10125,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 248 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 259 /* ExternalModuleReference */; + return node.kind === 249 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 260 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -9973,15 +10153,15 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 138 /* StringKeyword */ || node.typeArguments[0].kind === 135 /* NumberKeyword */); + (node.typeArguments[0].kind === 139 /* StringKeyword */ || node.typeArguments[0].kind === 136 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteralLike) { - if (callExpression.kind !== 191 /* CallExpression */) { + if (callExpression.kind !== 192 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; - if (expression.kind !== 72 /* Identifier */ || expression.escapedText !== "require") { + if (expression.kind !== 73 /* Identifier */ || expression.escapedText !== "require") { return false; } if (args.length !== 1) { @@ -10012,7 +10192,7 @@ var ts; name = node.parent.name; decl = node.parent; } - else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */ && node.parent.right === node) { + else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 60 /* EqualsToken */ && node.parent.right === node) { name = node.parent.left; decl = name; } @@ -10021,7 +10201,7 @@ var ts; name = node.parent.parent.name; decl = node.parent.parent; } - else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 59 /* EqualsToken */ && node.parent.parent.right === node.parent) { + else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 60 /* EqualsToken */ && node.parent.parent.right === node.parent) { name = node.parent.parent.left; decl = name; } @@ -10063,7 +10243,7 @@ var ts; * We treat the right hand side of assignments with container-like initalizers as declarations. */ function getAssignedExpandoInitializer(node) { - if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */) { + if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 60 /* EqualsToken */) { var isPrototypeAssignment = isPrototypeAccess(node.parent.left); return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); @@ -10089,11 +10269,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 196 /* FunctionExpression */ || e.kind === 197 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 197 /* FunctionExpression */ || e.kind === 198 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 196 /* FunctionExpression */ || - initializer.kind === 209 /* ClassExpression */ || - initializer.kind === 197 /* ArrowFunction */) { + if (initializer.kind === 197 /* FunctionExpression */ || + initializer.kind === 210 /* ClassExpression */ || + initializer.kind === 198 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -10117,7 +10297,7 @@ var ts; } function isDefaultedExpandoInitializer(node) { var name = ts.isVariableDeclaration(node.parent) ? node.parent.name : - ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 59 /* EqualsToken */ ? node.parent.left : + ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 60 /* EqualsToken */ ? node.parent.left : undefined; return name && getExpandoInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left); } @@ -10126,7 +10306,7 @@ var ts; function getNameOfExpando(node) { if (ts.isBinaryExpression(node.parent)) { var parent = (node.parent.operatorToken.kind === 55 /* BarBarToken */ && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent; - if (parent.operatorToken.kind === 59 /* EqualsToken */ && ts.isIdentifier(parent.left)) { + if (parent.operatorToken.kind === 60 /* EqualsToken */ && ts.isIdentifier(parent.left)) { return parent.left; } } @@ -10149,7 +10329,7 @@ var ts; return name.escapedText === initializer.escapedText; } if (ts.isIdentifier(name) && ts.isPropertyAccessExpression(initializer)) { - return (initializer.expression.kind === 100 /* ThisKeyword */ || + return (initializer.expression.kind === 101 /* ThisKeyword */ || ts.isIdentifier(initializer.expression) && (initializer.expression.escapedText === "window" || initializer.expression.escapedText === "self" || @@ -10207,7 +10387,7 @@ var ts; } return 7 /* ObjectDefinePropertyValue */; } - if (expr.operatorToken.kind !== 59 /* EqualsToken */ || + if (expr.operatorToken.kind !== 60 /* EqualsToken */ || !ts.isPropertyAccessExpression(expr.left)) { return 0 /* None */; } @@ -10219,7 +10399,7 @@ var ts; return getAssignmentDeclarationPropertyAccessKind(lhs); } function getAssignmentDeclarationPropertyAccessKind(lhs) { - if (lhs.expression.kind === 100 /* ThisKeyword */) { + if (lhs.expression.kind === 101 /* ThisKeyword */) { return 4 /* ThisProperty */; } else if (isModuleExportsPropertyAccessExpression(lhs)) { @@ -10261,7 +10441,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 221 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 222 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; @@ -10270,23 +10450,23 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 239 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 240 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { - return tryGetImportFromModuleSpecifier(node) || ts.Debug.fail(ts.Debug.showSyntaxKind(node.parent)); + return tryGetImportFromModuleSpecifier(node) || ts.Debug.failBadSyntaxKind(node.parent); } ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: return node.parent; - case 259 /* ExternalModuleReference */: + case 260 /* ExternalModuleReference */: return node.parent.parent; - case 191 /* CallExpression */: + case 192 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 182 /* LiteralType */: + case 183 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -10296,12 +10476,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: return node.moduleSpecifier; - case 248 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 259 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 183 /* ImportType */: + case 249 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 260 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 184 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -10310,11 +10490,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return node; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return undefined; default: return ts.Debug.assertNever(node); @@ -10322,19 +10502,19 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 249 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 250 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 151 /* Parameter */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 276 /* ShorthandPropertyAssignment */: - case 275 /* PropertyAssignment */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 152 /* Parameter */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 277 /* ShorthandPropertyAssignment */: + case 276 /* PropertyAssignment */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -10348,7 +10528,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 309 /* JSDocTypedefTag */ || node.kind === 302 /* JSDocCallbackTag */; + return node.kind === 310 /* JSDocTypedefTag */ || node.kind === 303 /* JSDocCallbackTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -10358,7 +10538,7 @@ var ts; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && - node.expression.operatorToken.kind === 59 /* EqualsToken */ + node.expression.operatorToken.kind === 60 /* EqualsToken */ ? node.expression.right : undefined; } @@ -10373,12 +10553,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return node.initializer; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return node.initializer; } } @@ -10389,7 +10569,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 244 /* ModuleDeclaration */ + node.body.kind === 245 /* ModuleDeclaration */ ? node.body : undefined; } @@ -10404,11 +10584,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.addRange(result, node.jsDoc); } - if (node.kind === 151 /* Parameter */) { + if (node.kind === 152 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); break; } - if (node.kind === 150 /* TypeParameter */) { + if (node.kind === 151 /* TypeParameter */) { result = ts.addRange(result, ts.getJSDocTypeParameterTags(node)); break; } @@ -10419,11 +10599,12 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 275 /* PropertyAssignment */ || - parent.kind === 154 /* PropertyDeclaration */ || - parent.kind === 221 /* ExpressionStatement */ && node.kind === 189 /* PropertyAccessExpression */ || + if (parent.kind === 276 /* PropertyAssignment */ || + parent.kind === 255 /* ExportAssignment */ || + parent.kind === 155 /* PropertyDeclaration */ || + parent.kind === 222 /* ExpressionStatement */ && node.kind === 190 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || - ts.isBinaryExpression(node) && node.operatorToken.kind === 59 /* EqualsToken */) { + ts.isBinaryExpression(node) && node.operatorToken.kind === 60 /* EqualsToken */) { return parent; } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -10434,7 +10615,7 @@ var ts; // var x = function(name) { return name.length; } else if (parent.parent && (getSingleVariableOfVariableStatement(parent.parent) === node || - ts.isBinaryExpression(parent) && parent.operatorToken.kind === 59 /* EqualsToken */)) { + ts.isBinaryExpression(parent) && parent.operatorToken.kind === 60 /* EqualsToken */)) { return parent.parent; } else if (parent.parent && parent.parent.parent && @@ -10457,7 +10638,7 @@ var ts; if (!decl) { return undefined; } - var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 72 /* Identifier */ && p.name.escapedText === name; }); + var parameter = ts.find(decl.parameters, function (p) { return p.name.kind === 73 /* Identifier */ && p.name.escapedText === name; }); return parameter && parameter.symbol; } ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc; @@ -10492,7 +10673,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 === 295 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 296 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; var AssignmentKind; @@ -10505,31 +10686,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? - binaryOperator === 59 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : + binaryOperator === 60 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 44 /* PlusPlusToken */ || unaryOperator === 45 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 195 /* ParenthesizedExpression */: - case 187 /* ArrayLiteralExpression */: - case 208 /* SpreadElement */: - case 213 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: + case 188 /* ArrayLiteralExpression */: + case 209 /* SpreadElement */: + case 214 /* NonNullExpression */: node = parent; break; - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -10556,22 +10737,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 218 /* Block */: - case 219 /* VariableStatement */: - case 231 /* WithStatement */: - case 222 /* IfStatement */: - case 232 /* SwitchStatement */: - case 246 /* CaseBlock */: - case 271 /* CaseClause */: - case 272 /* DefaultClause */: - case 233 /* LabeledStatement */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 235 /* TryStatement */: - case 274 /* CatchClause */: + case 219 /* Block */: + case 220 /* VariableStatement */: + case 232 /* WithStatement */: + case 223 /* IfStatement */: + case 233 /* SwitchStatement */: + case 247 /* CaseBlock */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: + case 234 /* LabeledStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 236 /* TryStatement */: + case 275 /* CatchClause */: return true; } return false; @@ -10588,33 +10769,33 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 177 /* ParenthesizedType */); + return walkUp(node, 178 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 195 /* ParenthesizedExpression */); + return walkUp(node, 196 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function skipParentheses(node) { - while (node.kind === 195 /* ParenthesizedExpression */) { + while (node.kind === 196 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 195 /* ParenthesizedExpression */) { + while (node.kind === 196 /* 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 !== 189 /* PropertyAccessExpression */ && node.kind !== 190 /* ElementAccessExpression */) { + if (node.kind !== 190 /* PropertyAccessExpression */ && node.kind !== 191 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 198 /* DeleteExpression */; + return node && node.kind === 199 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -10640,7 +10821,7 @@ var ts; if (ts.isComputedPropertyName(parent)) return parent.parent; // falls through - case 72 /* Identifier */: + case 73 /* Identifier */: if (ts.isDeclaration(parent)) { return parent.name === name ? parent : undefined; } @@ -10664,7 +10845,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 10 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 149 /* ComputedPropertyName */ && + node.parent.kind === 150 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -10672,32 +10853,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 278 /* EnumMember */: - case 275 /* PropertyAssignment */: - case 189 /* PropertyAccessExpression */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 279 /* EnumMember */: + case 276 /* PropertyAssignment */: + case 190 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference if (parent.right === node) { - while (parent.kind === 148 /* QualifiedName */) { + while (parent.kind === 149 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 167 /* TypeQuery */ || parent.kind === 164 /* TypeReference */; + return parent.kind === 168 /* TypeQuery */ || parent.kind === 165 /* TypeReference */; } return false; - case 186 /* BindingElement */: - case 253 /* ImportSpecifier */: + case 187 /* BindingElement */: + case 254 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 257 /* ExportSpecifier */: - case 267 /* JsxAttribute */: + case 258 /* ExportSpecifier */: + case 268 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -10714,13 +10895,13 @@ var ts; // export default <EntityNameExpression> // module.exports = <EntityNameExpression> function isAliasSymbolDeclaration(node) { - return node.kind === 248 /* ImportEqualsDeclaration */ || - node.kind === 247 /* NamespaceExportDeclaration */ || - node.kind === 250 /* ImportClause */ && !!node.name || - node.kind === 251 /* NamespaceImport */ || - node.kind === 253 /* ImportSpecifier */ || - node.kind === 257 /* ExportSpecifier */ || - node.kind === 254 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 249 /* ImportEqualsDeclaration */ || + node.kind === 248 /* NamespaceExportDeclaration */ || + node.kind === 251 /* ImportClause */ && !!node.name || + node.kind === 252 /* NamespaceImport */ || + node.kind === 254 /* ImportSpecifier */ || + node.kind === 258 /* ExportSpecifier */ || + node.kind === 255 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; @@ -10742,12 +10923,12 @@ var ts; } ts.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode; function getClassExtendsHeritageElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 86 /* ExtendsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 87 /* ExtendsKeyword */); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } ts.getClassExtendsHeritageElement = getClassExtendsHeritageElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 109 /* ImplementsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 110 /* ImplementsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; @@ -10759,7 +10940,7 @@ var ts; } ts.getAllSuperTypeNodes = getAllSuperTypeNodes; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 86 /* ExtendsKeyword */); + var heritageClause = getHeritageClause(node.heritageClauses, 87 /* ExtendsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; @@ -10793,11 +10974,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 73 /* FirstKeyword */ <= token && token <= 147 /* LastKeyword */; + return 74 /* FirstKeyword */ <= token && token <= 148 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 118 /* FirstContextualKeyword */ <= token && token <= 147 /* LastContextualKeyword */; + return 119 /* FirstContextualKeyword */ <= token && token <= 148 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -10832,14 +11013,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -10853,10 +11034,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -10881,7 +11062,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 149 /* ComputedPropertyName */ && + return name.kind === 150 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -10897,12 +11078,12 @@ var ts; ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return name.escapedText; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -10918,7 +11099,7 @@ var ts; ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode; function isPropertyNameLiteral(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: @@ -10929,11 +11110,11 @@ var ts; } ts.isPropertyNameLiteral = isPropertyNameLiteral; function getTextOfIdentifierOrLiteral(node) { - return node.kind === 72 /* Identifier */ ? ts.idText(node) : node.text; + return node.kind === 73 /* Identifier */ ? ts.idText(node) : node.text; } ts.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral; function getEscapedTextOfIdentifierOrLiteral(node) { - return node.kind === 72 /* Identifier */ ? node.escapedText : ts.escapeLeadingUnderscores(node.text); + return node.kind === 73 /* Identifier */ ? node.escapedText : ts.escapeLeadingUnderscores(node.text); } ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral; function getPropertyNameForKnownSymbolName(symbolName) { @@ -10948,7 +11129,7 @@ var ts; * Includes the word "Symbol" with unicode escapes */ function isESSymbolIdentifier(node) { - return node.kind === 72 /* Identifier */ && node.escapedText === "Symbol"; + return node.kind === 73 /* Identifier */ && node.escapedText === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isPushOrUnshiftIdentifier(node) { @@ -10957,11 +11138,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 151 /* Parameter */; + return root.kind === 152 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 186 /* BindingElement */) { + while (node.kind === 187 /* BindingElement */) { node = node.parent.parent; } return node; @@ -10969,15 +11150,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 157 /* Constructor */ - || kind === 196 /* FunctionExpression */ - || kind === 239 /* FunctionDeclaration */ - || kind === 197 /* ArrowFunction */ - || kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */ - || kind === 244 /* ModuleDeclaration */ - || kind === 284 /* SourceFile */; + return kind === 158 /* Constructor */ + || kind === 197 /* FunctionExpression */ + || kind === 240 /* FunctionDeclaration */ + || kind === 198 /* ArrowFunction */ + || kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */ + || kind === 245 /* ModuleDeclaration */ + || kind === 285 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -10996,38 +11177,38 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 192 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 193 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 192 /* NewExpression */: + case 193 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 202 /* PrefixUnaryExpression */: - case 199 /* TypeOfExpression */: - case 200 /* VoidExpression */: - case 198 /* DeleteExpression */: - case 201 /* AwaitExpression */: - case 205 /* ConditionalExpression */: - case 207 /* YieldExpression */: + case 203 /* PrefixUnaryExpression */: + case 200 /* TypeOfExpression */: + case 201 /* VoidExpression */: + case 199 /* DeleteExpression */: + case 202 /* AwaitExpression */: + case 206 /* ConditionalExpression */: + case 208 /* YieldExpression */: return 1 /* Right */; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: switch (operator) { case 41 /* AsteriskAsteriskToken */: - case 59 /* EqualsToken */: - case 60 /* PlusEqualsToken */: - case 61 /* MinusEqualsToken */: - case 63 /* AsteriskAsteriskEqualsToken */: - case 62 /* AsteriskEqualsToken */: - case 64 /* SlashEqualsToken */: - case 65 /* PercentEqualsToken */: - case 66 /* LessThanLessThanEqualsToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 69 /* AmpersandEqualsToken */: - case 71 /* CaretEqualsToken */: - case 70 /* BarEqualsToken */: + case 60 /* EqualsToken */: + case 61 /* PlusEqualsToken */: + case 62 /* MinusEqualsToken */: + case 64 /* AsteriskAsteriskEqualsToken */: + case 63 /* AsteriskEqualsToken */: + case 65 /* SlashEqualsToken */: + case 66 /* PercentEqualsToken */: + case 67 /* LessThanLessThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 70 /* AmpersandEqualsToken */: + case 72 /* CaretEqualsToken */: + case 71 /* BarEqualsToken */: return 1 /* Right */; } } @@ -11036,15 +11217,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 192 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 193 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 204 /* BinaryExpression */) { + if (expression.kind === 205 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 202 /* PrefixUnaryExpression */ || expression.kind === 203 /* PostfixUnaryExpression */) { + else if (expression.kind === 203 /* PrefixUnaryExpression */ || expression.kind === 204 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -11054,73 +11235,73 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 314 /* CommaListExpression */: + case 315 /* CommaListExpression */: return 0; - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return 1; - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return 2; - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return 4; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0; - case 59 /* EqualsToken */: - case 60 /* PlusEqualsToken */: - case 61 /* MinusEqualsToken */: - case 63 /* AsteriskAsteriskEqualsToken */: - case 62 /* AsteriskEqualsToken */: - case 64 /* SlashEqualsToken */: - case 65 /* PercentEqualsToken */: - case 66 /* LessThanLessThanEqualsToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 69 /* AmpersandEqualsToken */: - case 71 /* CaretEqualsToken */: - case 70 /* BarEqualsToken */: + case 60 /* EqualsToken */: + case 61 /* PlusEqualsToken */: + case 62 /* MinusEqualsToken */: + case 64 /* AsteriskAsteriskEqualsToken */: + case 63 /* AsteriskEqualsToken */: + case 65 /* SlashEqualsToken */: + case 66 /* PercentEqualsToken */: + case 67 /* LessThanLessThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 70 /* AmpersandEqualsToken */: + case 72 /* CaretEqualsToken */: + case 71 /* BarEqualsToken */: return 3; default: return getBinaryOperatorPrecedence(operatorKind); } - case 202 /* PrefixUnaryExpression */: - case 199 /* TypeOfExpression */: - case 200 /* VoidExpression */: - case 198 /* DeleteExpression */: - case 201 /* AwaitExpression */: + case 203 /* PrefixUnaryExpression */: + case 200 /* TypeOfExpression */: + case 201 /* VoidExpression */: + case 199 /* DeleteExpression */: + case 202 /* AwaitExpression */: return 16; - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return 17; - case 191 /* CallExpression */: + case 192 /* CallExpression */: return 18; - case 192 /* NewExpression */: + case 193 /* NewExpression */: return hasArguments ? 19 : 18; - case 193 /* TaggedTemplateExpression */: - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 194 /* TaggedTemplateExpression */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return 19; - case 100 /* ThisKeyword */: - case 98 /* SuperKeyword */: - case 72 /* Identifier */: - case 96 /* NullKeyword */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 101 /* ThisKeyword */: + case 99 /* SuperKeyword */: + case 73 /* Identifier */: + case 97 /* NullKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 187 /* ArrayLiteralExpression */: - case 188 /* ObjectLiteralExpression */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 209 /* ClassExpression */: - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - case 264 /* JsxFragment */: + case 188 /* ArrayLiteralExpression */: + case 189 /* ObjectLiteralExpression */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 210 /* ClassExpression */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + case 265 /* JsxFragment */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 206 /* TemplateExpression */: - case 195 /* ParenthesizedExpression */: - case 210 /* OmittedExpression */: + case 207 /* TemplateExpression */: + case 196 /* ParenthesizedExpression */: + case 211 /* OmittedExpression */: return 20; default: return -1; @@ -11148,9 +11329,9 @@ var ts; case 30 /* GreaterThanToken */: case 31 /* LessThanEqualsToken */: case 32 /* GreaterThanEqualsToken */: - case 94 /* InstanceOfKeyword */: - case 93 /* InKeyword */: - case 119 /* AsKeyword */: + case 95 /* InstanceOfKeyword */: + case 94 /* InKeyword */: + case 120 /* AsKeyword */: return 11; case 46 /* LessThanLessThanToken */: case 47 /* GreaterThanGreaterThanToken */: @@ -11612,11 +11793,11 @@ var ts; } ts.parameterIsThisKeyword = parameterIsThisKeyword; function isThisIdentifier(node) { - return !!node && node.kind === 72 /* Identifier */ && identifierIsThisKeyword(node); + return !!node && node.kind === 73 /* Identifier */ && identifierIsThisKeyword(node); } ts.isThisIdentifier = isThisIdentifier; function identifierIsThisKeyword(id) { - return id.originalKeywordKind === 100 /* ThisKeyword */; + return id.originalKeywordKind === 101 /* ThisKeyword */; } ts.identifierIsThisKeyword = identifierIsThisKeyword; function getAllAccessorDeclarations(declarations, accessor) { @@ -11627,10 +11808,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 158 /* GetAccessor */) { + if (accessor.kind === 159 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 159 /* SetAccessor */) { + else if (accessor.kind === 160 /* SetAccessor */) { setAccessor = accessor; } else { @@ -11650,10 +11831,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 158 /* GetAccessor */ && !getAccessor) { + if (member.kind === 159 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 159 /* SetAccessor */ && !setAccessor) { + if (member.kind === 160 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -11699,7 +11880,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 === 296 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 297 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -11939,7 +12120,7 @@ var ts; flags |= modifierToFlag(modifier.kind); } } - if (node.flags & 4 /* NestedNamespace */ || (node.kind === 72 /* Identifier */ && node.isInJSDocNamespace)) { + if (node.flags & 4 /* NestedNamespace */ || (node.kind === 73 /* Identifier */ && node.isInJSDocNamespace)) { flags |= 1 /* Export */; } return flags; @@ -11947,17 +12128,17 @@ var ts; ts.getModifierFlagsNoCache = getModifierFlagsNoCache; function modifierToFlag(token) { switch (token) { - case 116 /* StaticKeyword */: return 32 /* Static */; - case 115 /* PublicKeyword */: return 4 /* Public */; - case 114 /* ProtectedKeyword */: return 16 /* Protected */; - case 113 /* PrivateKeyword */: return 8 /* Private */; - case 118 /* AbstractKeyword */: return 128 /* Abstract */; - case 85 /* ExportKeyword */: return 1 /* Export */; - case 125 /* DeclareKeyword */: return 2 /* Ambient */; - case 77 /* ConstKeyword */: return 2048 /* Const */; - case 80 /* DefaultKeyword */: return 512 /* Default */; - case 121 /* AsyncKeyword */: return 256 /* Async */; - case 133 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 117 /* StaticKeyword */: return 32 /* Static */; + case 116 /* PublicKeyword */: return 4 /* Public */; + case 115 /* ProtectedKeyword */: return 16 /* Protected */; + case 114 /* PrivateKeyword */: return 8 /* Private */; + case 119 /* AbstractKeyword */: return 128 /* Abstract */; + case 86 /* ExportKeyword */: return 1 /* Export */; + case 126 /* DeclareKeyword */: return 2 /* Ambient */; + case 78 /* ConstKeyword */: return 2048 /* Const */; + case 81 /* DefaultKeyword */: return 512 /* Default */; + case 122 /* AsyncKeyword */: return 256 /* Async */; + case 134 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -11969,7 +12150,7 @@ var ts; } ts.isLogicalOperator = isLogicalOperator; function isAssignmentOperator(token) { - return token >= 59 /* FirstAssignment */ && token <= 71 /* LastAssignment */; + return token >= 60 /* FirstAssignment */ && token <= 72 /* LastAssignment */; } ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ @@ -11982,14 +12163,14 @@ var ts; return ts.isExpressionWithTypeArguments(node) && ts.isHeritageClause(node.parent) && ts.isClassLike(node.parent.parent) - ? { class: node.parent.parent, isImplements: node.parent.token === 109 /* ImplementsKeyword */ } + ? { class: node.parent.parent, isImplements: node.parent.token === 110 /* ImplementsKeyword */ } : undefined; } ts.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments; function isAssignmentExpression(node, excludeCompoundAssignment) { return ts.isBinaryExpression(node) && (excludeCompoundAssignment - ? node.operatorToken.kind === 59 /* EqualsToken */ + ? node.operatorToken.kind === 60 /* EqualsToken */ : isAssignmentOperator(node.operatorToken.kind)) && ts.isLeftHandSideExpression(node.left); } @@ -11997,8 +12178,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 188 /* ObjectLiteralExpression */ - || kind === 187 /* ArrayLiteralExpression */; + return kind === 189 /* ObjectLiteralExpression */ + || kind === 188 /* ArrayLiteralExpression */; } return false; } @@ -12008,29 +12189,39 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isEntityNameExpression(node) { - return node.kind === 72 /* Identifier */ || isPropertyAccessEntityNameExpression(node); + return node.kind === 73 /* Identifier */ || isPropertyAccessEntityNameExpression(node); } ts.isEntityNameExpression = isEntityNameExpression; function isPropertyAccessEntityNameExpression(node) { return ts.isPropertyAccessExpression(node) && isEntityNameExpression(node.expression); } ts.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function tryGetPropertyAccessOrIdentifierToString(expr) { + if (ts.isPropertyAccessExpression(expr)) { + return tryGetPropertyAccessOrIdentifierToString(expr.expression) + "." + expr.name; + } + if (ts.isIdentifier(expr)) { + return ts.unescapeLeadingUnderscores(expr.escapedText); + } + return undefined; + } + ts.tryGetPropertyAccessOrIdentifierToString = tryGetPropertyAccessOrIdentifierToString; function isPrototypeAccess(node) { return ts.isPropertyAccessExpression(node) && node.name.escapedText === "prototype"; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 149 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 190 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 188 /* ObjectLiteralExpression */ && + return expression.kind === 189 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 187 /* ArrayLiteralExpression */ && + return expression.kind === 188 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -12218,77 +12409,6 @@ var ts; return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; - /** - * Formats an enum value as a string for debugging and debug assertions. - */ - function formatEnum(value, enumObject, isFlags) { - if (value === void 0) { value = 0; } - var members = getEnumMembers(enumObject); - if (value === 0) { - return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; - } - if (isFlags) { - var result = ""; - var remainingFlags = value; - for (var i = members.length - 1; i >= 0 && remainingFlags !== 0; i--) { - var _a = members[i], enumValue = _a[0], enumName = _a[1]; - if (enumValue !== 0 && (remainingFlags & enumValue) === enumValue) { - remainingFlags &= ~enumValue; - result = "" + enumName + (result ? ", " : "") + result; - } - } - if (remainingFlags === 0) { - return result; - } - } - else { - for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { - var _b = members_1[_i], enumValue = _b[0], enumName = _b[1]; - if (enumValue === value) { - return enumName; - } - } - } - return value.toString(); - } - function getEnumMembers(enumObject) { - var result = []; - for (var name in enumObject) { - var value = enumObject[name]; - if (typeof value === "number") { - result.push([value, name]); - } - } - return ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); }); - } - function formatSyntaxKind(kind) { - return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false); - } - ts.formatSyntaxKind = formatSyntaxKind; - function formatModifierFlags(flags) { - return formatEnum(flags, ts.ModifierFlags, /*isFlags*/ true); - } - ts.formatModifierFlags = formatModifierFlags; - function formatTransformFlags(flags) { - return formatEnum(flags, ts.TransformFlags, /*isFlags*/ true); - } - ts.formatTransformFlags = formatTransformFlags; - function formatEmitFlags(flags) { - return formatEnum(flags, ts.EmitFlags, /*isFlags*/ true); - } - ts.formatEmitFlags = formatEmitFlags; - function formatSymbolFlags(flags) { - return formatEnum(flags, ts.SymbolFlags, /*isFlags*/ true); - } - ts.formatSymbolFlags = formatSymbolFlags; - function formatTypeFlags(flags) { - return formatEnum(flags, ts.TypeFlags, /*isFlags*/ true); - } - ts.formatTypeFlags = formatTypeFlags; - function formatObjectFlags(flags) { - return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); - } - ts.formatObjectFlags = formatObjectFlags; /** * Creates a new TextRange from the provided pos and end. * @@ -12378,6 +12498,10 @@ var ts; return positionsAreOnSameLine(range1.end, getStartPositionOfRange(range2, sourceFile), sourceFile); } ts.rangeEndIsOnSameLineAsRangeStart = rangeEndIsOnSameLineAsRangeStart; + function isNodeArrayMultiLine(list, sourceFile) { + return !positionsAreOnSameLine(list.pos, list.end, sourceFile); + } + ts.isNodeArrayMultiLine = isNodeArrayMultiLine; function positionsAreOnSameLine(pos1, pos2, sourceFile) { return pos1 === pos2 || getLineOfLocalPosition(sourceFile, pos1) === getLineOfLocalPosition(sourceFile, pos2); @@ -12395,8 +12519,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 243 /* EnumDeclaration */: - case 244 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 245 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -12430,10 +12554,10 @@ var ts; } if (getCheckFlags(s) & 6 /* Synthetic */) { var checkFlags = s.checkFlags; - var accessModifier = checkFlags & 512 /* ContainsPrivate */ ? 8 /* Private */ : - checkFlags & 128 /* ContainsPublic */ ? 4 /* Public */ : + var accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ : + checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */; - var staticModifier = checkFlags & 1024 /* ContainsStatic */ ? 32 /* Static */ : 0; + var staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0; return accessModifier | staticModifier; } if (s.flags & 4194304 /* Prototype */) { @@ -12473,35 +12597,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return accessKind(parent); - case 203 /* PostfixUnaryExpression */: - case 202 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 44 /* PlusPlusToken */ || operator === 45 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? - operatorToken.kind === 59 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() + operatorToken.kind === 60 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 275 /* PropertyAssignment */: { + case 276 /* 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 276 /* ShorthandPropertyAssignment */: + case 277 /* 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 187 /* ArrayLiteralExpression */: + case 188 /* 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 === 221 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 222 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -12604,7 +12728,7 @@ var ts; } ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol; function getObjectFlags(type) { - return type.flags & 3768320 /* ObjectFlagsType */ ? type.objectFlags : 0; + return type.flags & 3899392 /* ObjectFlagsType */ ? type.objectFlags : 0; } ts.getObjectFlags = getObjectFlags; function typeHasCallOrConstructSignatures(type, checker) { @@ -12656,32 +12780,32 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 289 /* JSDocAllType */ - || kind === 290 /* JSDocUnknownType */ - || kind === 291 /* JSDocNullableType */ - || kind === 292 /* JSDocNonNullableType */ - || kind === 293 /* JSDocOptionalType */ - || kind === 294 /* JSDocFunctionType */ - || kind === 295 /* JSDocVariadicType */; + return (kind >= 164 /* FirstTypeNode */ && kind <= 184 /* LastTypeNode */) + || kind === 121 /* AnyKeyword */ + || kind === 144 /* UnknownKeyword */ + || kind === 136 /* NumberKeyword */ + || kind === 147 /* BigIntKeyword */ + || kind === 137 /* ObjectKeyword */ + || kind === 124 /* BooleanKeyword */ + || kind === 139 /* StringKeyword */ + || kind === 140 /* SymbolKeyword */ + || kind === 101 /* ThisKeyword */ + || kind === 107 /* VoidKeyword */ + || kind === 142 /* UndefinedKeyword */ + || kind === 97 /* NullKeyword */ + || kind === 133 /* NeverKeyword */ + || kind === 212 /* ExpressionWithTypeArguments */ + || kind === 290 /* JSDocAllType */ + || kind === 291 /* JSDocUnknownType */ + || kind === 292 /* JSDocNullableType */ + || kind === 293 /* JSDocNonNullableType */ + || kind === 294 /* JSDocOptionalType */ + || kind === 295 /* JSDocFunctionType */ + || kind === 296 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 189 /* PropertyAccessExpression */ || node.kind === 190 /* ElementAccessExpression */; + return node.kind === 190 /* PropertyAccessExpression */ || node.kind === 191 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function isBundleFileTextLike(section) { @@ -12698,8 +12822,10 @@ var ts; (function (ts) { function getDefaultLibFileName(options) { switch (options.target) { - case 7 /* ESNext */: + case 8 /* ESNext */: return "lib.esnext.full.d.ts"; + case 7 /* ES2020 */: + return "lib.es2020.full.d.ts"; case 6 /* ES2019 */: return "lib.es2019.full.d.ts"; case 5 /* ES2018 */: @@ -12916,9 +13042,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 150 /* TypeParameter */) { + if (d && d.kind === 151 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 241 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 242 /* InterfaceDeclaration */) { return current; } } @@ -12926,7 +13052,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 157 /* Constructor */; + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 158 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -12956,14 +13082,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 237 /* VariableDeclaration */) { + if (node.kind === 238 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 238 /* VariableDeclarationList */) { + if (node && node.kind === 239 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 219 /* VariableStatement */) { + if (node && node.kind === 220 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -13109,27 +13235,27 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return expr.name; - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 195 /* ParenthesizedExpression */: { + case 196 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 233 /* LabeledStatement */: { + case 234 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -13153,18 +13279,18 @@ var ts; /** @internal */ function getNonAssignedNameOfDeclaration(declaration) { switch (declaration.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return declaration; - case 310 /* JSDocPropertyTag */: - case 304 /* JSDocParameterTag */: { + case 311 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 148 /* QualifiedName */) { + if (name.kind === 149 /* QualifiedName */) { return name.right; } break; } - case 191 /* CallExpression */: - case 204 /* BinaryExpression */: { + case 192 /* CallExpression */: + case 205 /* BinaryExpression */: { var expr = declaration; switch (ts.getAssignmentDeclarationKind(expr)) { case 1 /* ExportsProperty */: @@ -13180,9 +13306,9 @@ var ts; return undefined; } } - case 309 /* JSDocTypedefTag */: + case 310 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 254 /* ExportAssignment */: { + case 255 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -13384,7 +13510,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 296 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 297 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -13452,198 +13578,198 @@ var ts; } ts.isTemplateTail = isTemplateTail; function isIdentifier(node) { - return node.kind === 72 /* Identifier */; + return node.kind === 73 /* Identifier */; } ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 148 /* QualifiedName */; + return node.kind === 149 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 149 /* ComputedPropertyName */; + return node.kind === 150 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 150 /* TypeParameter */; + return node.kind === 151 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 151 /* Parameter */; + return node.kind === 152 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 152 /* Decorator */; + return node.kind === 153 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 153 /* PropertySignature */; + return node.kind === 154 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 154 /* PropertyDeclaration */; + return node.kind === 155 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 155 /* MethodSignature */; + return node.kind === 156 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 156 /* MethodDeclaration */; + return node.kind === 157 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 157 /* Constructor */; + return node.kind === 158 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 158 /* GetAccessor */; + return node.kind === 159 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 159 /* SetAccessor */; + return node.kind === 160 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 160 /* CallSignature */; + return node.kind === 161 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 161 /* ConstructSignature */; + return node.kind === 162 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 162 /* IndexSignature */; + return node.kind === 163 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 159 /* SetAccessor */ || node.kind === 158 /* GetAccessor */; + return node.kind === 160 /* SetAccessor */ || node.kind === 159 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 163 /* TypePredicate */; + return node.kind === 164 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 164 /* TypeReference */; + return node.kind === 165 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 165 /* FunctionType */; + return node.kind === 166 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 166 /* ConstructorType */; + return node.kind === 167 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 167 /* TypeQuery */; + return node.kind === 168 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 168 /* TypeLiteral */; + return node.kind === 169 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 169 /* ArrayType */; + return node.kind === 170 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 170 /* TupleType */; + return node.kind === 171 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 173 /* UnionType */; + return node.kind === 174 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 174 /* IntersectionType */; + return node.kind === 175 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 175 /* ConditionalType */; + return node.kind === 176 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 176 /* InferType */; + return node.kind === 177 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 177 /* ParenthesizedType */; + return node.kind === 178 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 178 /* ThisType */; + return node.kind === 179 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 179 /* TypeOperator */; + return node.kind === 180 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 180 /* IndexedAccessType */; + return node.kind === 181 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 181 /* MappedType */; + return node.kind === 182 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 182 /* LiteralType */; + return node.kind === 183 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 183 /* ImportType */; + return node.kind === 184 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 184 /* ObjectBindingPattern */; + return node.kind === 185 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 185 /* ArrayBindingPattern */; + return node.kind === 186 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 186 /* BindingElement */; + return node.kind === 187 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 187 /* ArrayLiteralExpression */; + return node.kind === 188 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 188 /* ObjectLiteralExpression */; + return node.kind === 189 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 189 /* PropertyAccessExpression */; + return node.kind === 190 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 190 /* ElementAccessExpression */; + return node.kind === 191 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 191 /* CallExpression */; + return node.kind === 192 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 192 /* NewExpression */; + return node.kind === 193 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 193 /* TaggedTemplateExpression */; + return node.kind === 194 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 194 /* TypeAssertionExpression */; + return node.kind === 195 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isConstTypeReference(node) { @@ -13652,376 +13778,376 @@ var ts; } ts.isConstTypeReference = isConstTypeReference; function isParenthesizedExpression(node) { - return node.kind === 195 /* ParenthesizedExpression */; + return node.kind === 196 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 313 /* PartiallyEmittedExpression */) { + while (node.kind === 314 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 196 /* FunctionExpression */; + return node.kind === 197 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 197 /* ArrowFunction */; + return node.kind === 198 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 198 /* DeleteExpression */; + return node.kind === 199 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 199 /* TypeOfExpression */; + return node.kind === 200 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 200 /* VoidExpression */; + return node.kind === 201 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 201 /* AwaitExpression */; + return node.kind === 202 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 202 /* PrefixUnaryExpression */; + return node.kind === 203 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 203 /* PostfixUnaryExpression */; + return node.kind === 204 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 204 /* BinaryExpression */; + return node.kind === 205 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 205 /* ConditionalExpression */; + return node.kind === 206 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 206 /* TemplateExpression */; + return node.kind === 207 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 207 /* YieldExpression */; + return node.kind === 208 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 208 /* SpreadElement */; + return node.kind === 209 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 209 /* ClassExpression */; + return node.kind === 210 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 210 /* OmittedExpression */; + return node.kind === 211 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 211 /* ExpressionWithTypeArguments */; + return node.kind === 212 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 212 /* AsExpression */; + return node.kind === 213 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 213 /* NonNullExpression */; + return node.kind === 214 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 214 /* MetaProperty */; + return node.kind === 215 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 216 /* TemplateSpan */; + return node.kind === 217 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 217 /* SemicolonClassElement */; + return node.kind === 218 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 218 /* Block */; + return node.kind === 219 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 219 /* VariableStatement */; + return node.kind === 220 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 220 /* EmptyStatement */; + return node.kind === 221 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 221 /* ExpressionStatement */; + return node.kind === 222 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 222 /* IfStatement */; + return node.kind === 223 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 223 /* DoStatement */; + return node.kind === 224 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 224 /* WhileStatement */; + return node.kind === 225 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 225 /* ForStatement */; + return node.kind === 226 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 226 /* ForInStatement */; + return node.kind === 227 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 227 /* ForOfStatement */; + return node.kind === 228 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 228 /* ContinueStatement */; + return node.kind === 229 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 229 /* BreakStatement */; + return node.kind === 230 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 229 /* BreakStatement */ || node.kind === 228 /* ContinueStatement */; + return node.kind === 230 /* BreakStatement */ || node.kind === 229 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 230 /* ReturnStatement */; + return node.kind === 231 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 231 /* WithStatement */; + return node.kind === 232 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 232 /* SwitchStatement */; + return node.kind === 233 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 233 /* LabeledStatement */; + return node.kind === 234 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 234 /* ThrowStatement */; + return node.kind === 235 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 235 /* TryStatement */; + return node.kind === 236 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 236 /* DebuggerStatement */; + return node.kind === 237 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 237 /* VariableDeclaration */; + return node.kind === 238 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 238 /* VariableDeclarationList */; + return node.kind === 239 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 239 /* FunctionDeclaration */; + return node.kind === 240 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 240 /* ClassDeclaration */; + return node.kind === 241 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 241 /* InterfaceDeclaration */; + return node.kind === 242 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 242 /* TypeAliasDeclaration */; + return node.kind === 243 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 243 /* EnumDeclaration */; + return node.kind === 244 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 244 /* ModuleDeclaration */; + return node.kind === 245 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 245 /* ModuleBlock */; + return node.kind === 246 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 246 /* CaseBlock */; + return node.kind === 247 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 247 /* NamespaceExportDeclaration */; + return node.kind === 248 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 248 /* ImportEqualsDeclaration */; + return node.kind === 249 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 249 /* ImportDeclaration */; + return node.kind === 250 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 250 /* ImportClause */; + return node.kind === 251 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 251 /* NamespaceImport */; + return node.kind === 252 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 252 /* NamedImports */; + return node.kind === 253 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 253 /* ImportSpecifier */; + return node.kind === 254 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 254 /* ExportAssignment */; + return node.kind === 255 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 255 /* ExportDeclaration */; + return node.kind === 256 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 256 /* NamedExports */; + return node.kind === 257 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 257 /* ExportSpecifier */; + return node.kind === 258 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 258 /* MissingDeclaration */; + return node.kind === 259 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 259 /* ExternalModuleReference */; + return node.kind === 260 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 260 /* JsxElement */; + return node.kind === 261 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 261 /* JsxSelfClosingElement */; + return node.kind === 262 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 262 /* JsxOpeningElement */; + return node.kind === 263 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 263 /* JsxClosingElement */; + return node.kind === 264 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 264 /* JsxFragment */; + return node.kind === 265 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 265 /* JsxOpeningFragment */; + return node.kind === 266 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 266 /* JsxClosingFragment */; + return node.kind === 267 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 267 /* JsxAttribute */; + return node.kind === 268 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 268 /* JsxAttributes */; + return node.kind === 269 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 269 /* JsxSpreadAttribute */; + return node.kind === 270 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 270 /* JsxExpression */; + return node.kind === 271 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 271 /* CaseClause */; + return node.kind === 272 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 272 /* DefaultClause */; + return node.kind === 273 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 273 /* HeritageClause */; + return node.kind === 274 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 274 /* CatchClause */; + return node.kind === 275 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 275 /* PropertyAssignment */; + return node.kind === 276 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 276 /* ShorthandPropertyAssignment */; + return node.kind === 277 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 277 /* SpreadAssignment */; + return node.kind === 278 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 278 /* EnumMember */; + return node.kind === 279 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 284 /* SourceFile */; + return node.kind === 285 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 285 /* Bundle */; + return node.kind === 286 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 286 /* UnparsedSource */; + return node.kind === 287 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; function isUnparsedPrepend(node) { - return node.kind === 280 /* UnparsedPrepend */; + return node.kind === 281 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; function isUnparsedTextLike(node) { switch (node.kind) { - case 281 /* UnparsedText */: - case 282 /* UnparsedInternalText */: + case 282 /* UnparsedText */: + case 283 /* UnparsedInternalText */: return true; default: return false; @@ -14030,101 +14156,101 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 279 /* UnparsedPrologue */ || - node.kind === 283 /* UnparsedSyntheticReference */; + node.kind === 280 /* UnparsedPrologue */ || + node.kind === 284 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 288 /* JSDocTypeExpression */; + return node.kind === 289 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 289 /* JSDocAllType */; + return node.kind === 290 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 290 /* JSDocUnknownType */; + return node.kind === 291 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 291 /* JSDocNullableType */; + return node.kind === 292 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 292 /* JSDocNonNullableType */; + return node.kind === 293 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 293 /* JSDocOptionalType */; + return node.kind === 294 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 294 /* JSDocFunctionType */; + return node.kind === 295 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 295 /* JSDocVariadicType */; + return node.kind === 296 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 296 /* JSDocComment */; + return node.kind === 297 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 300 /* JSDocAugmentsTag */; + return node.kind === 301 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocClassTag(node) { - return node.kind === 301 /* JSDocClassTag */; + return node.kind === 302 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocEnumTag(node) { - return node.kind === 303 /* JSDocEnumTag */; + return node.kind === 304 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocThisTag(node) { - return node.kind === 306 /* JSDocThisTag */; + return node.kind === 307 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocParameterTag(node) { - return node.kind === 304 /* JSDocParameterTag */; + return node.kind === 305 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 305 /* JSDocReturnTag */; + return node.kind === 306 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 307 /* JSDocTypeTag */; + return node.kind === 308 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 308 /* JSDocTemplateTag */; + return node.kind === 309 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 309 /* JSDocTypedefTag */; + return node.kind === 310 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 310 /* JSDocPropertyTag */; + return node.kind === 311 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 310 /* JSDocPropertyTag */ || node.kind === 304 /* JSDocParameterTag */; + return node.kind === 311 /* JSDocPropertyTag */ || node.kind === 305 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 297 /* JSDocTypeLiteral */; + return node.kind === 298 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocCallbackTag(node) { - return node.kind === 302 /* JSDocCallbackTag */; + return node.kind === 303 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocSignature(node) { - return node.kind === 298 /* JSDocSignature */; + return node.kind === 299 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; })(ts || (ts = {})); @@ -14135,7 +14261,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 311 /* SyntaxList */; + return n.kind === 312 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -14145,7 +14271,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 148 /* FirstNode */; + return kind >= 149 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -14154,7 +14280,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 <= 147 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 148 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -14207,17 +14333,17 @@ var ts; /* @internal */ function isModifierKind(token) { switch (token) { - case 118 /* AbstractKeyword */: - case 121 /* AsyncKeyword */: - case 77 /* ConstKeyword */: - case 125 /* DeclareKeyword */: - case 80 /* DefaultKeyword */: - case 85 /* ExportKeyword */: - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 133 /* ReadonlyKeyword */: - case 116 /* StaticKeyword */: + case 119 /* AbstractKeyword */: + case 122 /* AsyncKeyword */: + case 78 /* ConstKeyword */: + case 126 /* DeclareKeyword */: + case 81 /* DefaultKeyword */: + case 86 /* ExportKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 134 /* ReadonlyKeyword */: + case 117 /* StaticKeyword */: return true; } return false; @@ -14230,7 +14356,7 @@ var ts; ts.isParameterPropertyModifier = isParameterPropertyModifier; /* @internal */ function isClassMemberModifier(idToken) { - return isParameterPropertyModifier(idToken) || idToken === 116 /* StaticKeyword */; + return isParameterPropertyModifier(idToken) || idToken === 117 /* StaticKeyword */; } ts.isClassMemberModifier = isClassMemberModifier; function isModifier(node) { @@ -14239,23 +14365,23 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 148 /* QualifiedName */ - || kind === 72 /* Identifier */; + return kind === 149 /* QualifiedName */ + || kind === 73 /* Identifier */; } ts.isEntityName = isEntityName; function isPropertyName(node) { var kind = node.kind; - return kind === 72 /* Identifier */ + return kind === 73 /* Identifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 149 /* ComputedPropertyName */; + || kind === 150 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; - return kind === 72 /* Identifier */ - || kind === 184 /* ObjectBindingPattern */ - || kind === 185 /* ArrayBindingPattern */; + return kind === 73 /* Identifier */ + || kind === 185 /* ObjectBindingPattern */ + || kind === 186 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -14270,13 +14396,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return true; default: return false; @@ -14285,14 +14411,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 298 /* JSDocSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: - case 165 /* FunctionType */: - case 294 /* JSDocFunctionType */: - case 166 /* ConstructorType */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 299 /* JSDocSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: + case 166 /* FunctionType */: + case 295 /* JSDocFunctionType */: + case 167 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -14307,29 +14433,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 157 /* Constructor */ - || kind === 154 /* PropertyDeclaration */ - || kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */ - || kind === 162 /* IndexSignature */ - || kind === 217 /* SemicolonClassElement */; + return kind === 158 /* Constructor */ + || kind === 155 /* PropertyDeclaration */ + || kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */ + || kind === 163 /* IndexSignature */ + || kind === 218 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 240 /* ClassDeclaration */ || node.kind === 209 /* ClassExpression */); + return node && (node.kind === 241 /* ClassDeclaration */ || node.kind === 210 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 158 /* GetAccessor */ || node.kind === 159 /* SetAccessor */); + return node && (node.kind === 159 /* GetAccessor */ || node.kind === 160 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return true; default: return false; @@ -14339,11 +14465,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 161 /* ConstructSignature */ - || kind === 160 /* CallSignature */ - || kind === 153 /* PropertySignature */ - || kind === 155 /* MethodSignature */ - || kind === 162 /* IndexSignature */; + return kind === 162 /* ConstructSignature */ + || kind === 161 /* CallSignature */ + || kind === 154 /* PropertySignature */ + || kind === 156 /* MethodSignature */ + || kind === 163 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -14352,12 +14478,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 275 /* PropertyAssignment */ - || kind === 276 /* ShorthandPropertyAssignment */ - || kind === 277 /* SpreadAssignment */ - || kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */; + return kind === 276 /* PropertyAssignment */ + || kind === 277 /* ShorthandPropertyAssignment */ + || kind === 278 /* SpreadAssignment */ + || kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -14372,8 +14498,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 165 /* FunctionType */: - case 166 /* ConstructorType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: return true; } return false; @@ -14384,8 +14510,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 185 /* ArrayBindingPattern */ - || kind === 184 /* ObjectBindingPattern */; + return kind === 186 /* ArrayBindingPattern */ + || kind === 185 /* ObjectBindingPattern */; } return false; } @@ -14393,15 +14519,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 187 /* ArrayLiteralExpression */ - || kind === 188 /* ObjectLiteralExpression */; + return kind === 188 /* ArrayLiteralExpression */ + || kind === 189 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 186 /* BindingElement */ - || kind === 210 /* OmittedExpression */; + return kind === 187 /* BindingElement */ + || kind === 211 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -14410,9 +14536,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 237 /* VariableDeclaration */: - case 151 /* Parameter */: - case 186 /* BindingElement */: + case 238 /* VariableDeclaration */: + case 152 /* Parameter */: + case 187 /* BindingElement */: return true; } return false; @@ -14433,8 +14559,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 184 /* ObjectBindingPattern */: - case 188 /* ObjectLiteralExpression */: + case 185 /* ObjectBindingPattern */: + case 189 /* ObjectLiteralExpression */: return true; } return false; @@ -14446,8 +14572,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 185 /* ArrayBindingPattern */: - case 187 /* ArrayLiteralExpression */: + case 186 /* ArrayBindingPattern */: + case 188 /* ArrayLiteralExpression */: return true; } return false; @@ -14456,26 +14582,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 189 /* PropertyAccessExpression */ - || kind === 148 /* QualifiedName */ - || kind === 183 /* ImportType */; + return kind === 190 /* PropertyAccessExpression */ + || kind === 149 /* QualifiedName */ + || kind === 184 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 189 /* PropertyAccessExpression */ - || kind === 148 /* QualifiedName */; + return kind === 190 /* PropertyAccessExpression */ + || kind === 149 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 262 /* JsxOpeningElement */: - case 261 /* JsxSelfClosingElement */: - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 193 /* TaggedTemplateExpression */: - case 152 /* Decorator */: + case 263 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 194 /* TaggedTemplateExpression */: + case 153 /* Decorator */: return true; default: return false; @@ -14483,12 +14609,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 191 /* CallExpression */ || node.kind === 192 /* NewExpression */; + return node.kind === 192 /* CallExpression */ || node.kind === 193 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 206 /* TemplateExpression */ + return kind === 207 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -14499,34 +14625,34 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: - case 192 /* NewExpression */: - case 191 /* CallExpression */: - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - case 264 /* JsxFragment */: - case 193 /* TaggedTemplateExpression */: - case 187 /* ArrayLiteralExpression */: - case 195 /* ParenthesizedExpression */: - case 188 /* ObjectLiteralExpression */: - case 209 /* ClassExpression */: - case 196 /* FunctionExpression */: - case 72 /* Identifier */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: + case 193 /* NewExpression */: + case 192 /* CallExpression */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + case 265 /* JsxFragment */: + case 194 /* TaggedTemplateExpression */: + case 188 /* ArrayLiteralExpression */: + case 196 /* ParenthesizedExpression */: + case 189 /* ObjectLiteralExpression */: + case 210 /* ClassExpression */: + case 197 /* FunctionExpression */: + case 73 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 206 /* TemplateExpression */: - case 87 /* FalseKeyword */: - case 96 /* NullKeyword */: - case 100 /* ThisKeyword */: - case 102 /* TrueKeyword */: - case 98 /* SuperKeyword */: - case 213 /* NonNullExpression */: - case 214 /* MetaProperty */: - case 92 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression + case 207 /* TemplateExpression */: + case 88 /* FalseKeyword */: + case 97 /* NullKeyword */: + case 101 /* ThisKeyword */: + case 103 /* TrueKeyword */: + case 99 /* SuperKeyword */: + case 214 /* NonNullExpression */: + case 215 /* MetaProperty */: + case 93 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: return false; @@ -14539,13 +14665,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: - case 198 /* DeleteExpression */: - case 199 /* TypeOfExpression */: - case 200 /* VoidExpression */: - case 201 /* AwaitExpression */: - case 194 /* TypeAssertionExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: + case 199 /* DeleteExpression */: + case 200 /* TypeOfExpression */: + case 201 /* VoidExpression */: + case 202 /* AwaitExpression */: + case 195 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -14554,9 +14680,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return true; - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return expr.operator === 44 /* PlusPlusToken */ || expr.operator === 45 /* MinusMinusToken */; default: @@ -14575,15 +14701,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 205 /* ConditionalExpression */: - case 207 /* YieldExpression */: - case 197 /* ArrowFunction */: - case 204 /* BinaryExpression */: - case 208 /* SpreadElement */: - case 212 /* AsExpression */: - case 210 /* OmittedExpression */: - case 314 /* CommaListExpression */: - case 313 /* PartiallyEmittedExpression */: + case 206 /* ConditionalExpression */: + case 208 /* YieldExpression */: + case 198 /* ArrowFunction */: + case 205 /* BinaryExpression */: + case 209 /* SpreadElement */: + case 213 /* AsExpression */: + case 211 /* OmittedExpression */: + case 315 /* CommaListExpression */: + case 314 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -14591,18 +14717,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 194 /* TypeAssertionExpression */ - || kind === 212 /* AsExpression */; + return kind === 195 /* TypeAssertionExpression */ + || kind === 213 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 313 /* PartiallyEmittedExpression */; + return node.kind === 314 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 312 /* NotEmittedStatement */; + return node.kind === 313 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -14613,13 +14739,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: return true; - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -14627,7 +14753,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 226 /* ForInStatement */ || node.kind === 227 /* ForOfStatement */; + return node.kind === 227 /* ForInStatement */ || node.kind === 228 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -14651,113 +14777,113 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 245 /* ModuleBlock */ - || kind === 244 /* ModuleDeclaration */ - || kind === 72 /* Identifier */; + return kind === 246 /* ModuleBlock */ + || kind === 245 /* ModuleDeclaration */ + || kind === 73 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 245 /* ModuleBlock */ - || kind === 244 /* ModuleDeclaration */; + return kind === 246 /* ModuleBlock */ + || kind === 245 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; - return kind === 72 /* Identifier */ - || kind === 244 /* ModuleDeclaration */; + return kind === 73 /* Identifier */ + || kind === 245 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 252 /* NamedImports */ - || kind === 251 /* NamespaceImport */; + return kind === 253 /* NamedImports */ + || kind === 252 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 244 /* ModuleDeclaration */ || node.kind === 243 /* EnumDeclaration */; + return node.kind === 245 /* ModuleDeclaration */ || node.kind === 244 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 197 /* ArrowFunction */ - || kind === 186 /* BindingElement */ - || kind === 240 /* ClassDeclaration */ - || kind === 209 /* ClassExpression */ - || kind === 157 /* Constructor */ - || kind === 243 /* EnumDeclaration */ - || kind === 278 /* EnumMember */ - || kind === 257 /* ExportSpecifier */ - || kind === 239 /* FunctionDeclaration */ - || kind === 196 /* FunctionExpression */ - || kind === 158 /* GetAccessor */ - || kind === 250 /* ImportClause */ - || kind === 248 /* ImportEqualsDeclaration */ - || kind === 253 /* ImportSpecifier */ - || kind === 241 /* InterfaceDeclaration */ - || kind === 267 /* JsxAttribute */ - || kind === 156 /* MethodDeclaration */ - || kind === 155 /* MethodSignature */ - || kind === 244 /* ModuleDeclaration */ - || kind === 247 /* NamespaceExportDeclaration */ - || kind === 251 /* NamespaceImport */ - || kind === 151 /* Parameter */ - || kind === 275 /* PropertyAssignment */ - || kind === 154 /* PropertyDeclaration */ - || kind === 153 /* PropertySignature */ - || kind === 159 /* SetAccessor */ - || kind === 276 /* ShorthandPropertyAssignment */ - || kind === 242 /* TypeAliasDeclaration */ - || kind === 150 /* TypeParameter */ - || kind === 237 /* VariableDeclaration */ - || kind === 309 /* JSDocTypedefTag */ - || kind === 302 /* JSDocCallbackTag */ - || kind === 310 /* JSDocPropertyTag */; + return kind === 198 /* ArrowFunction */ + || kind === 187 /* BindingElement */ + || kind === 241 /* ClassDeclaration */ + || kind === 210 /* ClassExpression */ + || kind === 158 /* Constructor */ + || kind === 244 /* EnumDeclaration */ + || kind === 279 /* EnumMember */ + || kind === 258 /* ExportSpecifier */ + || kind === 240 /* FunctionDeclaration */ + || kind === 197 /* FunctionExpression */ + || kind === 159 /* GetAccessor */ + || kind === 251 /* ImportClause */ + || kind === 249 /* ImportEqualsDeclaration */ + || kind === 254 /* ImportSpecifier */ + || kind === 242 /* InterfaceDeclaration */ + || kind === 268 /* JsxAttribute */ + || kind === 157 /* MethodDeclaration */ + || kind === 156 /* MethodSignature */ + || kind === 245 /* ModuleDeclaration */ + || kind === 248 /* NamespaceExportDeclaration */ + || kind === 252 /* NamespaceImport */ + || kind === 152 /* Parameter */ + || kind === 276 /* PropertyAssignment */ + || kind === 155 /* PropertyDeclaration */ + || kind === 154 /* PropertySignature */ + || kind === 160 /* SetAccessor */ + || kind === 277 /* ShorthandPropertyAssignment */ + || kind === 243 /* TypeAliasDeclaration */ + || kind === 151 /* TypeParameter */ + || kind === 238 /* VariableDeclaration */ + || kind === 310 /* JSDocTypedefTag */ + || kind === 303 /* JSDocCallbackTag */ + || kind === 311 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 239 /* FunctionDeclaration */ - || kind === 258 /* MissingDeclaration */ - || kind === 240 /* ClassDeclaration */ - || kind === 241 /* InterfaceDeclaration */ - || kind === 242 /* TypeAliasDeclaration */ - || kind === 243 /* EnumDeclaration */ - || kind === 244 /* ModuleDeclaration */ - || kind === 249 /* ImportDeclaration */ - || kind === 248 /* ImportEqualsDeclaration */ - || kind === 255 /* ExportDeclaration */ - || kind === 254 /* ExportAssignment */ - || kind === 247 /* NamespaceExportDeclaration */; + return kind === 240 /* FunctionDeclaration */ + || kind === 259 /* MissingDeclaration */ + || kind === 241 /* ClassDeclaration */ + || kind === 242 /* InterfaceDeclaration */ + || kind === 243 /* TypeAliasDeclaration */ + || kind === 244 /* EnumDeclaration */ + || kind === 245 /* ModuleDeclaration */ + || kind === 250 /* ImportDeclaration */ + || kind === 249 /* ImportEqualsDeclaration */ + || kind === 256 /* ExportDeclaration */ + || kind === 255 /* ExportAssignment */ + || kind === 248 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 229 /* BreakStatement */ - || kind === 228 /* ContinueStatement */ - || kind === 236 /* DebuggerStatement */ - || kind === 223 /* DoStatement */ - || kind === 221 /* ExpressionStatement */ - || kind === 220 /* EmptyStatement */ - || kind === 226 /* ForInStatement */ - || kind === 227 /* ForOfStatement */ - || kind === 225 /* ForStatement */ - || kind === 222 /* IfStatement */ - || kind === 233 /* LabeledStatement */ - || kind === 230 /* ReturnStatement */ - || kind === 232 /* SwitchStatement */ - || kind === 234 /* ThrowStatement */ - || kind === 235 /* TryStatement */ - || kind === 219 /* VariableStatement */ - || kind === 224 /* WhileStatement */ - || kind === 231 /* WithStatement */ - || kind === 312 /* NotEmittedStatement */ - || kind === 316 /* EndOfDeclarationMarker */ - || kind === 315 /* MergeDeclarationMarker */; + return kind === 230 /* BreakStatement */ + || kind === 229 /* ContinueStatement */ + || kind === 237 /* DebuggerStatement */ + || kind === 224 /* DoStatement */ + || kind === 222 /* ExpressionStatement */ + || kind === 221 /* EmptyStatement */ + || kind === 227 /* ForInStatement */ + || kind === 228 /* ForOfStatement */ + || kind === 226 /* ForStatement */ + || kind === 223 /* IfStatement */ + || kind === 234 /* LabeledStatement */ + || kind === 231 /* ReturnStatement */ + || kind === 233 /* SwitchStatement */ + || kind === 235 /* ThrowStatement */ + || kind === 236 /* TryStatement */ + || kind === 220 /* VariableStatement */ + || kind === 225 /* WhileStatement */ + || kind === 232 /* WithStatement */ + || kind === 313 /* NotEmittedStatement */ + || kind === 317 /* EndOfDeclarationMarker */ + || kind === 316 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 150 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 308 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 151 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 309 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -14784,10 +14910,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 218 /* Block */) + if (node.kind !== 219 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 235 /* TryStatement */ || node.parent.kind === 274 /* CatchClause */) { + if (node.parent.kind === 236 /* TryStatement */ || node.parent.kind === 275 /* CatchClause */) { return false; } } @@ -14797,81 +14923,81 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 259 /* ExternalModuleReference */ - || kind === 148 /* QualifiedName */ - || kind === 72 /* Identifier */; + return kind === 260 /* ExternalModuleReference */ + || kind === 149 /* QualifiedName */ + || kind === 73 /* Identifier */; } ts.isModuleReference = isModuleReference; // JSX /* @internal */ function isJsxTagNameExpression(node) { var kind = node.kind; - return kind === 100 /* ThisKeyword */ - || kind === 72 /* Identifier */ - || kind === 189 /* PropertyAccessExpression */; + return kind === 101 /* ThisKeyword */ + || kind === 73 /* Identifier */ + || kind === 190 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 260 /* JsxElement */ - || kind === 270 /* JsxExpression */ - || kind === 261 /* JsxSelfClosingElement */ + return kind === 261 /* JsxElement */ + || kind === 271 /* JsxExpression */ + || kind === 262 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 264 /* JsxFragment */; + || kind === 265 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 267 /* JsxAttribute */ - || kind === 269 /* JsxSpreadAttribute */; + return kind === 268 /* JsxAttribute */ + || kind === 270 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 270 /* JsxExpression */; + || kind === 271 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 262 /* JsxOpeningElement */ - || kind === 261 /* JsxSelfClosingElement */; + return kind === 263 /* JsxOpeningElement */ + || kind === 262 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 271 /* CaseClause */ - || kind === 272 /* DefaultClause */; + return kind === 272 /* CaseClause */ + || kind === 273 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 288 /* FirstJSDocNode */ && node.kind <= 310 /* LastJSDocNode */; + return node.kind >= 289 /* FirstJSDocNode */ && node.kind <= 311 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 296 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 297 /* JSDocComment */ || 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 >= 299 /* FirstJSDocTagNode */ && node.kind <= 310 /* LastJSDocTagNode */; + return node.kind >= 300 /* FirstJSDocTagNode */ && node.kind <= 311 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 159 /* SetAccessor */; + return node.kind === 160 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 158 /* GetAccessor */; + return node.kind === 159 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -14901,12 +15027,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 267 /* JsxAttribute */ || node.kind === 269 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 268 /* JsxAttribute */ || node.kind === 270 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 164 /* TypeReference */ || node.kind === 211 /* ExpressionWithTypeArguments */; + return node.kind === 165 /* TypeReference */ || node.kind === 212 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -14942,7 +15068,7 @@ var ts; /* @internal */ (function (ts) { function isNamedImportsOrExports(node) { - return node.kind === 252 /* NamedImports */ || node.kind === 256 /* NamedExports */; + return node.kind === 253 /* NamedImports */ || node.kind === 257 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; function Symbol(flags, name) { @@ -15193,6 +15319,11 @@ var ts; ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !ts.isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); } ts.compilerOptionsAffectSemanticDiagnostics = compilerOptionsAffectSemanticDiagnostics; + function compilerOptionsAffectEmit(newOptions, oldOptions) { + return oldOptions !== newOptions && + ts.affectsEmitOptionDeclarations.some(function (option) { return !ts.isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); + } + ts.compilerOptionsAffectEmit = compilerOptionsAffectEmit; function getCompilerOptionValue(options, option) { return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } @@ -15471,6 +15602,15 @@ var ts; return root + pathComponents.slice(1).join(ts.directorySeparator); } ts.getPathFromPathComponents = getPathFromPathComponents; + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } })(ts || (ts = {})); /* @internal */ (function (ts) { @@ -15501,7 +15641,7 @@ var ts; } ts.getRelativePathFromFile = getRelativePathFromFile; function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - Debug.assert((ts.getRootLength(fromDirectory) > 0) === (ts.getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + ts.Debug.assert((ts.getRootLength(fromDirectory) > 0) === (ts.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); @@ -16145,32 +16285,9 @@ var ts; return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; } ts.changeAnyExtension = changeAnyExtension; - var Debug; - (function (Debug) { - function showSymbol(symbol) { - var symbolFlags = ts.SymbolFlags; - return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + ts.map(symbol.declarations, showSyntaxKind) + " }"; - } - Debug.showSymbol = showSymbol; - function showFlags(flags, flagsEnum) { - var out = []; - for (var pow = 0; pow <= 30; pow++) { - var n = 1 << pow; - if (flags & n) { - out.push(flagsEnum[n]); - } - } - return out.join("|"); - } - function showSyntaxKind(node) { - var syntaxKind = ts.SyntaxKind; - return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); - } - Debug.showSyntaxKind = showSyntaxKind; - })(Debug = ts.Debug || (ts.Debug = {})); function tryParsePattern(pattern) { // This should be verified outside of here and a proper error thrown. - Debug.assert(ts.hasZeroOrOneAsteriskCharacter(pattern)); + ts.Debug.assert(ts.hasZeroOrOneAsteriskCharacter(pattern)); var indexOfStar = pattern.indexOf("*"); return indexOfStar === -1 ? undefined : { prefix: pattern.substr(0, indexOfStar), @@ -16199,7 +16316,7 @@ var ts; */ function extensionFromPath(path) { var ext = tryGetExtensionFromPath(path); - return ext !== undefined ? ext : Debug.fail("File " + path + " has unknown extension."); + return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension."); } ts.extensionFromPath = extensionFromPath; function isAnySupportedFileExtension(path) { @@ -16271,7 +16388,7 @@ var ts; ts.matchPatternOrExact = matchPatternOrExact; function sliceAfter(arr, value) { var index = arr.indexOf(value); - Debug.assert(index !== -1); + ts.Debug.assert(index !== -1); return arr.slice(index); } ts.sliceAfter = sliceAfter; @@ -16289,7 +16406,7 @@ var ts; } ts.addRelatedInfo = addRelatedInfo; function minAndMax(arr, getValue) { - Debug.assert(arr.length !== 0); + ts.Debug.assert(arr.length !== 0); var min = getValue(arr[0]); var max = min; for (var i = 1; i < arr.length; i++) { @@ -16487,10 +16604,10 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 284 /* SourceFile */) { + if (kind === 285 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } - else if (kind === 72 /* Identifier */) { + else if (kind === 73 /* Identifier */) { return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, pos, end); } else if (!ts.isNodeKind(kind)) { @@ -16539,19 +16656,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 <= 147 /* LastToken */) { + if (!node || node.kind <= 148 /* LastToken */) { return; } switch (node.kind) { - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -16559,9 +16676,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 151 /* Parameter */: + case 152 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -16569,7 +16686,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -16577,51 +16694,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 153 /* PropertySignature */: + case 154 /* 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 275 /* PropertyAssignment */: + case 276 /* 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 237 /* VariableDeclaration */: + case 238 /* 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 186 /* BindingElement */: + case 187 /* 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 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* 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 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 198 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -16633,343 +16750,343 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 169 /* ArrayType */: + case 170 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 170 /* TupleType */: + case 171 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 173 /* UnionType */: - case 174 /* IntersectionType */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 176 /* InferType */: + case 177 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 183 /* ImportType */: + case 184 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 177 /* ParenthesizedType */: - case 179 /* TypeOperator */: + case 178 /* ParenthesizedType */: + case 180 /* TypeOperator */: return visitNode(cbNode, node.type); - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 181 /* MappedType */: + case 182 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 182 /* LiteralType */: + case 183 /* LiteralType */: return visitNode(cbNode, node.literal); - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 199 /* TypeOfExpression */: + case 200 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 200 /* VoidExpression */: + case 201 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 212 /* AsExpression */: + case 213 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 214 /* MetaProperty */: + case 215 /* MetaProperty */: return visitNode(cbNode, node.name); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 218 /* Block */: - case 245 /* ModuleBlock */: + case 219 /* Block */: + case 246 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 284 /* SourceFile */: + case 285 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 222 /* IfStatement */: + case 223 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 228 /* ContinueStatement */: - case 229 /* BreakStatement */: + case 229 /* ContinueStatement */: + case 230 /* BreakStatement */: return visitNode(cbNode, node.label); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 271 /* CaseClause */: + case 272 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 272 /* DefaultClause */: + case 273 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 152 /* Decorator */: + case 153 /* Decorator */: return visitNode(cbNode, node.expression); - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* 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 241 /* InterfaceDeclaration */: + case 242 /* 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 242 /* TypeAliasDeclaration */: + case 243 /* 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 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 278 /* EnumMember */: + case 279 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 250 /* ImportClause */: + case 251 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 252 /* NamedImports */: - case 256 /* NamedExports */: + case 253 /* NamedImports */: + case 257 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 259 /* ExternalModuleReference */: + case 260 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 258 /* MissingDeclaration */: + case 259 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 314 /* CommaListExpression */: + case 315 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 260 /* JsxElement */: + case 261 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 261 /* JsxSelfClosingElement */: - case 262 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 269 /* JsxSpreadAttribute */: + case 270 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 263 /* JsxClosingElement */: + case 264 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 171 /* OptionalType */: - case 172 /* RestType */: - case 288 /* JSDocTypeExpression */: - case 292 /* JSDocNonNullableType */: - case 291 /* JSDocNullableType */: - case 293 /* JSDocOptionalType */: - case 295 /* JSDocVariadicType */: + case 172 /* OptionalType */: + case 173 /* RestType */: + case 289 /* JSDocTypeExpression */: + case 293 /* JSDocNonNullableType */: + case 292 /* JSDocNullableType */: + case 294 /* JSDocOptionalType */: + case 296 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 296 /* JSDocComment */: + case 297 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 304 /* JSDocParameterTag */: - case 310 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: + case 311 /* 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 300 /* JSDocAugmentsTag */: + case 301 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 309 /* JSDocTypedefTag */: + case 310 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 288 /* JSDocTypeExpression */ + node.typeExpression.kind === 289 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 302 /* JSDocCallbackTag */: + case 303 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 305 /* JSDocReturnTag */: - case 307 /* JSDocTypeTag */: - case 306 /* JSDocThisTag */: - case 303 /* JSDocEnumTag */: + case 306 /* JSDocReturnTag */: + case 308 /* JSDocTypeTag */: + case 307 /* JSDocThisTag */: + case 304 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 298 /* JSDocSignature */: + case 299 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 297 /* JSDocTypeLiteral */: + case 298 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 299 /* JSDocTag */: - case 301 /* JSDocClassTag */: + case 300 /* JSDocTag */: + case 302 /* JSDocClassTag */: return visitNode(cbNode, node.tagName); - case 313 /* PartiallyEmittedExpression */: + case 314 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -17049,7 +17166,7 @@ var ts; (function (Parser) { // Share a single scanner across all calls to parse a source file. This helps speed things // up by avoiding the cost of creating/compiling scanners over and over again. - var scanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ true); + var scanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ true); var disallowInAndDecoratorContext = 2048 /* DisallowInContext */ | 8192 /* DecoratorContext */; // capture constructors in 'initializeState' to avoid null checks // tslint:disable variable-name @@ -17187,14 +17304,14 @@ var ts; sourceFile.endOfFileToken = parseTokenNode(); } else { - var statement = createNode(221 /* ExpressionStatement */); + var statement = createNode(222 /* ExpressionStatement */); switch (token()) { case 22 /* OpenBracketToken */: statement.expression = parseArrayLiteralExpression(); break; - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 96 /* NullKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 97 /* NullKeyword */: statement.expression = parseTokenNode(); break; case 39 /* MinusToken */: @@ -17343,7 +17460,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(284 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(285 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -17486,6 +17603,9 @@ var ts; function nextToken() { return currentToken = scanner.scan(); } + function nextTokenJSDoc() { + return currentToken = scanner.scanJsDocToken(); + } function reScanGreaterToken() { return currentToken = scanner.reScanGreaterToken(); } @@ -17551,20 +17671,20 @@ var ts; } // Ignore strict mode flag because we will report an error in type checker instead. function isIdentifier() { - if (token() === 72 /* Identifier */) { + if (token() === 73 /* Identifier */) { return true; } // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. - if (token() === 117 /* YieldKeyword */ && inYieldContext()) { + if (token() === 118 /* YieldKeyword */ && inYieldContext()) { return false; } // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is // considered a keyword and is not an identifier. - if (token() === 122 /* AwaitKeyword */ && inAwaitContext()) { + if (token() === 123 /* AwaitKeyword */ && inAwaitContext()) { return false; } - return token() > 108 /* LastReservedWord */; + return token() > 109 /* LastReservedWord */; } function parseExpected(kind, diagnosticMessage, shouldAdvance) { if (shouldAdvance === void 0) { shouldAdvance = true; } @@ -17583,6 +17703,14 @@ var ts; } return false; } + function parseExpectedJSDoc(kind) { + if (token() === kind) { + nextTokenJSDoc(); + return true; + } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind)); + return false; + } function parseOptional(t) { if (token() === t) { nextToken(); @@ -17596,15 +17724,30 @@ var ts; } return undefined; } + function parseOptionalTokenJSDoc(t) { + if (token() === t) { + return parseTokenNodeJSDoc(); + } + return undefined; + } function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } + function parseExpectedTokenJSDoc(t) { + return parseOptionalTokenJSDoc(t) || + createMissingNode(t, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(t)); + } function parseTokenNode() { var node = createNode(token()); nextToken(); return finishNode(node); } + function parseTokenNodeJSDoc() { + var node = createNode(token()); + nextTokenJSDoc(); + return finishNode(node); + } function canParseSemicolon() { // If there's a real semicolon, then we can always parse it out. if (token() === 26 /* SemicolonToken */) { @@ -17629,7 +17772,7 @@ var ts; nodeCount++; var p = pos >= 0 ? pos : scanner.getStartPos(); return ts.isNodeKind(kind) || kind === 0 /* Unknown */ ? new NodeConstructor(kind, p, p) : - kind === 72 /* Identifier */ ? new IdentifierConstructor(kind, p, p) : + kind === 73 /* Identifier */ ? new IdentifierConstructor(kind, p, p) : new TokenConstructor(kind, p, p); } function createNodeWithJSDoc(kind, pos) { @@ -17671,7 +17814,7 @@ var ts; parseErrorAtCurrentToken(diagnosticMessage, arg0); } var result = createNode(kind); - if (kind === 72 /* Identifier */) { + if (kind === 73 /* Identifier */) { result.escapedText = ""; } else if (ts.isLiteralKind(kind) || ts.isTemplateLiteralKind(kind)) { @@ -17692,9 +17835,9 @@ var ts; function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(72 /* Identifier */); + var node = createNode(73 /* Identifier */); // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker - if (token() !== 72 /* Identifier */) { + if (token() !== 73 /* Identifier */) { node.originalKeywordKind = token(); } node.escapedText = ts.escapeLeadingUnderscores(internIdentifier(scanner.getTokenValue())); @@ -17703,7 +17846,7 @@ var ts; } // Only for end of file because the error gets reported incorrectly on embedded script tags. var reportAtCurrentPosition = token() === 1 /* EndOfFileToken */; - return createMissingNode(72 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(73 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -17734,7 +17877,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(149 /* ComputedPropertyName */); + var node = createNode(150 /* ComputedPropertyName */); parseExpected(22 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -17755,20 +17898,20 @@ var ts; } function nextTokenCanFollowModifier() { switch (token()) { - case 77 /* ConstKeyword */: + case 78 /* ConstKeyword */: // 'const' is only a modifier if followed by 'enum'. - return nextToken() === 84 /* EnumKeyword */; - case 85 /* ExportKeyword */: + return nextToken() === 85 /* EnumKeyword */; + case 86 /* ExportKeyword */: nextToken(); - if (token() === 80 /* DefaultKeyword */) { + if (token() === 81 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - return token() !== 40 /* AsteriskToken */ && token() !== 119 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); - case 80 /* DefaultKeyword */: + return token() !== 40 /* AsteriskToken */ && token() !== 120 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); + case 81 /* DefaultKeyword */: return nextTokenCanFollowDefaultKeyword(); - case 116 /* StaticKeyword */: - case 126 /* GetKeyword */: - case 137 /* SetKeyword */: + case 117 /* StaticKeyword */: + case 127 /* GetKeyword */: + case 138 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -17787,10 +17930,10 @@ var ts; } function nextTokenCanFollowDefaultKeyword() { nextToken(); - return token() === 76 /* ClassKeyword */ || token() === 90 /* FunctionKeyword */ || - token() === 110 /* InterfaceKeyword */ || - (token() === 118 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) || - (token() === 121 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); + return token() === 77 /* ClassKeyword */ || token() === 91 /* FunctionKeyword */ || + token() === 111 /* InterfaceKeyword */ || + (token() === 119 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine)) || + (token() === 122 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine)); } // True if positioned at the start of a list element function isListElement(parsingContext, inErrorRecovery) { @@ -17810,7 +17953,7 @@ var ts; // outer module. We just want to consume and move on. return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); case 2 /* SwitchClauses */: - return token() === 74 /* CaseKeyword */ || token() === 80 /* DefaultKeyword */; + return token() === 75 /* CaseKeyword */ || token() === 81 /* DefaultKeyword */; case 4 /* TypeMembers */: return lookAhead(isTypeMemberStart); case 5 /* ClassMembers */: @@ -17896,7 +18039,7 @@ var ts; // extends {} extends // extends {} implements var next = nextToken(); - return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 86 /* ExtendsKeyword */ || next === 109 /* ImplementsKeyword */; + return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 87 /* ExtendsKeyword */ || next === 110 /* ImplementsKeyword */; } return true; } @@ -17913,8 +18056,8 @@ var ts; return ts.tokenIsIdentifierOrKeywordOrGreaterThan(token()); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token() === 109 /* ImplementsKeyword */ || - token() === 86 /* ExtendsKeyword */) { + if (token() === 110 /* ImplementsKeyword */ || + token() === 87 /* ExtendsKeyword */) { return lookAhead(nextTokenIsStartOfExpression); } return false; @@ -17944,14 +18087,14 @@ var ts; case 23 /* ImportOrExportSpecifiers */: return token() === 19 /* CloseBraceToken */; case 3 /* SwitchClauseStatements */: - return token() === 19 /* CloseBraceToken */ || token() === 74 /* CaseKeyword */ || token() === 80 /* DefaultKeyword */; + return token() === 19 /* CloseBraceToken */ || token() === 75 /* CaseKeyword */ || token() === 81 /* DefaultKeyword */; case 7 /* HeritageClauseElement */: - return token() === 18 /* OpenBraceToken */ || token() === 86 /* ExtendsKeyword */ || token() === 109 /* ImplementsKeyword */; + return token() === 18 /* OpenBraceToken */ || token() === 87 /* ExtendsKeyword */ || token() === 110 /* ImplementsKeyword */; case 8 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 19 /* TypeParameters */: // Tokens other than '>' are here for better error recovery - return token() === 30 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 86 /* ExtendsKeyword */ || token() === 109 /* ImplementsKeyword */; + return token() === 30 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 87 /* ExtendsKeyword */ || token() === 110 /* ImplementsKeyword */; case 11 /* ArgumentExpressions */: // Tokens other than ')' are here for better error recovery return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; @@ -18168,20 +18311,20 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 157 /* Constructor */: - case 162 /* IndexSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 154 /* PropertyDeclaration */: - case 217 /* SemicolonClassElement */: + case 158 /* Constructor */: + case 163 /* IndexSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 218 /* SemicolonClassElement */: return true; - case 156 /* MethodDeclaration */: + case 157 /* 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. var methodDeclaration = node; - var nameIsConstructor = methodDeclaration.name.kind === 72 /* Identifier */ && - methodDeclaration.name.originalKeywordKind === 124 /* ConstructorKeyword */; + var nameIsConstructor = methodDeclaration.name.kind === 73 /* Identifier */ && + methodDeclaration.name.originalKeywordKind === 125 /* ConstructorKeyword */; return !nameIsConstructor; } } @@ -18190,8 +18333,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: return true; } } @@ -18200,58 +18343,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 219 /* VariableStatement */: - case 218 /* Block */: - case 222 /* IfStatement */: - case 221 /* ExpressionStatement */: - case 234 /* ThrowStatement */: - case 230 /* ReturnStatement */: - case 232 /* SwitchStatement */: - case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 225 /* ForStatement */: - case 224 /* WhileStatement */: - case 231 /* WithStatement */: - case 220 /* EmptyStatement */: - case 235 /* TryStatement */: - case 233 /* LabeledStatement */: - case 223 /* DoStatement */: - case 236 /* DebuggerStatement */: - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 255 /* ExportDeclaration */: - case 254 /* ExportAssignment */: - case 244 /* ModuleDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 240 /* FunctionDeclaration */: + case 220 /* VariableStatement */: + case 219 /* Block */: + case 223 /* IfStatement */: + case 222 /* ExpressionStatement */: + case 235 /* ThrowStatement */: + case 231 /* ReturnStatement */: + case 233 /* SwitchStatement */: + case 230 /* BreakStatement */: + case 229 /* ContinueStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 226 /* ForStatement */: + case 225 /* WhileStatement */: + case 232 /* WithStatement */: + case 221 /* EmptyStatement */: + case 236 /* TryStatement */: + case 234 /* LabeledStatement */: + case 224 /* DoStatement */: + case 237 /* DebuggerStatement */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 256 /* ExportDeclaration */: + case 255 /* ExportAssignment */: + case 245 /* ModuleDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 278 /* EnumMember */; + return node.kind === 279 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 161 /* ConstructSignature */: - case 155 /* MethodSignature */: - case 162 /* IndexSignature */: - case 153 /* PropertySignature */: - case 160 /* CallSignature */: + case 162 /* ConstructSignature */: + case 156 /* MethodSignature */: + case 163 /* IndexSignature */: + case 154 /* PropertySignature */: + case 161 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 237 /* VariableDeclaration */) { + if (node.kind !== 238 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -18272,7 +18415,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 151 /* Parameter */) { + if (node.kind !== 152 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -18408,7 +18551,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(148 /* QualifiedName */, entity.pos); + var node = createNode(149 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -18439,13 +18582,13 @@ var ts; // Report that we need an identifier. However, report it right after the dot, // and not on the next token. This is because the next token might actually // be an identifier and the error would be quite confusing. - return createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); + return createMissingNode(73 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(206 /* TemplateExpression */); + var template = createNode(207 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -18457,7 +18600,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(216 /* TemplateSpan */); + var span = createNode(217 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 19 /* CloseBraceToken */) { @@ -18507,7 +18650,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(164 /* TypeReference */); + var node = createNode(165 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 28 /* LessThanToken */) { node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 28 /* LessThanToken */, 30 /* GreaterThanToken */); @@ -18517,14 +18660,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 165 /* FunctionType */: - case 166 /* ConstructorType */: { + case 166 /* FunctionType */: + case 167 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 177 /* ParenthesizedType */: + case 178 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -18532,20 +18675,20 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(163 /* TypePredicate */, lhs.pos); + var node = createNode(164 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(178 /* ThisType */); + var node = createNode(179 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType(postFixEquals) { - var result = createNode(289 /* JSDocAllType */); + var result = createNode(290 /* JSDocAllType */); if (postFixEquals) { - return createPostfixType(293 /* JSDocOptionalType */, result); + return createPostfixType(294 /* JSDocOptionalType */, result); } else { nextToken(); @@ -18553,7 +18696,7 @@ var ts; return finishNode(result); } function parseJSDocNonNullableType() { - var result = createNode(292 /* JSDocNonNullableType */); + var result = createNode(293 /* JSDocNonNullableType */); nextToken(); result.type = parseNonArrayType(); return finishNode(result); @@ -18575,31 +18718,31 @@ var ts; token() === 19 /* CloseBraceToken */ || token() === 21 /* CloseParenToken */ || token() === 30 /* GreaterThanToken */ || - token() === 59 /* EqualsToken */ || + token() === 60 /* EqualsToken */ || token() === 50 /* BarToken */) { - var result = createNode(290 /* JSDocUnknownType */, pos); + var result = createNode(291 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(291 /* JSDocNullableType */, pos); + var result = createNode(292 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(294 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(295 /* JSDocFunctionType */); nextToken(); fillSignature(57 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(164 /* TypeReference */); + var node = createNode(165 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(151 /* Parameter */); - if (token() === 100 /* ThisKeyword */ || token() === 95 /* NewKeyword */) { + var parameter = createNode(152 /* Parameter */); + if (token() === 101 /* ThisKeyword */ || token() === 96 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(57 /* ColonToken */); } @@ -18612,25 +18755,25 @@ var ts; var type = parseTypeOrTypePredicate(); scanner.setInJSDocType(false); if (dotdotdot) { - var variadic = createNode(295 /* JSDocVariadicType */, dotdotdot.pos); + var variadic = createNode(296 /* JSDocVariadicType */, dotdotdot.pos); variadic.type = type; type = finishNode(variadic); } - if (token() === 59 /* EqualsToken */) { - return createPostfixType(293 /* JSDocOptionalType */, type); + if (token() === 60 /* EqualsToken */) { + return createPostfixType(294 /* JSDocOptionalType */, type); } return type; } function parseTypeQuery() { - var node = createNode(167 /* TypeQuery */); - parseExpected(104 /* TypeOfKeyword */); + var node = createNode(168 /* TypeQuery */); + parseExpected(105 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(150 /* TypeParameter */); + var node = createNode(151 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(86 /* ExtendsKeyword */)) { + if (parseOptional(87 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the // user writes a constraint that is an expression and not an actual type, then parse // it out as an expression (so we can recover well), but report that a type is needed @@ -18649,7 +18792,7 @@ var ts; node.expression = parseUnaryExpressionOrHigher(); } } - if (parseOptional(59 /* EqualsToken */)) { + if (parseOptional(60 /* EqualsToken */)) { node.default = parseType(); } return finishNode(node); @@ -18673,8 +18816,8 @@ var ts; isStartOfType(/*inStartOfParameter*/ !isJSDocParameter); } function parseParameter() { - var node = createNodeWithJSDoc(151 /* Parameter */); - if (token() === 100 /* ThisKeyword */) { + var node = createNodeWithJSDoc(152 /* Parameter */); + if (token() === 101 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); return finishNode(node); @@ -18774,8 +18917,8 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 161 /* ConstructSignature */) { - parseExpected(95 /* NewKeyword */); + if (kind === 162 /* ConstructSignature */) { + parseExpected(96 /* NewKeyword */); } fillSignature(57 /* ColonToken */, 4 /* Type */, node); parseTypeMemberSemicolon(); @@ -18835,7 +18978,7 @@ var ts; return token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 162 /* IndexSignature */; + node.kind = 163 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -18845,15 +18988,15 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(56 /* QuestionToken */); if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */) { - node.kind = 155 /* MethodSignature */; + node.kind = 156 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(57 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 153 /* PropertySignature */; + node.kind = 154 /* PropertySignature */; node.type = parseTypeAnnotation(); - if (token() === 59 /* EqualsToken */) { + if (token() === 60 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt // to parse an initializer so we can report in the checker that an interface // property or type literal property cannot have an initializer. @@ -18897,10 +19040,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */) { - return parseSignatureMember(160 /* CallSignature */); + return parseSignatureMember(161 /* CallSignature */); } - if (token() === 95 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(161 /* ConstructSignature */); + if (token() === 96 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { + return parseSignatureMember(162 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -18926,7 +19069,7 @@ var ts; return false; } function parseTypeLiteral() { - var node = createNode(168 /* TypeLiteral */); + var node = createNode(169 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -18944,27 +19087,27 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) { - return nextToken() === 133 /* ReadonlyKeyword */; + return nextToken() === 134 /* ReadonlyKeyword */; } - if (token() === 133 /* ReadonlyKeyword */) { + if (token() === 134 /* ReadonlyKeyword */) { nextToken(); } - return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 93 /* InKeyword */; + return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 94 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(150 /* TypeParameter */); + var node = createNode(151 /* TypeParameter */); node.name = parseIdentifier(); - parseExpected(93 /* InKeyword */); + parseExpected(94 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(181 /* MappedType */); + var node = createNode(182 /* MappedType */); parseExpected(18 /* OpenBraceToken */); - if (token() === 133 /* ReadonlyKeyword */ || token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) { + if (token() === 134 /* ReadonlyKeyword */ || token() === 38 /* PlusToken */ || token() === 39 /* MinusToken */) { node.readonlyToken = parseTokenNode(); - if (node.readonlyToken.kind !== 133 /* ReadonlyKeyword */) { - parseExpectedToken(133 /* ReadonlyKeyword */); + if (node.readonlyToken.kind !== 134 /* ReadonlyKeyword */) { + parseExpectedToken(134 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); @@ -18984,23 +19127,23 @@ var ts; function parseTupleElementType() { var pos = getNodePos(); if (parseOptional(25 /* DotDotDotToken */)) { - var node = createNode(172 /* RestType */, pos); + var node = createNode(173 /* RestType */, pos); node.type = parseType(); return finishNode(node); } var type = parseType(); - if (!(contextFlags & 2097152 /* JSDoc */) && type.kind === 291 /* JSDocNullableType */ && type.pos === type.type.pos) { - type.kind = 171 /* OptionalType */; + if (!(contextFlags & 2097152 /* JSDoc */) && type.kind === 292 /* JSDocNullableType */ && type.pos === type.type.pos) { + type.kind = 172 /* OptionalType */; } return type; } function parseTupleType() { - var node = createNode(170 /* TupleType */); + var node = createNode(171 /* TupleType */); node.elementTypes = parseBracketedList(21 /* TupleElementTypes */, parseTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(177 /* ParenthesizedType */); + var node = createNode(178 /* ParenthesizedType */); parseExpected(20 /* OpenParenToken */); node.type = parseType(); parseExpected(21 /* CloseParenToken */); @@ -19008,7 +19151,7 @@ var ts; } function parseFunctionOrConstructorType() { var pos = getNodePos(); - var kind = parseOptional(95 /* NewKeyword */) ? 166 /* ConstructorType */ : 165 /* FunctionType */; + var kind = parseOptional(96 /* NewKeyword */) ? 167 /* ConstructorType */ : 166 /* FunctionType */; var node = createNodeWithJSDoc(kind, pos); fillSignature(37 /* EqualsGreaterThanToken */, 4 /* Type */, node); return finishNode(node); @@ -19018,14 +19161,14 @@ var ts; return token() === 24 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(182 /* LiteralType */); + var node = createNode(183 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(202 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(203 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 39 /* MinusToken */; nextToken(); } - var expression = token() === 102 /* TrueKeyword */ || token() === 87 /* FalseKeyword */ + var expression = token() === 103 /* TrueKeyword */ || token() === 88 /* FalseKeyword */ ? parseTokenNode() : parseLiteralLikeNode(token()); if (negative) { @@ -19038,22 +19181,24 @@ var ts; } function isStartOfTypeOfImportType() { nextToken(); - return token() === 92 /* ImportKeyword */; + return token() === 93 /* ImportKeyword */; } function parseImportType() { sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; - var node = createNode(183 /* ImportType */); - if (parseOptional(104 /* TypeOfKeyword */)) { + var node = createNode(184 /* ImportType */); + if (parseOptional(105 /* TypeOfKeyword */)) { node.isTypeOf = true; } - parseExpected(92 /* ImportKeyword */); + parseExpected(93 /* ImportKeyword */); parseExpected(20 /* OpenParenToken */); node.argument = parseType(); parseExpected(21 /* CloseParenToken */); if (parseOptional(24 /* DotToken */)) { node.qualifier = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); } - node.typeArguments = tryParseTypeArguments(); + if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 28 /* LessThanToken */) { + node.typeArguments = parseBracketedList(20 /* TypeArguments */, parseType, 28 /* LessThanToken */, 30 /* GreaterThanToken */); + } return finishNode(node); } function nextTokenIsNumericOrBigIntLiteral() { @@ -19062,25 +19207,25 @@ var ts; } function parseNonArrayType() { switch (token()) { - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 138 /* StringKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 139 /* SymbolKeyword */: - case 123 /* BooleanKeyword */: - case 141 /* UndefinedKeyword */: - case 132 /* NeverKeyword */: - case 136 /* ObjectKeyword */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 139 /* StringKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 140 /* SymbolKeyword */: + case 124 /* BooleanKeyword */: + case 142 /* UndefinedKeyword */: + case 133 /* NeverKeyword */: + case 137 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 40 /* AsteriskToken */: return parseJSDocAllType(/*postfixEquals*/ false); - case 62 /* AsteriskEqualsToken */: + case 63 /* AsteriskEqualsToken */: return parseJSDocAllType(/*postfixEquals*/ true); case 56 /* QuestionToken */: return parseJSDocUnknownOrNullableType(); - case 90 /* FunctionKeyword */: + case 91 /* FunctionKeyword */: return parseJSDocFunctionType(); case 52 /* ExclamationToken */: return parseJSDocNonNullableType(); @@ -19088,24 +19233,24 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: return parseLiteralTypeNode(); case 39 /* MinusToken */: return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(/*negative*/ true) : parseTypeReference(); - case 106 /* VoidKeyword */: - case 96 /* NullKeyword */: + case 107 /* VoidKeyword */: + case 97 /* NullKeyword */: return parseTokenNode(); - case 100 /* ThisKeyword */: { + case 101 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 128 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 129 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } - case 104 /* TypeOfKeyword */: + case 105 /* TypeOfKeyword */: return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery(); case 18 /* OpenBraceToken */: return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); @@ -19113,7 +19258,7 @@ var ts; return parseTupleType(); case 20 /* OpenParenToken */: return parseParenthesizedType(); - case 92 /* ImportKeyword */: + case 93 /* ImportKeyword */: return parseImportType(); default: return parseTypeReference(); @@ -19121,41 +19266,41 @@ var ts; } function isStartOfType(inStartOfParameter) { switch (token()) { - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 138 /* StringKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 123 /* BooleanKeyword */: - case 133 /* ReadonlyKeyword */: - case 139 /* SymbolKeyword */: - case 142 /* UniqueKeyword */: - case 106 /* VoidKeyword */: - case 141 /* UndefinedKeyword */: - case 96 /* NullKeyword */: - case 100 /* ThisKeyword */: - case 104 /* TypeOfKeyword */: - case 132 /* NeverKeyword */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 139 /* StringKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 124 /* BooleanKeyword */: + case 134 /* ReadonlyKeyword */: + case 140 /* SymbolKeyword */: + case 143 /* UniqueKeyword */: + case 107 /* VoidKeyword */: + case 142 /* UndefinedKeyword */: + case 97 /* NullKeyword */: + case 101 /* ThisKeyword */: + case 105 /* TypeOfKeyword */: + case 133 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 28 /* LessThanToken */: case 50 /* BarToken */: case 49 /* AmpersandToken */: - case 95 /* NewKeyword */: + case 96 /* NewKeyword */: case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 136 /* ObjectKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 137 /* ObjectKeyword */: case 40 /* AsteriskToken */: case 56 /* QuestionToken */: case 52 /* ExclamationToken */: case 25 /* DotDotDotToken */: - case 127 /* InferKeyword */: - case 92 /* ImportKeyword */: + case 128 /* InferKeyword */: + case 93 /* ImportKeyword */: return true; - case 90 /* FunctionKeyword */: + case 91 /* FunctionKeyword */: return !inStartOfParameter; case 39 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral); @@ -19176,26 +19321,26 @@ var ts; while (!scanner.hasPrecedingLineBreak()) { switch (token()) { case 52 /* ExclamationToken */: - type = createPostfixType(292 /* JSDocNonNullableType */, type); + type = createPostfixType(293 /* JSDocNonNullableType */, type); break; case 56 /* QuestionToken */: // If not in JSDoc and next token is start of a type we have a conditional type if (!(contextFlags & 2097152 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { return type; } - type = createPostfixType(291 /* JSDocNullableType */, type); + type = createPostfixType(292 /* JSDocNullableType */, type); break; case 22 /* OpenBracketToken */: parseExpected(22 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(180 /* IndexedAccessType */, type.pos); + var node = createNode(181 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(23 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(169 /* ArrayType */, type.pos); + var node = createNode(170 /* ArrayType */, type.pos); node.elementType = type; parseExpected(23 /* CloseBracketToken */); type = finishNode(node); @@ -19214,16 +19359,16 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(179 /* TypeOperator */); + var node = createNode(180 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } function parseInferType() { - var node = createNode(176 /* InferType */); - parseExpected(127 /* InferKeyword */); - var typeParameter = createNode(150 /* TypeParameter */); + var node = createNode(177 /* InferType */); + parseExpected(128 /* InferKeyword */); + var typeParameter = createNode(151 /* TypeParameter */); typeParameter.name = parseIdentifier(); node.typeParameter = finishNode(typeParameter); return finishNode(node); @@ -19231,34 +19376,35 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 129 /* KeyOfKeyword */: - case 142 /* UniqueKeyword */: - case 133 /* ReadonlyKeyword */: + case 130 /* KeyOfKeyword */: + case 143 /* UniqueKeyword */: + case 134 /* ReadonlyKeyword */: return parseTypeOperator(operator); - case 127 /* InferKeyword */: + case 128 /* InferKeyword */: return parseInferType(); } return parsePostfixTypeOrHigher(); } function parseUnionOrIntersectionType(kind, parseConstituentType, operator) { - parseOptional(operator); + var start = scanner.getStartPos(); + var hasLeadingOperator = parseOptional(operator); var type = parseConstituentType(); - if (token() === operator) { + if (token() === operator || hasLeadingOperator) { var types = [type]; while (parseOptional(operator)) { types.push(parseConstituentType()); } - var node = createNode(kind, type.pos); - node.types = createNodeArray(types, type.pos); + var node = createNode(kind, start); + node.types = createNodeArray(types, start); type = finishNode(node); } return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(174 /* IntersectionType */, parseTypeOperatorOrHigher, 49 /* AmpersandToken */); + return parseUnionOrIntersectionType(175 /* IntersectionType */, parseTypeOperatorOrHigher, 49 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(173 /* UnionType */, parseIntersectionTypeOrHigher, 50 /* BarToken */); + return parseUnionOrIntersectionType(174 /* UnionType */, parseIntersectionTypeOrHigher, 50 /* BarToken */); } function isStartOfFunctionType() { if (token() === 28 /* LessThanToken */) { @@ -19271,7 +19417,7 @@ var ts; // Skip modifiers parseModifiers(); } - if (isIdentifier() || token() === 100 /* ThisKeyword */) { + if (isIdentifier() || token() === 101 /* ThisKeyword */) { nextToken(); return true; } @@ -19294,7 +19440,7 @@ var ts; // We successfully skipped modifiers (if any) and an identifier or binding pattern, // now see if we have something that indicates a parameter declaration if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || - token() === 56 /* QuestionToken */ || token() === 59 /* EqualsToken */) { + token() === 56 /* QuestionToken */ || token() === 60 /* EqualsToken */) { // ( xxx : // ( xxx , // ( xxx ? @@ -19315,7 +19461,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(163 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(164 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -19326,7 +19472,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 128 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 129 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -19337,12 +19483,12 @@ var ts; return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } function parseTypeWorker(noConditionalTypes) { - if (isStartOfFunctionType() || token() === 95 /* NewKeyword */) { + if (isStartOfFunctionType() || token() === 96 /* NewKeyword */) { return parseFunctionOrConstructorType(); } var type = parseUnionTypeOrHigher(); - if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(86 /* ExtendsKeyword */)) { - var node = createNode(175 /* ConditionalType */, type.pos); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(87 /* ExtendsKeyword */)) { + var node = createNode(176 /* ConditionalType */, type.pos); node.checkType = type; // The type following 'extends' is not permitted to be another conditional type node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); @@ -19360,11 +19506,11 @@ var ts; // EXPRESSIONS function isStartOfLeftHandSideExpression() { switch (token()) { - case 100 /* ThisKeyword */: - case 98 /* SuperKeyword */: - case 96 /* NullKeyword */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 101 /* ThisKeyword */: + case 99 /* SuperKeyword */: + case 97 /* NullKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: @@ -19373,14 +19519,14 @@ var ts; case 20 /* OpenParenToken */: case 22 /* OpenBracketToken */: case 18 /* OpenBraceToken */: - case 90 /* FunctionKeyword */: - case 76 /* ClassKeyword */: - case 95 /* NewKeyword */: + case 91 /* FunctionKeyword */: + case 77 /* ClassKeyword */: + case 96 /* NewKeyword */: case 42 /* SlashToken */: - case 64 /* SlashEqualsToken */: - case 72 /* Identifier */: + case 65 /* SlashEqualsToken */: + case 73 /* Identifier */: return true; - case 92 /* ImportKeyword */: + case 93 /* ImportKeyword */: return lookAhead(nextTokenIsOpenParenOrLessThanOrDot); default: return isIdentifier(); @@ -19395,14 +19541,14 @@ var ts; case 39 /* MinusToken */: case 53 /* TildeToken */: case 52 /* ExclamationToken */: - case 81 /* DeleteKeyword */: - case 104 /* TypeOfKeyword */: - case 106 /* VoidKeyword */: + case 82 /* DeleteKeyword */: + case 105 /* TypeOfKeyword */: + case 107 /* VoidKeyword */: case 44 /* PlusPlusToken */: case 45 /* MinusMinusToken */: case 28 /* LessThanToken */: - case 122 /* AwaitKeyword */: - case 117 /* YieldKeyword */: + case 123 /* AwaitKeyword */: + case 118 /* YieldKeyword */: // Yield/await always starts an expression. Either it is an identifier (in which case // it is definitely an expression). Or it's a keyword (either because we're in // a generator or async function, or in strict mode (or both)) and it started a yield or await expression. @@ -19421,8 +19567,8 @@ var ts; function isStartOfExpressionStatement() { // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. return token() !== 18 /* OpenBraceToken */ && - token() !== 90 /* FunctionKeyword */ && - token() !== 76 /* ClassKeyword */ && + token() !== 91 /* FunctionKeyword */ && + token() !== 77 /* ClassKeyword */ && token() !== 58 /* AtToken */ && isStartOfExpression(); } @@ -19446,7 +19592,7 @@ var ts; return expr; } function parseInitializer() { - return parseOptional(59 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined; + return parseOptional(60 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined; } function parseAssignmentExpressionOrHigher() { // AssignmentExpression[in,yield]: @@ -19491,7 +19637,7 @@ var ts; // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single // identifier and the current token is an arrow. - if (expr.kind === 72 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) { + if (expr.kind === 73 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } // Now see if we might be in cases '2' or '3'. @@ -19507,7 +19653,7 @@ var ts; return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token() === 117 /* YieldKeyword */) { + if (token() === 118 /* YieldKeyword */) { // If we have a 'yield' keyword, and this is a context where yield expressions are // allowed, then definitely parse out a yield expression. if (inYieldContext()) { @@ -19536,7 +19682,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(207 /* YieldExpression */); + var node = createNode(208 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -19558,13 +19704,13 @@ var ts; ts.Debug.assert(token() === 37 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(197 /* ArrowFunction */, asyncModifier.pos); + node = createNode(198 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(197 /* ArrowFunction */, identifier.pos); + node = createNode(198 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(151 /* Parameter */, identifier.pos); + var parameter = createNode(152 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); @@ -19604,7 +19750,7 @@ var ts; // Unknown -> There *might* be a parenthesized arrow function here. // Speculatively look ahead to be sure, and rollback if not. function isParenthesizedArrowFunctionExpression() { - if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */ || token() === 121 /* AsyncKeyword */) { + if (token() === 20 /* OpenParenToken */ || token() === 28 /* LessThanToken */ || token() === 122 /* AsyncKeyword */) { return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } if (token() === 37 /* EqualsGreaterThanToken */) { @@ -19617,7 +19763,7 @@ var ts; return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { - if (token() === 121 /* AsyncKeyword */) { + if (token() === 122 /* AsyncKeyword */) { nextToken(); if (scanner.hasPrecedingLineBreak()) { return 0 /* False */; @@ -19661,13 +19807,13 @@ var ts; // Check for "(xxx yyy", where xxx is a modifier and yyy is an identifier. This // isn't actually allowed, but we want to treat it as a lambda so we can provide // a good error message. - if (ts.isModifierKind(second) && second !== 121 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { + if (ts.isModifierKind(second) && second !== 122 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { return 1 /* True */; } // If we had "(" followed by something that's not an identifier, // then this definitely doesn't look like a lambda. "this" is not // valid, but we want to parse it and then give a semantic error. - if (!isIdentifier() && second !== 100 /* ThisKeyword */) { + if (!isIdentifier() && second !== 101 /* ThisKeyword */) { return 0 /* False */; } switch (nextToken()) { @@ -19678,13 +19824,13 @@ var ts; case 56 /* QuestionToken */: nextToken(); // If we have "(a?:" or "(a?," or "(a?=" or "(a?)" then it is definitely a lambda. - if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 59 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { + if (token() === 57 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 60 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { return 1 /* True */; } // Otherwise it is definitely not a lambda. return 0 /* False */; case 27 /* CommaToken */: - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: case 21 /* CloseParenToken */: // If we have "(a," or "(a=" or "(a)" this *could* be an arrow function return 2 /* Unknown */; @@ -19703,10 +19849,10 @@ var ts; if (sourceFile.languageVariant === 1 /* JSX */) { var isArrowFunctionInJsx = lookAhead(function () { var third = nextToken(); - if (third === 86 /* ExtendsKeyword */) { + if (third === 87 /* ExtendsKeyword */) { var fourth = nextToken(); switch (fourth) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: case 30 /* GreaterThanToken */: return false; default: @@ -19732,7 +19878,7 @@ var ts; } function tryParseAsyncSimpleArrowFunctionExpression() { // We do a check here so that we won't be doing unnecessarily call to "lookAhead" - if (token() === 121 /* AsyncKeyword */) { + if (token() === 122 /* AsyncKeyword */) { if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) { var asyncModifier = parseModifiersForArrowFunction(); var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0); @@ -19745,7 +19891,7 @@ var ts; // AsyncArrowFunctionExpression: // 1) async[no LineTerminator here]AsyncArrowBindingIdentifier[?Yield][no LineTerminator here]=>AsyncConciseBody[?In] // 2) CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await][no LineTerminator here]=>AsyncConciseBody[?In] - if (token() === 121 /* AsyncKeyword */) { + if (token() === 122 /* AsyncKeyword */) { nextToken(); // If the "async" is followed by "=>" token then it is not a beginning of an async arrow-function // but instead a simple arrow-function which will be parsed inside "parseAssignmentExpressionOrHigher" @@ -19754,14 +19900,14 @@ var ts; } // Check for un-parenthesized AsyncArrowFunction var expr = parseBinaryExpressionOrHigher(/*precedence*/ 0); - if (!scanner.hasPrecedingLineBreak() && expr.kind === 72 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) { + if (!scanner.hasPrecedingLineBreak() && expr.kind === 73 /* Identifier */ && token() === 37 /* EqualsGreaterThanToken */) { return 1 /* True */; } } return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(197 /* ArrowFunction */); + var node = createNodeWithJSDoc(198 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -19780,9 +19926,11 @@ var ts; // - "(x = 10)" is an assignment expression parsed as a signature with a default parameter value. // - "(x,y)" is a comma expression parsed as a signature with two parameters. // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation. + // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type. // // So we need just a bit of lookahead to ensure that it can only be a signature. - if (!allowAmbiguity && token() !== 37 /* EqualsGreaterThanToken */ && token() !== 18 /* OpenBraceToken */) { + var hasJSDocFunctionType = node.type && ts.isJSDocFunctionType(node.type); + if (!allowAmbiguity && token() !== 37 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) { // Returning undefined here will cause our caller to rewind to where we started from. return undefined; } @@ -19793,8 +19941,8 @@ var ts; return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */); } if (token() !== 26 /* SemicolonToken */ && - token() !== 90 /* FunctionKeyword */ && - token() !== 76 /* ClassKeyword */ && + token() !== 91 /* FunctionKeyword */ && + token() !== 77 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) { // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations) @@ -19825,14 +19973,14 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(205 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(206 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(57 /* ColonToken */); node.whenFalse = ts.nodeIsPresent(node.colonToken) ? parseAssignmentExpressionOrHigher() - : createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(57 /* ColonToken */)); + : createMissingNode(73 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(57 /* ColonToken */)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -19840,7 +19988,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 93 /* InKeyword */ || t === 147 /* OfKeyword */; + return t === 94 /* InKeyword */ || t === 148 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -19875,10 +20023,10 @@ var ts; if (!consumeCurrentOperator) { break; } - if (token() === 93 /* InKeyword */ && inDisallowInContext()) { + if (token() === 94 /* InKeyword */ && inDisallowInContext()) { break; } - if (token() === 119 /* AsKeyword */) { + if (token() === 120 /* AsKeyword */) { // Make sure we *do* perform ASI for constructs like this: // var x = foo // as (Bar) @@ -19899,51 +20047,51 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token() === 93 /* InKeyword */) { + if (inDisallowInContext() && token() === 94 /* InKeyword */) { return false; } return ts.getBinaryOperatorPrecedence(token()) > 0; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(204 /* BinaryExpression */, left.pos); + var node = createNode(205 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(212 /* AsExpression */, left.pos); + var node = createNode(213 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(202 /* PrefixUnaryExpression */); + var node = createNode(203 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(198 /* DeleteExpression */); + var node = createNode(199 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(199 /* TypeOfExpression */); + var node = createNode(200 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(200 /* VoidExpression */); + var node = createNode(201 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function isAwaitExpression() { - if (token() === 122 /* AwaitKeyword */) { + if (token() === 123 /* AwaitKeyword */) { if (inAwaitContext()) { return true; } @@ -19953,7 +20101,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(201 /* AwaitExpression */); + var node = createNode(202 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -19997,7 +20145,7 @@ var ts; if (token() === 41 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 194 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 195 /* 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 { @@ -20027,18 +20175,18 @@ var ts; case 53 /* TildeToken */: case 52 /* ExclamationToken */: return parsePrefixUnaryExpression(); - case 81 /* DeleteKeyword */: + case 82 /* DeleteKeyword */: return parseDeleteExpression(); - case 104 /* TypeOfKeyword */: + case 105 /* TypeOfKeyword */: return parseTypeOfExpression(); - case 106 /* VoidKeyword */: + case 107 /* VoidKeyword */: return parseVoidExpression(); case 28 /* LessThanToken */: // This is modified UnaryExpression grammar in TypeScript // UnaryExpression (modified): // < type > UnaryExpression return parseTypeAssertion(); - case 122 /* AwaitKeyword */: + case 123 /* AwaitKeyword */: if (isAwaitExpression()) { return parseAwaitExpression(); } @@ -20065,10 +20213,10 @@ var ts; case 39 /* MinusToken */: case 53 /* TildeToken */: case 52 /* ExclamationToken */: - case 81 /* DeleteKeyword */: - case 104 /* TypeOfKeyword */: - case 106 /* VoidKeyword */: - case 122 /* AwaitKeyword */: + case 82 /* DeleteKeyword */: + case 105 /* TypeOfKeyword */: + case 107 /* VoidKeyword */: + case 123 /* AwaitKeyword */: return false; case 28 /* LessThanToken */: // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression @@ -20094,7 +20242,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 44 /* PlusPlusToken */ || token() === 45 /* MinusMinusToken */) { - var node = createNode(202 /* PrefixUnaryExpression */); + var node = createNode(203 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -20107,7 +20255,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 44 /* PlusPlusToken */ || token() === 45 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(203 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(204 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -20148,7 +20296,7 @@ var ts; // 3)we have a MemberExpression which either completes the LeftHandSideExpression, // or starts the beginning of the first four CallExpression productions. var expression; - if (token() === 92 /* ImportKeyword */) { + if (token() === 93 /* ImportKeyword */) { if (lookAhead(nextTokenIsOpenParenOrLessThan)) { // We don't want to eagerly consume all import keyword as import call expression so we look ahead to find "(" // For example: @@ -20163,8 +20311,8 @@ var ts; var fullStart = scanner.getStartPos(); nextToken(); // advance past the 'import' nextToken(); // advance past the dot - var node = createNode(214 /* MetaProperty */, fullStart); - node.keywordToken = 92 /* ImportKeyword */; + var node = createNode(215 /* MetaProperty */, fullStart); + node.keywordToken = 93 /* ImportKeyword */; node.name = parseIdentifierName(); expression = finishNode(node); sourceFile.flags |= 1048576 /* PossiblyContainsImportMeta */; @@ -20174,7 +20322,7 @@ var ts; } } else { - expression = token() === 98 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); + expression = token() === 99 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); } // Now, we *may* be complete. However, we might have consumed the start of a // CallExpression. As such, we need to consume the rest of it here to be complete. @@ -20233,12 +20381,19 @@ var ts; } function parseSuperExpression() { var expression = parseTokenNode(); + if (token() === 28 /* LessThanToken */) { + var startPos = getNodePos(); + var typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments !== undefined) { + parseErrorAt(startPos, getNodePos(), ts.Diagnostics.super_may_not_use_type_arguments); + } + } if (token() === 20 /* OpenParenToken */ || token() === 24 /* DotToken */ || token() === 22 /* OpenBracketToken */) { return expression; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(189 /* PropertyAccessExpression */, expression.pos); + var node = createNode(190 /* PropertyAccessExpression */, expression.pos); node.expression = expression; parseExpectedToken(24 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); @@ -20247,8 +20402,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 262 /* JsxOpeningElement */) { - var node = createNode(260 /* JsxElement */, opening.pos); + if (opening.kind === 263 /* JsxOpeningElement */) { + var node = createNode(261 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -20257,15 +20412,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 265 /* JsxOpeningFragment */) { - var node = createNode(264 /* JsxFragment */, opening.pos); + else if (opening.kind === 266 /* JsxOpeningFragment */) { + var node = createNode(265 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 261 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 262 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -20280,11 +20435,11 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(204 /* BinaryExpression */, result.pos); + var badNode = createNode(205 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; - badNode.operatorToken = createMissingNode(27 /* CommaToken */, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); // TODO: GH#18217 + badNode.operatorToken = createMissingNode(27 /* CommaToken */, /*reportAtCurrentPosition*/ false); badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos; return badNode; } @@ -20339,7 +20494,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(268 /* JsxAttributes */); + var jsxAttributes = createNode(269 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -20348,7 +20503,7 @@ var ts; parseExpected(28 /* LessThanToken */); if (token() === 30 /* GreaterThanToken */) { // See below for explanation of scanJsxText - var node_1 = createNode(265 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(266 /* JsxOpeningFragment */, fullStart); scanJsxText(); return finishNode(node_1); } @@ -20360,7 +20515,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(262 /* JsxOpeningElement */, fullStart); + node = createNode(263 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -20372,7 +20527,7 @@ var ts; parseExpected(30 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(261 /* JsxSelfClosingElement */, fullStart); + node = createNode(262 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.typeArguments = typeArguments; @@ -20386,10 +20541,10 @@ var ts; // primaryExpression in the form of an identifier and "this" keyword // We can't just simply use parseLeftHandSideExpressionOrHigher because then we will start consider class,function etc as a keyword // We only want to consider "this" as a primaryExpression - var expression = token() === 100 /* ThisKeyword */ ? + var expression = token() === 101 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var propertyAccess = createNode(189 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(190 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -20397,7 +20552,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(270 /* JsxExpression */); + var node = createNode(271 /* JsxExpression */); if (!parseExpected(18 /* OpenBraceToken */)) { return undefined; } @@ -20419,9 +20574,9 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(267 /* JsxAttribute */); + var node = createNode(268 /* JsxAttribute */); node.name = parseIdentifierName(); - if (token() === 59 /* EqualsToken */) { + if (token() === 60 /* EqualsToken */) { switch (scanJsxAttributeValue()) { case 10 /* StringLiteral */: node.initializer = parseLiteralNode(); @@ -20434,7 +20589,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(269 /* JsxSpreadAttribute */); + var node = createNode(270 /* JsxSpreadAttribute */); parseExpected(18 /* OpenBraceToken */); parseExpected(25 /* DotDotDotToken */); node.expression = parseExpression(); @@ -20442,7 +20597,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(263 /* JsxClosingElement */); + var node = createNode(264 /* JsxClosingElement */); parseExpected(29 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -20455,7 +20610,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(266 /* JsxClosingFragment */); + var node = createNode(267 /* JsxClosingFragment */); parseExpected(29 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); @@ -20470,7 +20625,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(194 /* TypeAssertionExpression */); + var node = createNode(195 /* TypeAssertionExpression */); parseExpected(28 /* LessThanToken */); node.type = parseType(); parseExpected(30 /* GreaterThanToken */); @@ -20481,7 +20636,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(24 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(189 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(190 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -20489,17 +20644,17 @@ var ts; } if (token() === 52 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(213 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(214 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(22 /* OpenBracketToken */)) { - var indexedAccess = createNode(190 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(191 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; if (token() === 23 /* CloseBracketToken */) { - indexedAccess.argumentExpression = createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument); + indexedAccess.argumentExpression = createMissingNode(73 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.An_element_access_expression_should_take_an_argument); } else { var argument = allowInAnd(parseExpression); @@ -20523,7 +20678,7 @@ var ts; return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; } function parseTaggedTemplateRest(tag, typeArguments) { - var tagExpression = createNode(193 /* TaggedTemplateExpression */, tag.pos); + var tagExpression = createNode(194 /* TaggedTemplateExpression */, tag.pos); tagExpression.tag = tag; tagExpression.typeArguments = typeArguments; tagExpression.template = token() === 14 /* NoSubstitutionTemplateLiteral */ @@ -20548,7 +20703,7 @@ var ts; expression = parseTaggedTemplateRest(expression, typeArguments); continue; } - var callExpr = createNode(191 /* CallExpression */, expression.pos); + var callExpr = createNode(192 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -20556,7 +20711,7 @@ var ts; continue; } else if (token() === 20 /* OpenParenToken */) { - var callExpr = createNode(191 /* CallExpression */, expression.pos); + var callExpr = createNode(192 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -20632,11 +20787,11 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 100 /* ThisKeyword */: - case 98 /* SuperKeyword */: - case 96 /* NullKeyword */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 101 /* ThisKeyword */: + case 99 /* SuperKeyword */: + case 97 /* NullKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: return parseTokenNode(); case 20 /* OpenParenToken */: return parseParenthesizedExpression(); @@ -20644,7 +20799,7 @@ var ts; return parseArrayLiteralExpression(); case 18 /* OpenBraceToken */: return parseObjectLiteralExpression(); - case 121 /* AsyncKeyword */: + case 122 /* AsyncKeyword */: // Async arrow functions are parsed earlier in parseAssignmentExpressionOrHigher. // If we encounter `async [no LineTerminator here] function` then this is an async // function; otherwise, its an identifier. @@ -20652,14 +20807,14 @@ var ts; break; } return parseFunctionExpression(); - case 76 /* ClassKeyword */: + case 77 /* ClassKeyword */: return parseClassExpression(); - case 90 /* FunctionKeyword */: + case 91 /* FunctionKeyword */: return parseFunctionExpression(); - case 95 /* NewKeyword */: + case 96 /* NewKeyword */: return parseNewExpressionOrNewDotTarget(); case 42 /* SlashToken */: - case 64 /* SlashEqualsToken */: + case 65 /* SlashEqualsToken */: if (reScanSlashToken() === 13 /* RegularExpressionLiteral */) { return parseLiteralNode(); } @@ -20670,28 +20825,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(195 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(196 /* ParenthesizedExpression */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(208 /* SpreadElement */); + var node = createNode(209 /* SpreadElement */); parseExpected(25 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 27 /* CommaToken */ ? createNode(210 /* OmittedExpression */) : + token() === 27 /* CommaToken */ ? createNode(211 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(187 /* ArrayLiteralExpression */); + var node = createNode(188 /* ArrayLiteralExpression */); parseExpected(22 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -20703,17 +20858,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(25 /* DotDotDotToken */)) { - node.kind = 277 /* SpreadAssignment */; + node.kind = 278 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); - if (parseContextualModifier(126 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 158 /* GetAccessor */); + if (parseContextualModifier(127 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 159 /* GetAccessor */); } - if (parseContextualModifier(137 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 159 /* SetAccessor */); + if (parseContextualModifier(138 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 160 /* SetAccessor */); } var asteriskToken = parseOptionalToken(40 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -20731,22 +20886,22 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 57 /* ColonToken */); if (isShorthandPropertyAssignment) { - node.kind = 276 /* ShorthandPropertyAssignment */; - var equalsToken = parseOptionalToken(59 /* EqualsToken */); + node.kind = 277 /* ShorthandPropertyAssignment */; + var equalsToken = parseOptionalToken(60 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; node.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher); } } else { - node.kind = 275 /* PropertyAssignment */; + node.kind = 276 /* PropertyAssignment */; parseExpected(57 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(188 /* ObjectLiteralExpression */); + var node = createNode(189 /* ObjectLiteralExpression */); parseExpected(18 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -20765,9 +20920,9 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(196 /* FunctionExpression */); + var node = createNodeWithJSDoc(197 /* FunctionExpression */); node.modifiers = parseModifiers(); - parseExpected(90 /* FunctionKeyword */); + parseExpected(91 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(40 /* AsteriskToken */); var isGenerator = node.asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -20788,10 +20943,10 @@ var ts; } function parseNewExpressionOrNewDotTarget() { var fullStart = scanner.getStartPos(); - parseExpected(95 /* NewKeyword */); + parseExpected(96 /* NewKeyword */); if (parseOptional(24 /* DotToken */)) { - var node_2 = createNode(214 /* MetaProperty */, fullStart); - node_2.keywordToken = 95 /* NewKeyword */; + var node_2 = createNode(215 /* MetaProperty */, fullStart); + node_2.keywordToken = 96 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } @@ -20807,7 +20962,7 @@ var ts; } break; } - var node = createNode(192 /* NewExpression */, fullStart); + var node = createNode(193 /* NewExpression */, fullStart); node.expression = expression; node.typeArguments = typeArguments; if (node.typeArguments || token() === 20 /* OpenParenToken */) { @@ -20817,7 +20972,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(218 /* Block */); + var node = createNode(219 /* Block */); if (parseExpected(18 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -20850,25 +21005,25 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(220 /* EmptyStatement */); + var node = createNode(221 /* EmptyStatement */); parseExpected(26 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(222 /* IfStatement */); - parseExpected(91 /* IfKeyword */); + var node = createNode(223 /* IfStatement */); + parseExpected(92 /* IfKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(83 /* ElseKeyword */) ? parseStatement() : undefined; + node.elseStatement = parseOptional(84 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(223 /* DoStatement */); - parseExpected(82 /* DoKeyword */); + var node = createNode(224 /* DoStatement */); + parseExpected(83 /* DoKeyword */); node.statement = parseStatement(); - parseExpected(107 /* WhileKeyword */); + parseExpected(108 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -20880,8 +21035,8 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(224 /* WhileStatement */); - parseExpected(107 /* WhileKeyword */); + var node = createNode(225 /* WhileStatement */); + parseExpected(108 /* WhileKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -20890,12 +21045,12 @@ var ts; } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(89 /* ForKeyword */); - var awaitToken = parseOptionalToken(122 /* AwaitKeyword */); + parseExpected(90 /* ForKeyword */); + var awaitToken = parseOptionalToken(123 /* AwaitKeyword */); parseExpected(20 /* OpenParenToken */); var initializer; if (token() !== 26 /* SemicolonToken */) { - if (token() === 105 /* VarKeyword */ || token() === 111 /* LetKeyword */ || token() === 77 /* ConstKeyword */) { + if (token() === 106 /* VarKeyword */ || token() === 112 /* LetKeyword */ || token() === 78 /* ConstKeyword */) { initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true); } else { @@ -20903,23 +21058,23 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(147 /* OfKeyword */) : parseOptional(147 /* OfKeyword */)) { - var forOfStatement = createNode(227 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(148 /* OfKeyword */) : parseOptional(148 /* OfKeyword */)) { + var forOfStatement = createNode(228 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } - else if (parseOptional(93 /* InKeyword */)) { - var forInStatement = createNode(226 /* ForInStatement */, pos); + else if (parseOptional(94 /* InKeyword */)) { + var forInStatement = createNode(227 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(225 /* ForStatement */, pos); + var forStatement = createNode(226 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(26 /* SemicolonToken */); if (token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */) { @@ -20937,7 +21092,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 229 /* BreakStatement */ ? 73 /* BreakKeyword */ : 78 /* ContinueKeyword */); + parseExpected(kind === 230 /* BreakStatement */ ? 74 /* BreakKeyword */ : 79 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -20945,8 +21100,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(230 /* ReturnStatement */); - parseExpected(97 /* ReturnKeyword */); + var node = createNode(231 /* ReturnStatement */); + parseExpected(98 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -20954,8 +21109,8 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(231 /* WithStatement */); - parseExpected(108 /* WithKeyword */); + var node = createNode(232 /* WithStatement */); + parseExpected(109 /* WithKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); @@ -20963,30 +21118,30 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(271 /* CaseClause */); - parseExpected(74 /* CaseKeyword */); + var node = createNode(272 /* CaseClause */); + parseExpected(75 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(57 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(272 /* DefaultClause */); - parseExpected(80 /* DefaultKeyword */); + var node = createNode(273 /* DefaultClause */); + parseExpected(81 /* DefaultKeyword */); parseExpected(57 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token() === 74 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token() === 75 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(232 /* SwitchStatement */); - parseExpected(99 /* SwitchKeyword */); + var node = createNode(233 /* SwitchStatement */); + parseExpected(100 /* SwitchKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(21 /* CloseParenToken */); - var caseBlock = createNode(246 /* CaseBlock */); + var caseBlock = createNode(247 /* CaseBlock */); parseExpected(18 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(19 /* CloseBraceToken */); @@ -21001,29 +21156,29 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(234 /* ThrowStatement */); - parseExpected(101 /* ThrowKeyword */); + var node = createNode(235 /* ThrowStatement */); + parseExpected(102 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(235 /* TryStatement */); - parseExpected(103 /* TryKeyword */); + var node = createNode(236 /* TryStatement */); + parseExpected(104 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); - node.catchClause = token() === 75 /* CatchKeyword */ ? parseCatchClause() : undefined; + node.catchClause = token() === 76 /* CatchKeyword */ ? parseCatchClause() : undefined; // If we don't have a catch clause, then we must have a finally clause. Try to parse // one out no matter what. - if (!node.catchClause || token() === 88 /* FinallyKeyword */) { - parseExpected(88 /* FinallyKeyword */); + if (!node.catchClause || token() === 89 /* FinallyKeyword */) { + parseExpected(89 /* FinallyKeyword */); node.finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(274 /* CatchClause */); - parseExpected(75 /* CatchKeyword */); + var result = createNode(275 /* CatchClause */); + parseExpected(76 /* CatchKeyword */); if (parseOptional(20 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); parseExpected(21 /* CloseParenToken */); @@ -21036,8 +21191,8 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(236 /* DebuggerStatement */); - parseExpected(79 /* DebuggerKeyword */); + var node = createNode(237 /* DebuggerStatement */); + parseExpected(80 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } @@ -21047,13 +21202,13 @@ var ts; // a colon. var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); - if (expression.kind === 72 /* Identifier */ && parseOptional(57 /* ColonToken */)) { - node.kind = 233 /* LabeledStatement */; + if (expression.kind === 73 /* Identifier */ && parseOptional(57 /* ColonToken */)) { + node.kind = 234 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 221 /* ExpressionStatement */; + node.kind = 222 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -21065,11 +21220,11 @@ var ts; } function nextTokenIsClassKeywordOnSameLine() { nextToken(); - return token() === 76 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); + return token() === 77 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); } function nextTokenIsFunctionKeywordOnSameLine() { nextToken(); - return token() === 90 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); + return token() === 91 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); } function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() { nextToken(); @@ -21078,12 +21233,12 @@ var ts; function isDeclaration() { while (true) { switch (token()) { - case 105 /* VarKeyword */: - case 111 /* LetKeyword */: - case 77 /* ConstKeyword */: - case 90 /* FunctionKeyword */: - case 76 /* ClassKeyword */: - case 84 /* EnumKeyword */: + case 106 /* VarKeyword */: + case 112 /* LetKeyword */: + case 78 /* ConstKeyword */: + case 91 /* FunctionKeyword */: + case 77 /* ClassKeyword */: + case 85 /* EnumKeyword */: return true; // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers; // however, an identifier cannot be followed by another identifier on the same line. This is what we @@ -21106,41 +21261,41 @@ var ts; // I {} // // could be legal, it would add complexity for very little gain. - case 110 /* InterfaceKeyword */: - case 140 /* TypeKeyword */: + case 111 /* InterfaceKeyword */: + case 141 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 130 /* ModuleKeyword */: - case 131 /* NamespaceKeyword */: + case 131 /* ModuleKeyword */: + case 132 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); - case 118 /* AbstractKeyword */: - case 121 /* AsyncKeyword */: - case 125 /* DeclareKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 115 /* PublicKeyword */: - case 133 /* ReadonlyKeyword */: + case 119 /* AbstractKeyword */: + case 122 /* AsyncKeyword */: + case 126 /* DeclareKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 116 /* PublicKeyword */: + case 134 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 145 /* GlobalKeyword */: + case 146 /* GlobalKeyword */: nextToken(); - return token() === 18 /* OpenBraceToken */ || token() === 72 /* Identifier */ || token() === 85 /* ExportKeyword */; - case 92 /* ImportKeyword */: + return token() === 18 /* OpenBraceToken */ || token() === 73 /* Identifier */ || token() === 86 /* ExportKeyword */; + case 93 /* ImportKeyword */: nextToken(); return token() === 10 /* StringLiteral */ || token() === 40 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); - case 85 /* ExportKeyword */: + case 86 /* ExportKeyword */: nextToken(); - if (token() === 59 /* EqualsToken */ || token() === 40 /* AsteriskToken */ || - token() === 18 /* OpenBraceToken */ || token() === 80 /* DefaultKeyword */ || - token() === 119 /* AsKeyword */) { + if (token() === 60 /* EqualsToken */ || token() === 40 /* AsteriskToken */ || + token() === 18 /* OpenBraceToken */ || token() === 81 /* DefaultKeyword */ || + token() === 120 /* AsKeyword */) { return true; } continue; - case 116 /* StaticKeyword */: + case 117 /* StaticKeyword */: nextToken(); continue; default: @@ -21156,47 +21311,47 @@ var ts; case 58 /* AtToken */: case 26 /* SemicolonToken */: case 18 /* OpenBraceToken */: - case 105 /* VarKeyword */: - case 111 /* LetKeyword */: - case 90 /* FunctionKeyword */: - case 76 /* ClassKeyword */: - case 84 /* EnumKeyword */: - case 91 /* IfKeyword */: - case 82 /* DoKeyword */: - case 107 /* WhileKeyword */: - case 89 /* ForKeyword */: - case 78 /* ContinueKeyword */: - case 73 /* BreakKeyword */: - case 97 /* ReturnKeyword */: - case 108 /* WithKeyword */: - case 99 /* SwitchKeyword */: - case 101 /* ThrowKeyword */: - case 103 /* TryKeyword */: - case 79 /* DebuggerKeyword */: + case 106 /* VarKeyword */: + case 112 /* LetKeyword */: + case 91 /* FunctionKeyword */: + case 77 /* ClassKeyword */: + case 85 /* EnumKeyword */: + case 92 /* IfKeyword */: + case 83 /* DoKeyword */: + case 108 /* WhileKeyword */: + case 90 /* ForKeyword */: + case 79 /* ContinueKeyword */: + case 74 /* BreakKeyword */: + case 98 /* ReturnKeyword */: + case 109 /* WithKeyword */: + case 100 /* SwitchKeyword */: + case 102 /* ThrowKeyword */: + case 104 /* TryKeyword */: + case 80 /* DebuggerKeyword */: // 'catch' and 'finally' do not actually indicate that the code is part of a statement, // however, we say they are here so that we may gracefully parse them and error later. - case 75 /* CatchKeyword */: - case 88 /* FinallyKeyword */: + case 76 /* CatchKeyword */: + case 89 /* FinallyKeyword */: return true; - case 92 /* ImportKeyword */: + case 93 /* ImportKeyword */: return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot); - case 77 /* ConstKeyword */: - case 85 /* ExportKeyword */: + case 78 /* ConstKeyword */: + case 86 /* ExportKeyword */: return isStartOfDeclaration(); - case 121 /* AsyncKeyword */: - case 125 /* DeclareKeyword */: - case 110 /* InterfaceKeyword */: - case 130 /* ModuleKeyword */: - case 131 /* NamespaceKeyword */: - case 140 /* TypeKeyword */: - case 145 /* GlobalKeyword */: + case 122 /* AsyncKeyword */: + case 126 /* DeclareKeyword */: + case 111 /* InterfaceKeyword */: + case 131 /* ModuleKeyword */: + case 132 /* NamespaceKeyword */: + case 141 /* TypeKeyword */: + case 146 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 116 /* StaticKeyword */: - case 133 /* ReadonlyKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 117 /* StaticKeyword */: + case 134 /* 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); @@ -21219,63 +21374,63 @@ var ts; return parseEmptyStatement(); case 18 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); - case 105 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(237 /* VariableDeclaration */)); - case 111 /* LetKeyword */: + case 106 /* VarKeyword */: + return parseVariableStatement(createNodeWithJSDoc(238 /* VariableDeclaration */)); + case 112 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(237 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(238 /* VariableDeclaration */)); } break; - case 90 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(239 /* FunctionDeclaration */)); - case 76 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(240 /* ClassDeclaration */)); - case 91 /* IfKeyword */: + case 91 /* FunctionKeyword */: + return parseFunctionDeclaration(createNodeWithJSDoc(240 /* FunctionDeclaration */)); + case 77 /* ClassKeyword */: + return parseClassDeclaration(createNodeWithJSDoc(241 /* ClassDeclaration */)); + case 92 /* IfKeyword */: return parseIfStatement(); - case 82 /* DoKeyword */: + case 83 /* DoKeyword */: return parseDoStatement(); - case 107 /* WhileKeyword */: + case 108 /* WhileKeyword */: return parseWhileStatement(); - case 89 /* ForKeyword */: + case 90 /* ForKeyword */: return parseForOrForInOrForOfStatement(); - case 78 /* ContinueKeyword */: - return parseBreakOrContinueStatement(228 /* ContinueStatement */); - case 73 /* BreakKeyword */: - return parseBreakOrContinueStatement(229 /* BreakStatement */); - case 97 /* ReturnKeyword */: + case 79 /* ContinueKeyword */: + return parseBreakOrContinueStatement(229 /* ContinueStatement */); + case 74 /* BreakKeyword */: + return parseBreakOrContinueStatement(230 /* BreakStatement */); + case 98 /* ReturnKeyword */: return parseReturnStatement(); - case 108 /* WithKeyword */: + case 109 /* WithKeyword */: return parseWithStatement(); - case 99 /* SwitchKeyword */: + case 100 /* SwitchKeyword */: return parseSwitchStatement(); - case 101 /* ThrowKeyword */: + case 102 /* ThrowKeyword */: return parseThrowStatement(); - case 103 /* TryKeyword */: + case 104 /* TryKeyword */: // Include 'catch' and 'finally' for error recovery. - case 75 /* CatchKeyword */: - case 88 /* FinallyKeyword */: + case 76 /* CatchKeyword */: + case 89 /* FinallyKeyword */: return parseTryStatement(); - case 79 /* DebuggerKeyword */: + case 80 /* DebuggerKeyword */: return parseDebuggerStatement(); case 58 /* AtToken */: return parseDeclaration(); - case 121 /* AsyncKeyword */: - case 110 /* InterfaceKeyword */: - case 140 /* TypeKeyword */: - case 130 /* ModuleKeyword */: - case 131 /* NamespaceKeyword */: - case 125 /* DeclareKeyword */: - case 77 /* ConstKeyword */: - case 84 /* EnumKeyword */: - case 85 /* ExportKeyword */: - case 92 /* ImportKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 115 /* PublicKeyword */: - case 118 /* AbstractKeyword */: - case 116 /* StaticKeyword */: - case 133 /* ReadonlyKeyword */: - case 145 /* GlobalKeyword */: + case 122 /* AsyncKeyword */: + case 111 /* InterfaceKeyword */: + case 141 /* TypeKeyword */: + case 131 /* ModuleKeyword */: + case 132 /* NamespaceKeyword */: + case 126 /* DeclareKeyword */: + case 78 /* ConstKeyword */: + case 85 /* EnumKeyword */: + case 86 /* ExportKeyword */: + case 93 /* ImportKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 116 /* PublicKeyword */: + case 119 /* AbstractKeyword */: + case 117 /* StaticKeyword */: + case 134 /* ReadonlyKeyword */: + case 146 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -21284,7 +21439,7 @@ var ts; return parseExpressionOrLabeledStatement(); } function isDeclareModifier(modifier) { - return modifier.kind === 125 /* DeclareKeyword */; + return modifier.kind === 126 /* DeclareKeyword */; } function parseDeclaration() { var node = createNodeWithJSDoc(0 /* Unknown */); @@ -21303,33 +21458,33 @@ var ts; } function parseDeclarationWorker(node) { switch (token()) { - case 105 /* VarKeyword */: - case 111 /* LetKeyword */: - case 77 /* ConstKeyword */: + case 106 /* VarKeyword */: + case 112 /* LetKeyword */: + case 78 /* ConstKeyword */: return parseVariableStatement(node); - case 90 /* FunctionKeyword */: + case 91 /* FunctionKeyword */: return parseFunctionDeclaration(node); - case 76 /* ClassKeyword */: + case 77 /* ClassKeyword */: return parseClassDeclaration(node); - case 110 /* InterfaceKeyword */: + case 111 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 140 /* TypeKeyword */: + case 141 /* TypeKeyword */: return parseTypeAliasDeclaration(node); - case 84 /* EnumKeyword */: + case 85 /* EnumKeyword */: return parseEnumDeclaration(node); - case 145 /* GlobalKeyword */: - case 130 /* ModuleKeyword */: - case 131 /* NamespaceKeyword */: + case 146 /* GlobalKeyword */: + case 131 /* ModuleKeyword */: + case 132 /* NamespaceKeyword */: return parseModuleDeclaration(node); - case 92 /* ImportKeyword */: + case 93 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); - case 85 /* ExportKeyword */: + case 86 /* ExportKeyword */: nextToken(); switch (token()) { - case 80 /* DefaultKeyword */: - case 59 /* EqualsToken */: + case 81 /* DefaultKeyword */: + case 60 /* EqualsToken */: return parseExportAssignment(node); - case 119 /* AsKeyword */: + case 120 /* AsKeyword */: return parseNamespaceExportDeclaration(node); default: return parseExportDeclaration(node); @@ -21338,7 +21493,7 @@ var ts; if (node.decorators || node.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(258 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(259 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -21361,16 +21516,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 27 /* CommaToken */) { - return createNode(210 /* OmittedExpression */); + return createNode(211 /* OmittedExpression */); } - var node = createNode(186 /* BindingElement */); + var node = createNode(187 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(186 /* BindingElement */); + var node = createNode(187 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -21386,14 +21541,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(184 /* ObjectBindingPattern */); + var node = createNode(185 /* ObjectBindingPattern */); parseExpected(18 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(19 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(185 /* ArrayBindingPattern */); + var node = createNode(186 /* ArrayBindingPattern */); parseExpected(22 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(23 /* CloseBracketToken */); @@ -21415,9 +21570,9 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(237 /* VariableDeclaration */); + var node = createNode(238 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); - if (allowExclamation && node.name.kind === 72 /* Identifier */ && + if (allowExclamation && node.name.kind === 73 /* Identifier */ && token() === 52 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -21428,14 +21583,14 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(238 /* VariableDeclarationList */); + var node = createNode(239 /* VariableDeclarationList */); switch (token()) { - case 105 /* VarKeyword */: + case 106 /* VarKeyword */: break; - case 111 /* LetKeyword */: + case 112 /* LetKeyword */: node.flags |= 1 /* Let */; break; - case 77 /* ConstKeyword */: + case 78 /* ConstKeyword */: node.flags |= 2 /* Const */; break; default: @@ -21451,7 +21606,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 147 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 148 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -21466,14 +21621,14 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 219 /* VariableStatement */; + node.kind = 220 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 239 /* FunctionDeclaration */; - parseExpected(90 /* FunctionKeyword */); + node.kind = 240 /* FunctionDeclaration */; + parseExpected(91 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(40 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); var isGenerator = node.asteriskToken ? 1 /* Yield */ : 0 /* None */; @@ -21483,14 +21638,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 157 /* Constructor */; - parseExpected(124 /* ConstructorKeyword */); + node.kind = 158 /* Constructor */; + parseExpected(125 /* ConstructorKeyword */); fillSignature(57 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 156 /* MethodDeclaration */; + node.kind = 157 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -21499,7 +21654,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 154 /* PropertyDeclaration */; + node.kind = 155 /* PropertyDeclaration */; if (!node.questionToken && token() === 52 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -21572,7 +21727,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 === 137 /* SetKeyword */ || idToken === 126 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 138 /* SetKeyword */ || idToken === 127 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -21582,7 +21737,7 @@ var ts; case 28 /* LessThanToken */: // Generic Method declaration case 52 /* ExclamationToken */: // Non-null assertion on property name case 57 /* ColonToken */: // Type Annotation for declaration - case 59 /* EqualsToken */: // Initializer for declaration + case 60 /* EqualsToken */: // Initializer for declaration case 56 /* QuestionToken */: // Not valid, but permitted so that it gets caught later on. return true; default: @@ -21604,7 +21759,7 @@ var ts; if (!parseOptional(58 /* AtToken */)) { break; } - var decorator = createNode(152 /* Decorator */, decoratorStart); + var decorator = createNode(153 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -21624,7 +21779,7 @@ var ts; while (true) { var modifierStart = scanner.getStartPos(); var modifierKind = token(); - if (token() === 77 /* ConstKeyword */ && permitInvalidConstAsModifier) { + if (token() === 78 /* ConstKeyword */ && permitInvalidConstAsModifier) { // We need to ensure that any subsequent modifiers appear on the same line // so that when 'const' is a standalone declaration, we don't issue an error. if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { @@ -21643,7 +21798,7 @@ var ts; } function parseModifiersForArrowFunction() { var modifiers; - if (token() === 121 /* AsyncKeyword */) { + if (token() === 122 /* AsyncKeyword */) { var modifierStart = scanner.getStartPos(); var modifierKind = token(); nextToken(); @@ -21654,20 +21809,20 @@ var ts; } function parseClassElement() { if (token() === 26 /* SemicolonToken */) { - var result = createNode(217 /* SemicolonClassElement */); + var result = createNode(218 /* SemicolonClassElement */); nextToken(); return finishNode(result); } var node = createNodeWithJSDoc(0 /* Unknown */); node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); - if (parseContextualModifier(126 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 158 /* GetAccessor */); + if (parseContextualModifier(127 /* GetKeyword */)) { + return parseAccessorDeclaration(node, 159 /* GetAccessor */); } - if (parseContextualModifier(137 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 159 /* SetAccessor */); + if (parseContextualModifier(138 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 160 /* SetAccessor */); } - if (token() === 124 /* ConstructorKeyword */) { + if (token() === 125 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); } if (isIndexSignature()) { @@ -21684,21 +21839,21 @@ var ts; } if (node.decorators || node.modifiers) { // treat this as a property declaration with a missing name. - node.name = createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + node.name = createMissingNode(73 /* Identifier */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); return parsePropertyDeclaration(node); } // 'isClassMemberStart' should have hinted not to attempt parsing. return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 209 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 210 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 240 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 241 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; - parseExpected(76 /* ClassKeyword */); + parseExpected(77 /* ClassKeyword */); node.name = parseNameOfClassDeclarationOrExpression(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(); @@ -21724,7 +21879,7 @@ var ts; : undefined; } function isImplementsClause() { - return token() === 109 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); + return token() === 110 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); } function parseHeritageClauses() { // ClassTail[Yield,Await] : (Modified) See 14.5 @@ -21736,15 +21891,15 @@ var ts; } function parseHeritageClause() { var tok = token(); - ts.Debug.assert(tok === 86 /* ExtendsKeyword */ || tok === 109 /* ImplementsKeyword */); // isListElement() should ensure this. - var node = createNode(273 /* HeritageClause */); + ts.Debug.assert(tok === 87 /* ExtendsKeyword */ || tok === 110 /* ImplementsKeyword */); // isListElement() should ensure this. + var node = createNode(274 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); return finishNode(node); } function parseExpressionWithTypeArguments() { - var node = createNode(211 /* ExpressionWithTypeArguments */); + var node = createNode(212 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -21755,14 +21910,14 @@ var ts; : undefined; } function isHeritageClause() { - return token() === 86 /* ExtendsKeyword */ || token() === 109 /* ImplementsKeyword */; + return token() === 87 /* ExtendsKeyword */ || token() === 110 /* ImplementsKeyword */; } function parseClassMembers() { return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 241 /* InterfaceDeclaration */; - parseExpected(110 /* InterfaceKeyword */); + node.kind = 242 /* InterfaceDeclaration */; + parseExpected(111 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(); @@ -21770,11 +21925,11 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 242 /* TypeAliasDeclaration */; - parseExpected(140 /* TypeKeyword */); + node.kind = 243 /* TypeAliasDeclaration */; + parseExpected(141 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - parseExpected(59 /* EqualsToken */); + parseExpected(60 /* EqualsToken */); node.type = parseType(); parseSemicolon(); return finishNode(node); @@ -21784,14 +21939,14 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(278 /* EnumMember */); + var node = createNodeWithJSDoc(279 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 243 /* EnumDeclaration */; - parseExpected(84 /* EnumKeyword */); + node.kind = 244 /* EnumDeclaration */; + parseExpected(85 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(18 /* OpenBraceToken */)) { node.members = parseDelimitedList(6 /* EnumMembers */, parseEnumMember); @@ -21803,7 +21958,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(245 /* ModuleBlock */); + var node = createNode(246 /* ModuleBlock */); if (parseExpected(18 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(19 /* CloseBraceToken */); @@ -21814,7 +21969,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 244 /* ModuleDeclaration */; + node.kind = 245 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -21826,8 +21981,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 244 /* ModuleDeclaration */; - if (token() === 145 /* GlobalKeyword */) { + node.kind = 245 /* ModuleDeclaration */; + if (token() === 146 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -21846,15 +22001,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 145 /* GlobalKeyword */) { + if (token() === 146 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(131 /* NamespaceKeyword */)) { + else if (parseOptional(132 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(130 /* ModuleKeyword */); + parseExpected(131 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -21862,7 +22017,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 134 /* RequireKeyword */ && + return token() === 135 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -21872,25 +22027,25 @@ var ts; return nextToken() === 42 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 247 /* NamespaceExportDeclaration */; - parseExpected(119 /* AsKeyword */); - parseExpected(131 /* NamespaceKeyword */); + node.kind = 248 /* NamespaceExportDeclaration */; + parseExpected(120 /* AsKeyword */); + parseExpected(132 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); } function parseImportDeclarationOrImportEqualsDeclaration(node) { - parseExpected(92 /* ImportKeyword */); + parseExpected(93 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 27 /* CommaToken */ && token() !== 144 /* FromKeyword */) { + if (token() !== 27 /* CommaToken */ && token() !== 145 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 249 /* ImportDeclaration */; + node.kind = 250 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -21898,16 +22053,16 @@ var ts; token() === 40 /* AsteriskToken */ || // import * token() === 18 /* OpenBraceToken */) { // import { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(144 /* FromKeyword */); + parseExpected(145 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 248 /* ImportEqualsDeclaration */; + node.kind = 249 /* ImportEqualsDeclaration */; node.name = identifier; - parseExpected(59 /* EqualsToken */); + parseExpected(60 /* EqualsToken */); node.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(node); @@ -21919,7 +22074,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(250 /* ImportClause */, fullStart); + var importClause = createNode(251 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -21929,7 +22084,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(27 /* CommaToken */)) { - importClause.namedBindings = token() === 40 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(252 /* NamedImports */); + importClause.namedBindings = token() === 40 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(253 /* NamedImports */); } return finishNode(importClause); } @@ -21939,8 +22094,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(259 /* ExternalModuleReference */); - parseExpected(134 /* RequireKeyword */); + var node = createNode(260 /* ExternalModuleReference */); + parseExpected(135 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -21962,9 +22117,9 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(251 /* NamespaceImport */); + var namespaceImport = createNode(252 /* NamespaceImport */); parseExpected(40 /* AsteriskToken */); - parseExpected(119 /* AsKeyword */); + parseExpected(120 /* AsKeyword */); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } @@ -21977,14 +22132,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 252 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); + node.elements = parseBracketedList(23 /* ImportOrExportSpecifiers */, kind === 253 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(257 /* ExportSpecifier */); + return parseImportOrExportSpecifier(258 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(253 /* ImportSpecifier */); + return parseImportOrExportSpecifier(254 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -21998,9 +22153,9 @@ var ts; var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token() === 119 /* AsKeyword */) { + if (token() === 120 /* AsKeyword */) { node.propertyName = identifierName; - parseExpected(119 /* AsKeyword */); + parseExpected(120 /* AsKeyword */); checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -22009,24 +22164,24 @@ var ts; else { node.name = identifierName; } - if (kind === 253 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 254 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 255 /* ExportDeclaration */; + node.kind = 256 /* ExportDeclaration */; if (parseOptional(40 /* AsteriskToken */)) { - parseExpected(144 /* FromKeyword */); + parseExpected(145 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(256 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(257 /* 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() === 144 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(144 /* FromKeyword */); + if (token() === 145 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(145 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -22034,12 +22189,12 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 254 /* ExportAssignment */; - if (parseOptional(59 /* EqualsToken */)) { + node.kind = 255 /* ExportAssignment */; + if (parseOptional(60 /* EqualsToken */)) { node.isExportEquals = true; } else { - parseExpected(80 /* DefaultKeyword */); + parseExpected(81 /* DefaultKeyword */); } node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); @@ -22054,10 +22209,10 @@ var ts; } function isAnExternalModuleIndicatorNode(node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 248 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 259 /* ExternalModuleReference */ - || node.kind === 249 /* ImportDeclaration */ - || node.kind === 254 /* ExportAssignment */ - || node.kind === 255 /* ExportDeclaration */ + || node.kind === 249 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 260 /* ExternalModuleReference */ + || node.kind === 250 /* ImportDeclaration */ + || node.kind === 255 /* ExportAssignment */ + || node.kind === 256 /* ExportDeclaration */ ? node : undefined; } @@ -22070,7 +22225,7 @@ var ts; return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators); } function isImportMeta(node) { - return ts.isMetaProperty(node) && node.keywordToken === 92 /* ImportKeyword */ && node.name.escapedText === "meta"; + return ts.isMetaProperty(node) && node.keywordToken === 93 /* ImportKeyword */ && node.name.escapedText === "meta"; } var ParsingContext; (function (ParsingContext) { @@ -22109,8 +22264,8 @@ var ts; var JSDocParser; (function (JSDocParser) { function parseJSDocTypeExpressionForTests(content, start, length) { - initializeState(content, 7 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); - sourceFile = createSourceFile("file.js", 7 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false); + initializeState(content, 8 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); + sourceFile = createSourceFile("file.js", 8 /* Latest */, 1 /* JS */, /*isDeclarationFile*/ false); scanner.setText(content, start, length); currentToken = scanner.scan(); var jsDocTypeExpression = parseJSDocTypeExpression(); @@ -22121,18 +22276,18 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(288 /* JSDocTypeExpression */); + var result = createNode(289 /* JSDocTypeExpression */); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); result.type = doInsideOfContext(2097152 /* JSDoc */, parseJSDocType); if (!mayOmitBraces || hasBrace) { - parseExpected(19 /* CloseBraceToken */); + parseExpectedJSDoc(19 /* CloseBraceToken */); } fixupParentReferences(result); return finishNode(result); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; function parseIsolatedJSDocComment(content, start, length) { - initializeState(content, 7 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); + initializeState(content, 8 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); sourceFile = { languageVariant: 0 /* Standard */, text: content }; // tslint:disable-line no-object-literal-type-assertion var jsDoc = parseJSDocCommentWorker(start, length); var diagnostics = parseDiagnostics; @@ -22204,7 +22359,7 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); + nextTokenJSDoc(); while (parseOptionalJsdoc(5 /* WhitespaceTrivia */)) ; if (parseOptionalJsdoc(4 /* NewLineTrivia */)) { @@ -22222,7 +22377,6 @@ var ts; // for malformed examples like `/** @param {string} x @returns {number} the length */` state = 0 /* BeginningOfLine */; margin = undefined; - indent++; } else { pushComment(scanner.getTokenText()); @@ -22267,7 +22421,7 @@ var ts; pushComment(scanner.getTokenText()); break; } - nextJSDocToken(); + nextTokenJSDoc(); } removeLeadingNewlines(comments); removeTrailingWhitespace(comments); @@ -22284,7 +22438,7 @@ var ts; } } function createJSDocComment() { - var result = createNode(296 /* JSDocComment */, start); + var result = createNode(297 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -22292,7 +22446,7 @@ var ts; function isNextNonwhitespaceTokenEndOfFile() { // We must use infinite lookahead, as there could be any number of newlines :( while (true) { - nextJSDocToken(); + nextTokenJSDoc(); if (token() === 1 /* EndOfFileToken */) { return true; } @@ -22308,32 +22462,38 @@ var ts; } } while (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { - nextJSDocToken(); + nextTokenJSDoc(); } } function skipWhitespaceOrAsterisk() { if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { - return; // Don't skip whitespace prior to EoF (or end of comment) - that shouldn't be included in any node's range + return ""; // Don't skip whitespace prior to EoF (or end of comment) - that shouldn't be included in any node's range } } var precedingLineBreak = scanner.hasPrecedingLineBreak(); + var seenLineBreak = false; + var indentText = ""; while ((precedingLineBreak && token() === 40 /* AsteriskToken */) || token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { + indentText += scanner.getTokenText(); if (token() === 4 /* NewLineTrivia */) { precedingLineBreak = true; + seenLineBreak = true; + indentText = ""; } else if (token() === 40 /* AsteriskToken */) { precedingLineBreak = false; } - nextJSDocToken(); + nextTokenJSDoc(); } + return seenLineBreak ? indentText : ""; } - function parseTag(indent) { + function parseTag(margin) { ts.Debug.assert(token() === 58 /* AtToken */); var start = scanner.getTokenPos(); - nextJSDocToken(); + nextTokenJSDoc(); var tagName = parseJSDocIdentifierName(/*message*/ undefined); - skipWhitespaceOrAsterisk(); + var indentText = skipWhitespaceOrAsterisk(); var tag; switch (tagName.escapedText) { case "augments": @@ -22353,7 +22513,7 @@ var ts; case "arg": case "argument": case "param": - return parseParameterOrPropertyTag(start, tagName, 2 /* Parameter */, indent); + return parseParameterOrPropertyTag(start, tagName, 2 /* Parameter */, margin); case "return": case "returns": tag = parseReturnTag(start, tagName); @@ -22365,10 +22525,10 @@ var ts; tag = parseTypeTag(start, tagName); break; case "typedef": - tag = parseTypedefTag(start, tagName, indent); + tag = parseTypedefTag(start, tagName, margin); break; case "callback": - tag = parseCallbackTag(start, tagName, indent); + tag = parseCallbackTag(start, tagName, margin); break; default: tag = parseUnknownTag(start, tagName); @@ -22376,11 +22536,14 @@ var ts; } if (!tag.comment) { // some tags, like typedef and callback, have already parsed their comments earlier - tag.comment = parseTagComments(indent + tag.end - tag.pos); + if (!indentText) { + margin += tag.end - tag.pos; + } + tag.comment = parseTagComments(margin, indentText.slice(margin)); } return tag; } - function parseTagComments(indent) { + function parseTagComments(indent, initialMargin) { var comments = []; var state = 0 /* BeginningOfLine */; var margin; @@ -22391,6 +22554,11 @@ var ts; comments.push(text); indent += text.length; } + if (initialMargin) { + // jump straight to saving comments if there is some initial indentation + pushComment(initialMargin); + state = 2 /* SavingComments */; + } var tok = token(); loop: while (true) { switch (tok) { @@ -22415,18 +22583,18 @@ var ts; var whitespace = scanner.getTokenText(); // if the whitespace crosses the margin, take only the whitespace that passes the margin if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent - 1)); + comments.push(whitespace.slice(margin - indent)); } indent += whitespace.length; } break; case 18 /* OpenBraceToken */: state = 2 /* SavingComments */; - if (lookAhead(function () { return nextJSDocToken() === 58 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextJSDocToken()) && scanner.getTokenText() === "link"; })) { + if (lookAhead(function () { return nextTokenJSDoc() === 58 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenText() === "link"; })) { pushComment(scanner.getTokenText()); - nextJSDocToken(); + nextTokenJSDoc(); pushComment(scanner.getTokenText()); - nextJSDocToken(); + nextTokenJSDoc(); } pushComment(scanner.getTokenText()); break; @@ -22444,14 +22612,14 @@ var ts; pushComment(scanner.getTokenText()); break; } - tok = nextJSDocToken(); + tok = nextTokenJSDoc(); } removeLeadingNewlines(comments); removeTrailingWhitespace(comments); return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(start, tagName) { - var result = createNode(299 /* JSDocTag */, start); + var result = createNode(300 /* JSDocTag */, start); result.tagName = tagName; return finishNode(result); } @@ -22473,17 +22641,21 @@ var ts; return token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : undefined; } function parseBracketNameInPropertyAndParamTag() { - if (token() === 14 /* NoSubstitutionTemplateLiteral */) { - // a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild - return { name: createIdentifier(/*isIdentifier*/ true), isBracketed: false }; - } // Looking for something like '[foo]', 'foo', '[foo.bar]' or 'foo.bar' - var isBracketed = parseOptional(22 /* OpenBracketToken */); + var isBracketed = parseOptionalJsdoc(22 /* OpenBracketToken */); + if (isBracketed) { + skipWhitespace(); + } + // a markdown-quoted name: `arg` is not legal jsdoc, but occurs in the wild + var isBackquoted = parseOptionalJsdoc(59 /* BacktickToken */); var name = parseJSDocEntityName(); + if (isBackquoted) { + parseExpectedTokenJSDoc(59 /* BacktickToken */); + } if (isBracketed) { skipWhitespace(); // May have an optional default, e.g. '[foo = 42]' - if (parseOptionalToken(59 /* EqualsToken */)) { + if (parseOptionalToken(60 /* EqualsToken */)) { parseExpression(); } parseExpected(23 /* CloseBracketToken */); @@ -22492,9 +22664,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 136 /* ObjectKeyword */: + case 137 /* ObjectKeyword */: return true; - case 169 /* ArrayType */: + case 170 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -22510,8 +22682,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Property */ ? - createNode(310 /* JSDocPropertyTag */, start) : - createNode(304 /* JSDocParameterTag */, start); + createNode(311 /* JSDocPropertyTag */, start) : + createNode(305 /* JSDocParameterTag */, start); var comment = parseTagComments(indent + scanner.getStartPos() - start); var nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent); if (nestedTypeLiteral) { @@ -22528,20 +22700,20 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name, target, indent) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(288 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(289 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 304 /* JSDocParameterTag */ || child.kind === 310 /* JSDocPropertyTag */) { + if (child.kind === 305 /* JSDocParameterTag */ || child.kind === 311 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - jsdocTypeLiteral = createNode(297 /* JSDocTypeLiteral */, start_2); + jsdocTypeLiteral = createNode(298 /* JSDocTypeLiteral */, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 169 /* ArrayType */) { + if (typeExpression.type.kind === 170 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -22550,32 +22722,32 @@ var ts; } } function parseReturnTag(start, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 305 /* JSDocReturnTag */; })) { + if (ts.some(tags, ts.isJSDocReturnTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(305 /* JSDocReturnTag */, start); + var result = createNode(306 /* JSDocReturnTag */, start); result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(start, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 307 /* JSDocTypeTag */; })) { + if (ts.some(tags, ts.isJSDocTypeTag)) { parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(307 /* JSDocTypeTag */, start); + var result = createNode(308 /* JSDocTypeTag */, start); result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAugmentsTag(start, tagName) { - var result = createNode(300 /* JSDocAugmentsTag */, start); + var result = createNode(301 /* JSDocAugmentsTag */, start); result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); return finishNode(result); } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(18 /* OpenBraceToken */); - var node = createNode(211 /* ExpressionWithTypeArguments */); + var node = createNode(212 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -22587,7 +22759,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(); while (parseOptional(24 /* DotToken */)) { - var prop = createNode(189 /* PropertyAccessExpression */, node.pos); + var prop = createNode(190 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -22595,19 +22767,19 @@ var ts; return node; } function parseClassTag(start, tagName) { - var tag = createNode(301 /* JSDocClassTag */, start); + var tag = createNode(302 /* JSDocClassTag */, start); tag.tagName = tagName; return finishNode(tag); } function parseThisTag(start, tagName) { - var tag = createNode(306 /* JSDocThisTag */, start); + var tag = createNode(307 /* JSDocThisTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); return finishNode(tag); } function parseEnumTag(start, tagName) { - var tag = createNode(303 /* JSDocEnumTag */, start); + var tag = createNode(304 /* JSDocEnumTag */, start); tag.tagName = tagName; tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); skipWhitespace(); @@ -22616,7 +22788,7 @@ var ts; function parseTypedefTag(start, tagName, indent) { var typeExpression = tryParseTypeExpression(); skipWhitespaceOrAsterisk(); - var typedefTag = createNode(309 /* JSDocTypedefTag */, start); + var typedefTag = createNode(310 /* JSDocTypedefTag */, start); typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(); typedefTag.name = getJSDocTypeAliasName(typedefTag.fullName); @@ -22630,9 +22802,9 @@ var ts; var childTypeTag = void 0; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(297 /* JSDocTypeLiteral */, start); + jsdocTypeLiteral = createNode(298 /* JSDocTypeLiteral */, start); } - if (child.kind === 307 /* JSDocTypeTag */) { + if (child.kind === 308 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -22645,7 +22817,7 @@ var ts; } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 169 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 170 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -22664,7 +22836,7 @@ var ts; } var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (parseOptional(24 /* DotToken */)) { - var jsDocNamespaceNode = createNode(244 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(245 /* ModuleDeclaration */, pos); if (nested) { jsDocNamespaceNode.flags |= 4 /* NestedNamespace */; } @@ -22678,14 +22850,14 @@ var ts; return typeNameOrNamespaceName; } function parseCallbackTag(start, tagName, indent) { - var callbackTag = createNode(302 /* JSDocCallbackTag */, start); + var callbackTag = createNode(303 /* JSDocCallbackTag */, start); callbackTag.tagName = tagName; callbackTag.fullName = parseJSDocTypeNameWithNamespace(); callbackTag.name = getJSDocTypeAliasName(callbackTag.fullName); skipWhitespace(); callbackTag.comment = parseTagComments(indent); var child; - var jsdocSignature = createNode(298 /* JSDocSignature */, start); + var jsdocSignature = createNode(299 /* JSDocSignature */, start); jsdocSignature.parameters = []; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent); })) { jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child); @@ -22693,7 +22865,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(58 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 305 /* JSDocReturnTag */) { + if (tag && tag.kind === 306 /* JSDocReturnTag */) { return tag; } } @@ -22734,11 +22906,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - switch (nextJSDocToken()) { + switch (nextTokenJSDoc()) { case 58 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 304 /* JSDocParameterTag */ || child.kind === 310 /* JSDocPropertyTag */) && + if (child && (child.kind === 305 /* JSDocParameterTag */ || child.kind === 311 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -22757,7 +22929,7 @@ var ts; } seenAsterisk = true; break; - case 72 /* Identifier */: + case 73 /* Identifier */: canParseTag = false; break; case 1 /* EndOfFileToken */: @@ -22768,7 +22940,7 @@ var ts; function tryParseChildTag(target, indent) { ts.Debug.assert(token() === 58 /* AtToken */); var start = scanner.getStartPos(); - nextJSDocToken(); + nextTokenJSDoc(); var tagName = parseJSDocIdentifierName(); skipWhitespace(); var t; @@ -22802,25 +22974,22 @@ var ts; var typeParametersPos = getNodePos(); do { skipWhitespace(); - var typeParameter = createNode(150 /* TypeParameter */); + var typeParameter = createNode(151 /* TypeParameter */); typeParameter.name = parseJSDocIdentifierName(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); finishNode(typeParameter); skipWhitespace(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(27 /* CommaToken */)); - var result = createNode(308 /* JSDocTemplateTag */, start); + var result = createNode(309 /* JSDocTemplateTag */, start); result.tagName = tagName; result.constraint = constraint; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } - function nextJSDocToken() { - return currentToken = scanner.scanJSDocToken(); - } function parseOptionalJsdoc(t) { if (token() === t) { - nextJSDocToken(); + nextTokenJSDoc(); return true; } return false; @@ -22844,14 +23013,14 @@ var ts; } function parseJSDocIdentifierName(message) { if (!ts.tokenIsIdentifierOrKeyword(token())) { - return createMissingNode(72 /* Identifier */, /*reportAtCurrentPosition*/ !message, message || ts.Diagnostics.Identifier_expected); + return createMissingNode(73 /* Identifier */, /*reportAtCurrentPosition*/ !message, message || ts.Diagnostics.Identifier_expected); } var pos = scanner.getTokenPos(); var end = scanner.getTextPos(); - var result = createNode(72 /* Identifier */, pos); + var result = createNode(73 /* Identifier */, pos); result.escapedText = ts.escapeLeadingUnderscores(scanner.getTokenText()); finishNode(result, end); - nextJSDocToken(); + nextTokenJSDoc(); return result; } } @@ -22976,7 +23145,7 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 8 /* NumericLiteral */: - case 72 /* Identifier */: + case 73 /* Identifier */: return true; } return false; @@ -23343,28 +23512,16 @@ var ts; ts.isDeclarationFileName = isDeclarationFileName; /*@internal*/ function processCommentPragmas(context, sourceText) { - var triviaScanner = ts.createScanner(context.languageVersion, /*skipTrivia*/ false, 0 /* Standard */, sourceText); var pragmas = []; - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a - // reference comment. - while (true) { - var kind = triviaScanner.scan(); - if (!ts.isTrivia(kind)) { - break; - } - var range = { - kind: triviaScanner.getToken(), - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - }; + for (var _i = 0, _a = ts.getLeadingCommentRanges(sourceText, 0) || ts.emptyArray; _i < _a.length; _i++) { + var range = _a[_i]; var comment = sourceText.substring(range.pos, range.end); extractPragmas(pragmas, range, comment); } context.pragmas = ts.createMap(); - for (var _i = 0, pragmas_1 = pragmas; _i < pragmas_1.length; _i++) { - var pragma = pragmas_1[_i]; - if (context.pragmas.has(pragma.name)) { // TODO: GH#18217 + for (var _b = 0, pragmas_1 = pragmas; _b < pragmas_1.length; _b++) { + var pragma = pragmas_1[_b]; + if (context.pragmas.has(pragma.name)) { var currentValue = context.pragmas.get(pragma.name); if (currentValue instanceof Array) { currentValue.push(pragma.args); @@ -23395,7 +23552,6 @@ var ts; var typeReferenceDirectives_1 = context.typeReferenceDirectives; var libReferenceDirectives_1 = context.libReferenceDirectives; ts.forEach(ts.toArray(entryOrList), function (arg) { - // TODO: GH#18217 var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path; if (arg.arguments["no-default-lib"]) { context.hasNoDefaultLib = true; @@ -23416,7 +23572,7 @@ var ts; break; } case "amd-dependency": { - context.amdDependencies = ts.map(ts.toArray(entryOrList), function (x) { return ({ name: x.arguments.name, path: x.arguments.path }); }); // TODO: GH#18217 + context.amdDependencies = ts.map(ts.toArray(entryOrList), function (x) { return ({ name: x.arguments.name, path: x.arguments.path }); }); break; } case "amd-module": { @@ -23439,7 +23595,7 @@ var ts; case "ts-check": { // _last_ of either nocheck or check in a file is the "winner" ts.forEach(ts.toArray(entryOrList), function (entry) { - if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) { // TODO: GH#18217 + if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) { context.checkJsDirective = { enabled: key === "ts-check", end: entry.range.end, @@ -23555,10 +23711,10 @@ var ts; if (lhs.kind !== rhs.kind) { return false; } - if (lhs.kind === 72 /* Identifier */) { + if (lhs.kind === 73 /* Identifier */) { return lhs.escapedText === rhs.escapedText; } - if (lhs.kind === 100 /* ThisKeyword */) { + if (lhs.kind === 101 /* ThisKeyword */) { return true; } // If we are at this statement then we must have PropertyAccessExpression and because tag name in Jsx element can only @@ -23587,6 +23743,7 @@ var ts; ["es2017", "lib.es2017.d.ts"], ["es2018", "lib.es2018.d.ts"], ["es2019", "lib.es2019.d.ts"], + ["es2020", "lib.es2020.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], @@ -23615,8 +23772,11 @@ var ts; ["es2018.promise", "lib.es2018.promise.d.ts"], ["es2018.regexp", "lib.es2018.regexp.d.ts"], ["es2019.array", "lib.es2019.array.d.ts"], + ["es2019.object", "lib.es2019.object.d.ts"], ["es2019.string", "lib.es2019.string.d.ts"], ["es2019.symbol", "lib.es2019.symbol.d.ts"], + ["es2020.string", "lib.es2020.string.d.ts"], + ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["esnext.array", "lib.es2019.array.d.ts"], ["esnext.symbol", "lib.es2019.symbol.d.ts"], ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], @@ -23703,6 +23863,13 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Show_verbose_diagnostic_information }, + { + name: "incremental", + shortName: "i", + type: "boolean", + category: ts.Diagnostics.Basic_Options, + description: ts.Diagnostics.Enable_incremental_compilation, + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23766,10 +23933,12 @@ var ts; es2017: 4 /* ES2017 */, es2018: 5 /* ES2018 */, es2019: 6 /* ES2019 */, - esnext: 7 /* ESNext */, + es2020: 7 /* ES2020 */, + esnext: 8 /* ESNext */, }), affectsSourceFile: true, affectsModuleResolution: true, + affectsEmit: true, paramType: ts.Diagnostics.VERSION, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -23837,6 +24006,7 @@ var ts; name: "declaration", shortName: "d", type: "boolean", + affectsEmit: true, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, @@ -23844,6 +24014,7 @@ var ts; { name: "declarationMap", type: "boolean", + affectsEmit: true, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_a_sourcemap_for_each_corresponding_d_ts_file, @@ -23851,12 +24022,14 @@ var ts; { name: "emitDeclarationOnly", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Only_emit_d_ts_declaration_files, }, { name: "sourceMap", type: "boolean", + affectsEmit: true, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_map_file, @@ -23864,6 +24037,7 @@ var ts; { name: "outFile", type: "string", + affectsEmit: true, isFilePath: true, paramType: ts.Diagnostics.FILE, showInSimplifiedHelpView: true, @@ -23873,6 +24047,7 @@ var ts; { name: "outDir", type: "string", + affectsEmit: true, isFilePath: true, paramType: ts.Diagnostics.DIRECTORY, showInSimplifiedHelpView: true, @@ -23882,6 +24057,7 @@ var ts; { name: "rootDir", type: "string", + affectsEmit: true, isFilePath: true, paramType: ts.Diagnostics.LOCATION, category: ts.Diagnostics.Basic_Options, @@ -23890,29 +24066,24 @@ var ts; { name: "composite", type: "boolean", + affectsEmit: true, isTSConfigOnly: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Enable_project_compilation, }, - { - name: "incremental", - type: "boolean", - isTSConfigOnly: true, - category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Enable_incremental_compilation, - }, { name: "tsBuildInfoFile", type: "string", + affectsEmit: true, isFilePath: true, paramType: ts.Diagnostics.FILE, - isTSConfigOnly: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Specify_file_to_store_incremental_compilation_information, }, { name: "removeComments", type: "boolean", + affectsEmit: true, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Do_not_emit_comments_to_output, @@ -23920,6 +24091,7 @@ var ts; { name: "noEmit", type: "boolean", + affectsEmit: true, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Do_not_emit_outputs, @@ -23927,12 +24099,14 @@ var ts; { name: "importHelpers", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Import_emit_helpers_from_tslib }, { name: "downlevelIteration", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 }, @@ -24136,10 +24310,18 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Do_not_resolve_the_real_path_of_symlinks, }, + { + name: "allowUmdGlobalAccess", + type: "boolean", + affectsSemanticDiagnostics: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules, + }, // Source Maps { name: "sourceRoot", type: "string", + affectsEmit: true, paramType: ts.Diagnostics.LOCATION, category: ts.Diagnostics.Source_Map_Options, description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, @@ -24147,6 +24329,7 @@ var ts; { name: "mapRoot", type: "string", + affectsEmit: true, paramType: ts.Diagnostics.LOCATION, category: ts.Diagnostics.Source_Map_Options, description: ts.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, @@ -24154,12 +24337,14 @@ var ts; { name: "inlineSourceMap", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Source_Map_Options, description: ts.Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file }, { name: "inlineSources", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Source_Map_Options, description: ts.Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, @@ -24192,6 +24377,7 @@ var ts; { name: "out", type: "string", + affectsEmit: true, isFilePath: false, // for correct behaviour, please use outFile category: ts.Diagnostics.Advanced_Options, @@ -24201,6 +24387,7 @@ var ts; { name: "reactNamespace", type: "string", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit }, @@ -24219,6 +24406,7 @@ var ts; { name: "emitBOM", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, @@ -24234,6 +24422,7 @@ var ts; crlf: 0 /* CarriageReturnLineFeed */, lf: 1 /* LineFeed */ }), + affectsEmit: true, paramType: ts.Diagnostics.NEWLINE, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, @@ -24261,6 +24450,7 @@ var ts; { name: "stripInternal", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, }, @@ -24281,24 +24471,28 @@ var ts; { name: "noEmitHelpers", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output }, { name: "noEmitOnError", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, }, { name: "preserveConstEnums", type: "boolean", + affectsEmit: true, category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code }, { name: "declarationDir", type: "string", + affectsEmit: true, isFilePath: true, paramType: ts.Diagnostics.DIRECTORY, category: ts.Diagnostics.Advanced_Options, @@ -24381,6 +24575,8 @@ var ts; /* @internal */ ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; }); /* @internal */ + ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; }); + /* @internal */ ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; }); /* @internal */ ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) { @@ -24788,7 +24984,7 @@ var ts; /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) { + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache) { var configFileText; try { configFileText = host.readFile(configFileName); @@ -24808,7 +25004,9 @@ var ts; result.path = ts.toPath(configFileName, cwd, ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); result.resolvedPath = result.path; result.originalFileName = result.fileName; - return parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd)); + return parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd), + /*resolutionStack*/ undefined, + /*extraFileExtension*/ undefined, extendedConfigCache); } ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile; /** @@ -24947,7 +25145,7 @@ var ts; var result = returnValue ? {} : undefined; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 275 /* PropertyAssignment */) { + if (element.kind !== 276 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -25003,13 +25201,13 @@ var ts; } function convertPropertyValueToJson(valueExpression, option) { switch (valueExpression.kind) { - case 102 /* TrueKeyword */: + case 103 /* TrueKeyword */: reportInvalidOptionValue(option && option.type !== "boolean"); return true; - case 87 /* FalseKeyword */: + case 88 /* FalseKeyword */: reportInvalidOptionValue(option && option.type !== "boolean"); return false; - case 96 /* NullKeyword */: + case 97 /* NullKeyword */: reportInvalidOptionValue(option && option.name === "extends"); // "extends" is the only option we don't allow null/undefined for return null; // tslint:disable-line:no-null-keyword case 10 /* StringLiteral */: @@ -25029,13 +25227,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: if (valueExpression.operator !== 39 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -25052,7 +25250,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -25308,8 +25506,8 @@ var ts; * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { - return parseJsonConfigFileContentWorker(json, /*sourceFile*/ undefined, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions); + function parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache) { + return parseJsonConfigFileContentWorker(json, /*sourceFile*/ undefined, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache); } ts.parseJsonConfigFileContent = parseJsonConfigFileContent; /** @@ -25319,8 +25517,8 @@ var ts; * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { - return parseJsonConfigFileContentWorker(/*json*/ undefined, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions); + function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache) { + return parseJsonConfigFileContentWorker(/*json*/ undefined, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache); } ts.parseJsonSourceFileConfigFileContent = parseJsonSourceFileConfigFileContent; /*@internal*/ @@ -25348,13 +25546,13 @@ var ts; * file to. e.g. outDir * @param resolutionStack Only present for backwards-compatibility. Should be empty. */ - function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { + function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache) { if (existingOptions === void 0) { existingOptions = {}; } if (resolutionStack === void 0) { resolutionStack = []; } if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName && ts.normalizeSlashes(configFileName); @@ -25494,7 +25692,7 @@ var ts; * This *just* extracts options/include/exclude/files out of a config file. * It does *not* resolve the included files. */ - function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -25507,7 +25705,7 @@ var ts; if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors, extendedConfigCache); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -25604,7 +25802,7 @@ var ts; if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { - errors.push(createDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig)); + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); return undefined; } } @@ -25615,38 +25813,52 @@ var ts; if (resolved.resolvedModule) { return resolved.resolvedModule.resolvedFileName; } - errors.push(createDiagnostic(ts.Diagnostics.File_0_does_not_exist, extendedConfig)); + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); return undefined; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors, extendedConfigCache) { var _a; - var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); + var path = host.useCaseSensitiveFileNames ? extendedConfigPath : ts.toLowerCase(extendedConfigPath); + var value; + var extendedResult; + var extendedConfig; + if (extendedConfigCache && (value = extendedConfigCache.get(path))) { + (extendedResult = value.extendedResult, extendedConfig = value.extendedConfig); + } + else { + extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); + if (!extendedResult.parseDiagnostics.length) { + var extendedDirname = ts.getDirectoryPath(extendedConfigPath); + extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors, extendedConfigCache); + if (isSuccessfulParsedTsconfig(extendedConfig)) { + // Update the paths to reflect base path + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); + var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; + var mapPropertiesInRawIfNotUndefined = function (propertyName) { + if (raw_2[propertyName]) { + raw_2[propertyName] = ts.map(raw_2[propertyName], updatePath_1); + } + }; + var raw_2 = extendedConfig.raw; + mapPropertiesInRawIfNotUndefined("include"); + mapPropertiesInRawIfNotUndefined("exclude"); + mapPropertiesInRawIfNotUndefined("files"); + } + } + if (extendedConfigCache) { + extendedConfigCache.set(path, { extendedResult: extendedResult, extendedConfig: extendedConfig }); + } + } if (sourceFile) { sourceFile.extendedSourceFiles = [extendedResult.fileName]; + if (extendedResult.extendedSourceFiles) { + (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); + } } if (extendedResult.parseDiagnostics.length) { errors.push.apply(errors, extendedResult.parseDiagnostics); return undefined; } - var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); - if (sourceFile && extendedResult.extendedSourceFiles) { - (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); - } - if (isSuccessfulParsedTsconfig(extendedConfig)) { - // Update the paths to reflect base path - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); - var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; - var mapPropertiesInRawIfNotUndefined = function (propertyName) { - if (raw_2[propertyName]) { - raw_2[propertyName] = ts.map(raw_2[propertyName], updatePath_1); - } - }; - var raw_2 = extendedConfig.raw; - mapPropertiesInRawIfNotUndefined("include"); - mapPropertiesInRawIfNotUndefined("exclude"); - mapPropertiesInRawIfNotUndefined("files"); - } return extendedConfig; } function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { @@ -26116,11 +26328,22 @@ var ts; return !!compilerOptions.traceResolution && host.trace !== undefined; } ts.isTraceEnabled = isTraceEnabled; - function withPackageId(packageId, r) { + function withPackageId(packageInfo, r) { + var packageId; + if (r && packageInfo) { + var packageJsonContent = packageInfo.packageJsonContent; + if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") { + packageId = { + name: packageJsonContent.name, + subModuleName: r.path.slice(packageInfo.packageDirectory.length + ts.directorySeparator.length), + version: packageJsonContent.version + }; + } + } return r && { path: r.path, extension: r.ext, packageId: packageId }; } function noPackageId(r) { - return withPackageId(/*packageId*/ undefined, r); + return withPackageId(/*packageInfo*/ undefined, r); } function removeIgnoredPackageId(r) { if (r) { @@ -26172,8 +26395,15 @@ var ts; } function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { var fileName = readPackageJsonField(jsonContent, fieldName, "string", state); - if (fileName === undefined) + if (fileName === undefined) { + return; + } + if (!fileName) { + if (state.traceEnabled) { + trace(state.host, ts.Diagnostics.package_json_had_a_falsy_0_field, fieldName); + } return; + } var path = ts.normalizePath(ts.combinePaths(baseDirectory, fileName)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path); @@ -26326,7 +26556,12 @@ var ts; var fileName = resolved.fileName, packageId = resolved.packageId; var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); if (traceEnabled) { - trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary); + if (packageId) { + trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, resolvedFileName, ts.packageIdToString(packageId), primary); + } + else { + trace(host, ts.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary); + } } resolvedTypeReferenceDirective = { primary: primary, resolvedFileName: resolvedFileName, packageId: packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) }; } @@ -26428,20 +26663,28 @@ var ts; return result; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; - function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { - return createModuleResolutionCacheWithMaps(createCacheWithRedirects(), createCacheWithRedirects(), currentDirectory, getCanonicalFileName); + function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) { + return createModuleResolutionCacheWithMaps(createCacheWithRedirects(options), createCacheWithRedirects(options), currentDirectory, getCanonicalFileName); } ts.createModuleResolutionCache = createModuleResolutionCache; /*@internal*/ - function createCacheWithRedirects() { + function createCacheWithRedirects(options) { var ownMap = ts.createMap(); var redirectsMap = ts.createMap(); return { ownMap: ownMap, redirectsMap: redirectsMap, getOrCreateMapOfCacheRedirects: getOrCreateMapOfCacheRedirects, - clear: clear + clear: clear, + setOwnOptions: setOwnOptions, + setOwnMap: setOwnMap }; + function setOwnOptions(newOptions) { + options = newOptions; + } + function setOwnMap(newOwnMap) { + ownMap = newOwnMap; + } function getOrCreateMapOfCacheRedirects(redirectedReference) { if (!redirectedReference) { return ownMap; @@ -26449,7 +26692,8 @@ var ts; var path = redirectedReference.sourceFile.path; var redirects = redirectsMap.get(path); if (!redirects) { - redirects = ts.createMap(); + // Reuse map if redirected reference map uses same resolution + redirects = !options || ts.optionsHaveModuleResolutionChanges(options, redirectedReference.commandLine.options) ? ts.createMap() : ownMap; redirectsMap.set(path, redirects); } return redirects; @@ -26462,7 +26706,7 @@ var ts; ts.createCacheWithRedirects = createCacheWithRedirects; /*@internal*/ function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) { - return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; + return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, directoryToModuleNameMap: directoryToModuleNameMap, moduleNameToDirectoryMap: moduleNameToDirectoryMap }; function getOrCreateCacheForDirectory(directoryName, redirectedReference) { var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, ts.createMap); @@ -26605,7 +26849,12 @@ var ts; } if (traceEnabled) { if (result.resolvedModule) { - trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); + if (result.resolvedModule.packageId) { + trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName, result.resolvedModule.resolvedFileName, ts.packageIdToString(result.resolvedModule.packageId)); + } + else { + trace(host, ts.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); + } } else { trace(host, ts.Diagnostics.Module_name_0_was_not_resolved, moduleName); @@ -26875,10 +27124,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state); if (resolvedFromFile) { - var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; - var packageInfo = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, /*onlyRecordFailures*/ false, state); - var packageId = packageInfo && packageInfo.packageId; - return withPackageId(packageId, resolvedFromFile); + var packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageInfo = packageDirectory ? getPackageJsonInfo(packageDirectory, /*onlyRecordFailures*/ false, state) : undefined; + return withPackageId(packageInfo, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -26904,11 +27152,10 @@ var ts; * (Not neeeded for `loadModuleFromNodeModules` as that looks up the `package.json` as part of resolution.) * * packageDirectory is the directory of the package itself. - * subModuleName is the path within the package. - * For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "index.d.ts" }. (Part before "/node_modules/" is ignored.) - * For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. - * For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar/index.d.ts" }. - * For `/node_modules/foo/bar/index.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + * For `blah/node_modules/foo/index.d.ts` this is packageDirectory: "foo" + * For `/node_modules/foo/bar.d.ts` this is packageDirectory: "foo" + * For `/node_modules/@types/foo/bar/index.d.ts` this is packageDirectory: "@types/foo" + * For `/node_modules/foo/bar/index.d.ts` this is packageDirectory: "foo" */ function parseNodeModuleFromPath(resolved) { var path = ts.normalizePath(resolved.path); @@ -26921,26 +27168,12 @@ var ts; if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) { indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); } - var packageDirectory = path.slice(0, indexAfterPackageName); - var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts" /* Dts */; - return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + return path.slice(0, indexAfterPackageName); } function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; } - function addExtensionAndIndex(path) { - if (path === "") { - return "index.d.ts"; - } - if (ts.endsWith(path, ".d.ts")) { - return path; - } - if (path === "index" || ts.endsWith(path, "/index")) { - return path + ".d.ts"; - } - return path + "/index.d.ts"; - } function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) { return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state)); } @@ -27014,52 +27247,22 @@ var ts; } function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson) { if (considerPackageJson === void 0) { considerPackageJson = true; } - var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, "", onlyRecordFailures, state) : undefined; - var packageId = packageInfo && packageInfo.packageId; + var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined; var packageJsonContent = packageInfo && packageInfo.packageJsonContent; - var versionPaths = packageJsonContent && readPackageJsonTypesVersionPaths(packageJsonContent, state); - return withPackageId(packageId, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)); + var versionPaths = packageInfo && packageInfo.versionPaths; + return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)); } - function getPackageJsonInfo(packageDirectory, subModuleName, onlyRecordFailures, state) { + function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && ts.directoryProbablyExists(packageDirectory, host); var packageJsonPath = ts.combinePaths(packageDirectory, "package.json"); if (directoryExists && host.fileExists(packageJsonPath)) { var packageJsonContent = ts.readJson(packageJsonPath, host); - if (subModuleName === "") { // looking up the root - need to handle types/typings/main redirects for subModuleName - var path = readPackageJsonTypesFields(packageJsonContent, packageDirectory, state); - if (typeof path === "string") { - subModuleName = addExtensionAndIndex(path.substring(packageDirectory.length + 1)); - } - else { - var jsPath = readPackageJsonMainField(packageJsonContent, packageDirectory, state); - if (typeof jsPath === "string" && jsPath.length > packageDirectory.length) { - var potentialSubModule_1 = jsPath.substring(packageDirectory.length + 1); - subModuleName = (ts.forEach(ts.supportedJSExtensions, function (extension) { - return ts.tryRemoveExtension(potentialSubModule_1, extension); - }) || potentialSubModule_1) + ".d.ts" /* Dts */; - } - else { - subModuleName = "index.d.ts"; - } - } - } - if (!ts.endsWith(subModuleName, ".d.ts" /* Dts */)) { - subModuleName = addExtensionAndIndex(subModuleName); - } - var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state); - var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" - ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } - : undefined; if (traceEnabled) { - if (packageId) { - trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); - } - else { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); } - return { packageJsonContent: packageJsonContent, packageId: packageId, versionPaths: versionPaths }; + var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state); + return { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths }; } else { if (directoryExists && traceEnabled) { @@ -27198,37 +27401,31 @@ var ts; function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state) { var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName)); // First look for a nested package.json, as in `node_modules/foo/bar/package.json`. - var packageJsonContent; - var packageId; - var versionPaths; - var packageInfo = getPackageJsonInfo(candidate, "", !nodeModulesDirectoryExists, state); + var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state); if (packageInfo) { - (packageJsonContent = packageInfo.packageJsonContent, packageId = packageInfo.packageId, versionPaths = packageInfo.versionPaths); var fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state); if (fromFile) { return noPackageId(fromFile); } - var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageJsonContent, versionPaths); - return withPackageId(packageId, fromDirectory); + var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions, candidate, !nodeModulesDirectoryExists, state, packageInfo.packageJsonContent, packageInfo.versionPaths); + return withPackageId(packageInfo, fromDirectory); } var loader = function (extensions, candidate, onlyRecordFailures, state) { var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) || - loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths); - return withPackageId(packageId, pathAndExtension); + loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths); + return withPackageId(packageInfo, pathAndExtension); }; var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest; if (rest !== "") { // If "rest" is empty, we just did this search above. var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName); // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings. - var packageInfo_1 = getPackageJsonInfo(packageDirectory, rest, !nodeModulesDirectoryExists, state); - if (packageInfo_1) - (packageId = packageInfo_1.packageId, versionPaths = packageInfo_1.versionPaths); - if (versionPaths) { + packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state); + if (packageInfo && packageInfo.versionPaths) { if (state.traceEnabled) { - trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, ts.version, rest); + trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.versionPaths.version, ts.version, rest); } var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host); - var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, versionPaths.paths, loader, !packageDirectoryExists, state); + var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.versionPaths.paths, loader, !packageDirectoryExists, state); if (fromPaths) { return fromPaths.value; } @@ -27396,24 +27593,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 245 /* ModuleBlock */: { + case 246 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -27435,9 +27632,9 @@ var ts; }); return state_1; } - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return getModuleInstanceState(node); - case 72 /* Identifier */: + case 73 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should // be considered the same as type alias if (node.isInJSDocNamespace) { @@ -27603,7 +27800,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 === 254 /* ExportAssignment */) { + if (node.kind === 255 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -27612,7 +27809,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 149 /* ComputedPropertyName */) { + if (name.kind === 150 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -27624,36 +27821,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 157 /* Constructor */: + case 158 /* Constructor */: return "__constructor" /* Constructor */; - case 165 /* FunctionType */: - case 160 /* CallSignature */: - case 298 /* JSDocSignature */: + case 166 /* FunctionType */: + case 161 /* CallSignature */: + case 299 /* JSDocSignature */: return "__call" /* Call */; - case 166 /* ConstructorType */: - case 161 /* ConstructSignature */: + case 167 /* ConstructorType */: + case 162 /* ConstructSignature */: return "__new" /* New */; - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: return "__index" /* Index */; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 284 /* SourceFile */: + case 285 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 151 /* Parameter */: + case 152 /* 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 === 294 /* 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 === 295 /* 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; @@ -27753,7 +27950,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 === 254 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 255 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -27788,7 +27985,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 257 /* ExportSpecifier */ || (node.kind === 248 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 258 /* ExportSpecifier */ || (node.kind === 249 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -27855,7 +28052,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 !== 197 /* ArrowFunction */) { + if (node.kind !== 198 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -27888,7 +28085,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 === 157 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 158 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -27902,13 +28099,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 157 /* Constructor */) { + if (node.kind === 158 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -27952,8 +28149,8 @@ var ts; } } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 239 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 239 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 240 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 240 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -27986,78 +28183,78 @@ var ts; return; } switch (node.kind) { - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: bindWhileStatement(node); break; - case 223 /* DoStatement */: + case 224 /* DoStatement */: bindDoStatement(node); break; - case 225 /* ForStatement */: + case 226 /* ForStatement */: bindForStatement(node); break; - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 222 /* IfStatement */: + case 223 /* IfStatement */: bindIfStatement(node); break; - case 230 /* ReturnStatement */: - case 234 /* ThrowStatement */: + case 231 /* ReturnStatement */: + case 235 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: + case 230 /* BreakStatement */: + case 229 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 235 /* TryStatement */: + case 236 /* TryStatement */: bindTryStatement(node); break; - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: bindSwitchStatement(node); break; - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: bindCaseBlock(node); break; - case 271 /* CaseClause */: + case 272 /* CaseClause */: bindCaseClause(node); break; - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: bindLabeledStatement(node); break; - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 191 /* CallExpression */: + case 192 /* CallExpression */: bindCallExpressionFlow(node); break; - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 284 /* SourceFile */: { + case 285 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 218 /* Block */: - case 245 /* ModuleBlock */: + case 219 /* Block */: + case 246 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; default: @@ -28068,26 +28265,26 @@ var ts; } function isNarrowingExpression(expr) { switch (expr.kind) { - case 72 /* Identifier */: - case 100 /* ThisKeyword */: - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 73 /* Identifier */: + case 101 /* ThisKeyword */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return isNarrowableReference(expr); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return hasNarrowableArgument(expr); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return expr.operator === 52 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 199 /* TypeOfExpression */: + case 200 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 72 /* Identifier */ || expr.kind === 100 /* ThisKeyword */ || expr.kind === 98 /* SuperKeyword */ || + return expr.kind === 73 /* Identifier */ || expr.kind === 101 /* ThisKeyword */ || expr.kind === 99 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || ts.isElementAccessExpression(expr) && expr.argumentExpression && (ts.isStringLiteral(expr.argumentExpression) || ts.isNumericLiteral(expr.argumentExpression)) && @@ -28102,7 +28299,7 @@ var ts; } } } - if (expr.expression.kind === 189 /* PropertyAccessExpression */ && + if (expr.expression.kind === 190 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } @@ -28116,7 +28313,7 @@ var ts; } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: return isNarrowableReference(expr.left); case 33 /* EqualsEqualsToken */: case 34 /* ExclamationEqualsToken */: @@ -28124,9 +28321,9 @@ var ts; case 36 /* ExclamationEqualsEqualsToken */: return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); - case 94 /* InstanceOfKeyword */: + case 95 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); - case 93 /* InKeyword */: + case 94 /* InKeyword */: return isNarrowableInOperands(expr.left, expr.right); case 27 /* CommaToken */: return isNarrowingExpression(expr.right); @@ -28135,11 +28332,11 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: switch (expr.operatorToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: return isNarrowableOperand(expr.left); case 27 /* CommaToken */: return isNarrowableOperand(expr.right); @@ -28176,8 +28373,8 @@ var ts; if (!expression) { return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow; } - if (expression.kind === 102 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || - expression.kind === 87 /* FalseKeyword */ && flags & 32 /* TrueCondition */) { + if (expression.kind === 103 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || + expression.kind === 88 /* FalseKeyword */ && flags & 32 /* TrueCondition */) { return unreachableFlow; } if (!isNarrowingExpression(expression)) { @@ -28215,33 +28412,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 222 /* IfStatement */: - case 224 /* WhileStatement */: - case 223 /* DoStatement */: + case 223 /* IfStatement */: + case 225 /* WhileStatement */: + case 224 /* DoStatement */: return parent.expression === node; - case 225 /* ForStatement */: - case 205 /* ConditionalExpression */: + case 226 /* ForStatement */: + case 206 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 195 /* ParenthesizedExpression */) { + if (node.kind === 196 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 202 /* PrefixUnaryExpression */ && node.operator === 52 /* ExclamationToken */) { + else if (node.kind === 203 /* PrefixUnaryExpression */ && node.operator === 52 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 204 /* BinaryExpression */ && (node.operatorToken.kind === 54 /* AmpersandAmpersandToken */ || + return node.kind === 205 /* BinaryExpression */ && (node.operatorToken.kind === 54 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 55 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 195 /* ParenthesizedExpression */ || - node.parent.kind === 202 /* PrefixUnaryExpression */ && + while (node.parent.kind === 196 /* ParenthesizedExpression */ || + node.parent.kind === 203 /* PrefixUnaryExpression */ && node.parent.operator === 52 /* ExclamationToken */) { node = node.parent; } @@ -28283,7 +28480,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 233 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 234 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -28317,13 +28514,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 227 /* ForOfStatement */) { + if (node.kind === 228 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 238 /* VariableDeclarationList */) { + if (node.initializer.kind !== 239 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -28345,7 +28542,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 230 /* ReturnStatement */) { + if (node.kind === 231 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -28365,7 +28562,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 229 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 230 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -28493,7 +28690,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 272 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 273 /* 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). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -28560,14 +28757,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { errorOrSuggestionOnNode(ts.unusedLabelIsError(options), node.label, ts.Diagnostics.Unused_label); } - if (!node.statement || node.statement.kind !== 223 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 224 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 204 /* BinaryExpression */ && node.operatorToken.kind === 59 /* EqualsToken */) { + if (node.kind === 205 /* BinaryExpression */ && node.operatorToken.kind === 60 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -28578,10 +28775,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 187 /* ArrayLiteralExpression */) { + else if (node.kind === 188 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 208 /* SpreadElement */) { + if (e.kind === 209 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -28589,16 +28786,16 @@ var ts; } } } - else if (node.kind === 188 /* ObjectLiteralExpression */) { + else if (node.kind === 189 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 275 /* PropertyAssignment */) { + if (p.kind === 276 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 276 /* ShorthandPropertyAssignment */) { + else if (p.kind === 277 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 277 /* SpreadAssignment */) { + else if (p.kind === 278 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -28654,7 +28851,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 59 /* EqualsToken */ && node.left.kind === 190 /* ElementAccessExpression */) { + if (operator === 60 /* EqualsToken */ && node.left.kind === 191 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -28665,7 +28862,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 189 /* PropertyAccessExpression */) { + if (node.expression.kind === 190 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -28713,10 +28910,10 @@ 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 = node.expression; - while (expr.kind === 195 /* ParenthesizedExpression */) { + while (expr.kind === 196 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 196 /* FunctionExpression */ || expr.kind === 197 /* ArrowFunction */) { + if (expr.kind === 197 /* FunctionExpression */ || expr.kind === 198 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -28724,7 +28921,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 189 /* PropertyAccessExpression */) { + if (node.expression.kind === 190 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -28733,54 +28930,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 209 /* ClassExpression */: - case 240 /* ClassDeclaration */: - case 243 /* EnumDeclaration */: - case 188 /* ObjectLiteralExpression */: - case 168 /* TypeLiteral */: - case 297 /* JSDocTypeLiteral */: - case 268 /* JsxAttributes */: + case 210 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: + case 189 /* ObjectLiteralExpression */: + case 169 /* TypeLiteral */: + case 298 /* JSDocTypeLiteral */: + case 269 /* JsxAttributes */: return 1 /* IsContainer */; - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 244 /* ModuleDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 181 /* MappedType */: + case 245 /* ModuleDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 182 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 284 /* SourceFile */: + case 285 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 157 /* Constructor */: - case 239 /* FunctionDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 160 /* CallSignature */: - case 298 /* JSDocSignature */: - case 294 /* JSDocFunctionType */: - case 165 /* FunctionType */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: - case 166 /* ConstructorType */: + case 158 /* Constructor */: + case 240 /* FunctionDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 161 /* CallSignature */: + case 299 /* JSDocSignature */: + case 295 /* JSDocFunctionType */: + case 166 /* FunctionType */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: + case 167 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 274 /* CatchClause */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 246 /* CaseBlock */: + case 275 /* CatchClause */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 247 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 218 /* Block */: + case 219 /* 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 @@ -28813,45 +29010,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 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 284 /* SourceFile */: + case 285 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 209 /* ClassExpression */: - case 240 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 241 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 168 /* TypeLiteral */: - case 297 /* JSDocTypeLiteral */: - case 188 /* ObjectLiteralExpression */: - case 241 /* InterfaceDeclaration */: - case 268 /* JsxAttributes */: + case 169 /* TypeLiteral */: + case 298 /* JSDocTypeLiteral */: + case 189 /* ObjectLiteralExpression */: + case 242 /* InterfaceDeclaration */: + case 269 /* 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 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 298 /* JSDocSignature */: - case 162 /* IndexSignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 294 /* JSDocFunctionType */: - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: - case 242 /* TypeAliasDeclaration */: - case 181 /* MappedType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 299 /* JSDocSignature */: + case 163 /* IndexSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 295 /* JSDocFunctionType */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: + case 243 /* TypeAliasDeclaration */: + case 182 /* 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 @@ -28872,16 +29069,8 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 284 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 284 /* SourceFile */ || body.kind === 245 /* ModuleBlock */)) { - for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { - var stat = _a[_i]; - if (stat.kind === 255 /* ExportDeclaration */ || stat.kind === 254 /* ExportAssignment */) { - return true; - } - } - } - return false; + var body = ts.isSourceFile(node) ? node : ts.tryCast(node.body, ts.isModuleBlock); + return !!body && body.statements.some(function (s) { return ts.isExportDeclaration(s) || ts.isExportAssignment(s); }); } function setExportContextFlag(node) { // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular @@ -28960,7 +29149,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 277 /* SpreadAssignment */ || prop.name.kind !== 72 /* Identifier */) { + if (prop.kind === 278 /* SpreadAssignment */ || prop.name.kind !== 73 /* Identifier */) { continue; } var identifier = prop.name; @@ -28972,7 +29161,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 === 275 /* PropertyAssignment */ || prop.kind === 276 /* ShorthandPropertyAssignment */ || prop.kind === 156 /* MethodDeclaration */ + var currentKind = prop.kind === 276 /* PropertyAssignment */ || prop.kind === 277 /* ShorthandPropertyAssignment */ || prop.kind === 157 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -29004,10 +29193,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 284 /* SourceFile */: + case 285 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -29038,7 +29227,7 @@ var ts; currentFlow = { flags: 2 /* Start */ }; parent = typeAlias; bind(typeAlias.typeExpression); - if (!typeAlias.fullName || typeAlias.fullName.kind === 72 /* Identifier */) { + if (!typeAlias.fullName || typeAlias.fullName.kind === 73 /* Identifier */) { parent = typeAlias.parent; bindBlockScopedDeclaration(typeAlias, 524288 /* TypeAlias */, 67897832 /* TypeAliasExcludes */); } @@ -29056,8 +29245,8 @@ var ts; // check for reserved words used as identifiers in strict mode code. function checkStrictModeIdentifier(node) { if (inStrictMode && - node.originalKeywordKind >= 109 /* FirstFutureReservedWord */ && - node.originalKeywordKind <= 117 /* LastFutureReservedWord */ && + node.originalKeywordKind >= 110 /* FirstFutureReservedWord */ && + node.originalKeywordKind <= 118 /* LastFutureReservedWord */ && !ts.isIdentifierName(node) && !(node.flags & 4194304 /* Ambient */)) { // Report error only if there are no parse errors in file @@ -29093,7 +29282,7 @@ var ts; } function checkStrictModeDeleteExpression(node) { // Grammar checking - if (inStrictMode && node.expression.kind === 72 /* Identifier */) { + if (inStrictMode && node.expression.kind === 73 /* Identifier */) { // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its // UnaryExpression is a direct reference to a variable, function argument, or function name var span = ts.getErrorSpanForNode(file, node.expression); @@ -29104,7 +29293,7 @@ var ts; return ts.isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments"); } function checkStrictModeEvalOrArguments(contextNode, name) { - if (name && name.kind === 72 /* Identifier */) { + if (name && name.kind === 73 /* Identifier */) { var identifier = name; if (isEvalOrArgumentsIdentifier(identifier)) { // We check first if the name is inside class declaration or class expression; if so give explicit message @@ -29145,8 +29334,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 284 /* SourceFile */ && - blockScopeContainer.kind !== 244 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 285 /* SourceFile */ && + blockScopeContainer.kind !== 245 /* 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. @@ -29241,7 +29430,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 > 147 /* LastToken */) { + if (node.kind > 148 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -29303,7 +29492,7 @@ var ts; function bindWorker(node) { switch (node.kind) { /* Strict mode checks */ - case 72 /* Identifier */: + case 73 /* Identifier */: // for typedef type names with namespaces, bind the new jsdoc type symbol here // because it requires all containing namespaces to be in effect, namely the // current "blockScopeContainer" needs to be set to its immediate namespace parent. @@ -29316,13 +29505,13 @@ var ts; break; } // falls through - case 100 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 276 /* ShorthandPropertyAssignment */)) { + case 101 /* ThisKeyword */: + if (currentFlow && (ts.isExpression(node) || parent.kind === 277 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -29336,7 +29525,7 @@ var ts; declareSymbol(file.locals, /*parent*/ undefined, node.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 67220414 /* FunctionScopedVariableExcludes */); } break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -29364,76 +29553,76 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return checkStrictModeCatchClause(node); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return checkStrictModeWithStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 178 /* ThisType */: + case 179 /* ThisType */: seenThisKeyword = true; return; - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: break; // Binding the children will handle everything - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return bindTypeParameter(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return bindParameter(node); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 186 /* BindingElement */: + case 187 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return bindPropertyWorker(node); - case 275 /* PropertyAssignment */: - case 276 /* ShorthandPropertyAssignment */: + case 276 /* PropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 278 /* EnumMember */: + case 279 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 68008959 /* EnumMemberExcludes */); - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* 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 */ : 67212223 /* MethodExcludes */); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 157 /* Constructor */: + case 158 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 67154879 /* GetAccessorExcludes */); - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 67187647 /* SetAccessorExcludes */); - case 165 /* FunctionType */: - case 294 /* JSDocFunctionType */: - case 298 /* JSDocSignature */: - case 166 /* ConstructorType */: + case 166 /* FunctionType */: + case 295 /* JSDocFunctionType */: + case 299 /* JSDocSignature */: + case 167 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 168 /* TypeLiteral */: - case 297 /* JSDocTypeLiteral */: - case 181 /* MappedType */: + case 169 /* TypeLiteral */: + case 298 /* JSDocTypeLiteral */: + case 182 /* MappedType */: return bindAnonymousTypeWorker(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return bindFunctionExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -29452,64 +29641,64 @@ var ts; } break; // Members of classes, interfaces, and modules - case 209 /* ClassExpression */: - case 240 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 241 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 67897736 /* InterfaceExcludes */); - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 67897832 /* TypeAliasExcludes */); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return bindJsxAttributes(node); - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 248 /* ImportEqualsDeclaration */: - case 251 /* NamespaceImport */: - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: + case 249 /* ImportEqualsDeclaration */: + case 252 /* NamespaceImport */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 250 /* ImportClause */: + case 251 /* ImportClause */: return bindImportClause(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return bindExportDeclaration(node); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return bindExportAssignment(node); - case 284 /* SourceFile */: + case 285 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 218 /* Block */: + case 219 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 304 /* JSDocParameterTag */: - if (node.parent.kind === 298 /* JSDocSignature */) { + case 305 /* JSDocParameterTag */: + if (node.parent.kind === 299 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 297 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 298 /* JSDocTypeLiteral */) { break; } // falls through - case 310 /* JSDocPropertyTag */: + case 311 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 293 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 294 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -29653,11 +29842,11 @@ var ts; ts.Debug.assert(ts.isInJSFile(node)); var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 197 /* 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 === 59 /* EqualsToken */) { + if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 60 /* EqualsToken */) { var l = thisContainer.parent.left; if (ts.isPropertyAccessEntityNameExpression(l) && ts.isPrototypeAccess(l.expression)) { constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer); @@ -29670,18 +29859,18 @@ var ts; declareSymbol(constructorSymbol.members, constructorSymbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); } break; - case 157 /* Constructor */: - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 158 /* Constructor */: + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; var symbolTable = ts.hasModifier(thisContainer, 32 /* Static */) ? containingClass.symbol.exports : containingClass.symbol.members; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */, 0 /* None */, /*isReplaceableByMethod*/ true); break; - case 284 /* SourceFile */: + case 285 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (thisContainer.commonJsModuleIndicator) { declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); @@ -29691,14 +29880,14 @@ var ts; } break; default: - ts.Debug.fail(ts.Debug.showSyntaxKind(thisContainer)); + ts.Debug.failBadSyntaxKind(thisContainer); } } function bindSpecialPropertyDeclaration(node) { - if (node.expression.kind === 100 /* ThisKeyword */) { + if (node.expression.kind === 101 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 284 /* SourceFile */) { + else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 285 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -29735,7 +29924,7 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 284 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 285 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } @@ -29749,7 +29938,7 @@ var ts; // Fix up parent pointers since we're going to use these nodes before we bind into them node.left.parent = node; node.right.parent = node; - if (ts.isIdentifier(lhs.expression) && container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, lhs.expression)) { + if (ts.isIdentifier(lhs.expression) && container === file && isExportsOrModuleExportsOrAlias(file, lhs.expression)) { // This can be an alias for the 'exports' or 'module.exports' names, e.g. // var util = module.exports; // util.property = function ... @@ -29802,8 +29991,8 @@ var ts; function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) { var namespaceSymbol = lookupSymbolForPropertyAccess(name); var isToplevel = ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 284 /* SourceFile */ - : propertyAccess.parent.parent.kind === 284 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 285 /* SourceFile */ + : propertyAccess.parent.parent.kind === 285 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty); bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty); } @@ -29862,9 +30051,7 @@ var ts; } else { var s = forEachIdentifierInEntityName(e.expression, parent, action); - if (!s || !s.exports) - return ts.Debug.fail(); - return action(e.name, s.exports.get(e.name.escapedText), s); + return action(e.name, s && s.exports && s.exports.get(e.name.escapedText), s); } } function bindCallExpression(node) { @@ -29875,7 +30062,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 240 /* ClassDeclaration */) { + if (node.kind === 241 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 68008383 /* ClassExcludes */); } else { @@ -29941,7 +30128,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 304 /* JSDocParameterTag */ && container.kind !== 298 /* JSDocSignature */) { + if (node.kind === 305 /* JSDocParameterTag */ && container.kind !== 299 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 4194304 /* Ambient */)) { @@ -30018,7 +30205,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 67635688 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 176 /* InferType */) { + else if (node.parent.kind === 177 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -30046,11 +30233,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 220 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 221 /* EmptyStatement */) || // report error on class declarations - node.kind === 240 /* ClassDeclaration */ || + node.kind === 241 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 244 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 245 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -30094,32 +30281,41 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: return true; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return ts.hasModifier(s, 2048 /* Const */); default: return false; } } function isExportsOrModuleExportsOrAlias(sourceFile, node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + var i = 0; + var q = [node]; + while (q.length && i < 100) { + i++; + node = q.shift(); + if (ts.isExportsIdentifier(node) || ts.isModuleExportsPropertyAccessExpression(node)) { + return true; + } + else if (ts.isIdentifier(node)) { + 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); + if (ts.isAssignmentExpression(init, /*excludeCompoundAssignment*/ true)) { + q.push(init.left); + q.push(init.right); + } + } + } + } + return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { - var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); - return !!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - !!symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { - return isExportsOrModuleExportsOrAlias(sourceFile, node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); - } function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { @@ -30139,58 +30335,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 191 /* CallExpression */: + case 192 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 151 /* Parameter */: + case 152 /* Parameter */: return computeParameter(node, subtreeFlags); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 157 /* Constructor */: + case 158 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -30212,7 +30408,7 @@ var ts; transformFlags |= 2048 /* ContainsLexicalThis */; } } - if (expression.kind === 92 /* ImportKeyword */) { + if (expression.kind === 93 /* ImportKeyword */) { transformFlags |= 524288 /* ContainsDynamicImport */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -30235,17 +30431,17 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 59 /* EqualsToken */ && leftKind === 188 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 60 /* EqualsToken */ && leftKind === 189 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ES2018 if they contain rest transformFlags |= 16 /* AssertES2018 */ | 128 /* AssertES2015 */ | 512 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 59 /* EqualsToken */ && leftKind === 187 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 60 /* EqualsToken */ && leftKind === 188 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 128 /* AssertES2015 */ | 512 /* AssertDestructuringAssignment */; } else if (operatorTokenKind === 41 /* AsteriskAsteriskToken */ - || operatorTokenKind === 63 /* AsteriskAsteriskEqualsToken */) { + || operatorTokenKind === 64 /* AsteriskAsteriskEqualsToken */) { // Exponentiation is ES2016 syntax. transformFlags |= 64 /* AssertES2016 */; } @@ -30288,8 +30484,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 212 /* AsExpression */ - || expressionKind === 194 /* TypeAssertionExpression */) { + if (expressionKind === 213 /* AsExpression */ + || expressionKind === 195 /* TypeAssertionExpression */) { transformFlags |= 1 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; @@ -30331,11 +30527,11 @@ var ts; function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; switch (node.token) { - case 86 /* ExtendsKeyword */: + case 87 /* ExtendsKeyword */: // An `extends` HeritageClause is ES6 syntax. transformFlags |= 128 /* AssertES2015 */; break; - case 109 /* ImplementsKeyword */: + case 110 /* ImplementsKeyword */: // An `implements` HeritageClause is TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; @@ -30528,7 +30724,7 @@ var ts; var transformFlags = subtreeFlags; // If a PropertyAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { // super inside of an async function requires hoisting the super access (ES2017). // same for super inside of an async generator, which is ES2018. transformFlags |= 32 /* ContainsES2017 */ | 16 /* ContainsES2018 */; @@ -30540,7 +30736,7 @@ var ts; var transformFlags = subtreeFlags; // If an ElementAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { // super inside of an async function requires hoisting the super access (ES2017). // same for super inside of an async generator, which is ES2018. transformFlags |= 32 /* ContainsES2017 */ | 16 /* ContainsES2018 */; @@ -30628,43 +30824,43 @@ var ts; var transformFlags = subtreeFlags; var excludeFlags = 536870912 /* NodeExcludes */; switch (kind) { - case 121 /* AsyncKeyword */: - case 201 /* AwaitExpression */: + case 122 /* AsyncKeyword */: + case 202 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ES2018 syntax (for async generators) transformFlags |= 16 /* AssertES2018 */ | 32 /* AssertES2017 */; break; - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: - case 313 /* PartiallyEmittedExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: + case 314 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; excludeFlags = 536870912 /* OuterExpressionExcludes */; break; - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 118 /* AbstractKeyword */: - case 125 /* DeclareKeyword */: - case 77 /* ConstKeyword */: - case 243 /* EnumDeclaration */: - case 278 /* EnumMember */: - case 213 /* NonNullExpression */: - case 133 /* ReadonlyKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 119 /* AbstractKeyword */: + case 126 /* DeclareKeyword */: + case 78 /* ConstKeyword */: + case 244 /* EnumDeclaration */: + case 279 /* EnumMember */: + case 214 /* NonNullExpression */: + case 134 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */; break; - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - case 262 /* JsxOpeningElement */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: case 11 /* JsxText */: - case 263 /* JsxClosingElement */: - case 264 /* JsxFragment */: - case 265 /* JsxOpeningFragment */: - case 266 /* JsxClosingFragment */: - case 267 /* JsxAttribute */: - case 268 /* JsxAttributes */: - case 269 /* JsxSpreadAttribute */: - case 270 /* JsxExpression */: + case 264 /* JsxClosingElement */: + case 265 /* JsxFragment */: + case 266 /* JsxOpeningFragment */: + case 267 /* JsxClosingFragment */: + case 268 /* JsxAttribute */: + case 269 /* JsxAttributes */: + case 270 /* JsxSpreadAttribute */: + case 271 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 2 /* AssertJsx */; break; @@ -30672,11 +30868,11 @@ var ts; case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: - case 206 /* TemplateExpression */: - case 193 /* TaggedTemplateExpression */: - case 276 /* ShorthandPropertyAssignment */: - case 116 /* StaticKeyword */: - case 214 /* MetaProperty */: + case 207 /* TemplateExpression */: + case 194 /* TaggedTemplateExpression */: + case 277 /* ShorthandPropertyAssignment */: + case 117 /* StaticKeyword */: + case 215 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 128 /* AssertES2015 */; break; @@ -30693,103 +30889,103 @@ var ts; case 9 /* BigIntLiteral */: transformFlags |= 4 /* AssertESNext */; break; - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 16 /* AssertES2018 */; } transformFlags |= 128 /* AssertES2015 */; break; - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 16 /* AssertES2018 */ | 128 /* AssertES2015 */ | 131072 /* ContainsYield */; break; - case 120 /* AnyKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 132 /* NeverKeyword */: - case 136 /* ObjectKeyword */: - case 138 /* StringKeyword */: - case 123 /* BooleanKeyword */: - case 139 /* SymbolKeyword */: - case 106 /* VoidKeyword */: - case 150 /* TypeParameter */: - case 153 /* PropertySignature */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: - case 163 /* TypePredicate */: - case 164 /* TypeReference */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 167 /* TypeQuery */: - case 168 /* TypeLiteral */: - case 169 /* ArrayType */: - case 170 /* TupleType */: - case 171 /* OptionalType */: - case 172 /* RestType */: - case 173 /* UnionType */: - case 174 /* IntersectionType */: - case 175 /* ConditionalType */: - case 176 /* InferType */: - case 177 /* ParenthesizedType */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 178 /* ThisType */: - case 179 /* TypeOperator */: - case 180 /* IndexedAccessType */: - case 181 /* MappedType */: - case 182 /* LiteralType */: - case 247 /* NamespaceExportDeclaration */: + case 121 /* AnyKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 133 /* NeverKeyword */: + case 137 /* ObjectKeyword */: + case 139 /* StringKeyword */: + case 124 /* BooleanKeyword */: + case 140 /* SymbolKeyword */: + case 107 /* VoidKeyword */: + case 151 /* TypeParameter */: + case 154 /* PropertySignature */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: + case 164 /* TypePredicate */: + case 165 /* TypeReference */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 168 /* TypeQuery */: + case 169 /* TypeLiteral */: + case 170 /* ArrayType */: + case 171 /* TupleType */: + case 172 /* OptionalType */: + case 173 /* RestType */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: + case 176 /* ConditionalType */: + case 177 /* InferType */: + case 178 /* ParenthesizedType */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 179 /* ThisType */: + case 180 /* TypeOperator */: + case 181 /* IndexedAccessType */: + case 182 /* MappedType */: + case 183 /* LiteralType */: + case 248 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 1 /* AssertTypeScript */; excludeFlags = -2 /* TypeExcludes */; break; - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. transformFlags |= 16384 /* ContainsComputedPropertyName */; break; - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: transformFlags |= 128 /* AssertES2015 */ | 4096 /* ContainsRestOrSpread */; break; - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: transformFlags |= 16 /* AssertES2018 */ | 8192 /* ContainsObjectRestOrSpread */; break; - case 98 /* SuperKeyword */: + case 99 /* SuperKeyword */: // This node is ES6 syntax. transformFlags |= 128 /* AssertES2015 */; excludeFlags = 536870912 /* OuterExpressionExcludes */; // must be set to persist `Super` break; - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 2048 /* ContainsLexicalThis */; break; - case 184 /* ObjectBindingPattern */: + case 185 /* ObjectBindingPattern */: transformFlags |= 128 /* AssertES2015 */ | 65536 /* ContainsBindingPattern */; if (subtreeFlags & 4096 /* ContainsRestOrSpread */) { transformFlags |= 16 /* AssertES2018 */ | 8192 /* ContainsObjectRestOrSpread */; } excludeFlags = 536875008 /* BindingPatternExcludes */; break; - case 185 /* ArrayBindingPattern */: + case 186 /* ArrayBindingPattern */: transformFlags |= 128 /* AssertES2015 */ | 65536 /* ContainsBindingPattern */; excludeFlags = 536875008 /* BindingPatternExcludes */; break; - case 186 /* BindingElement */: + case 187 /* BindingElement */: transformFlags |= 128 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 4096 /* ContainsRestOrSpread */; } break; - case 152 /* Decorator */: + case 153 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 1 /* AssertTypeScript */ | 1024 /* ContainsTypeScriptClassSyntax */; break; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: excludeFlags = 536896512 /* ObjectLiteralExcludes */; if (subtreeFlags & 16384 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -30802,26 +30998,26 @@ var ts; transformFlags |= 16 /* AssertES2018 */; } break; - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: excludeFlags = 536875008 /* ArrayLiteralOrCallOrNewExcludes */; break; - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 32768 /* ContainsBlockScopedBinding */) { transformFlags |= 128 /* AssertES2015 */; } break; - case 284 /* SourceFile */: + case 285 /* SourceFile */: break; - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: // Return statements may require an `await` in ES2018. transformFlags |= 262144 /* ContainsHoistedDeclarationOrCompletion */ | 16 /* AssertES2018 */; break; - case 228 /* ContinueStatement */: - case 229 /* BreakStatement */: + case 229 /* ContinueStatement */: + case 230 /* BreakStatement */: transformFlags |= 262144 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -30839,67 +31035,67 @@ var ts; * than calling this function. */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) { + if (kind >= 164 /* FirstTypeNode */ && kind <= 184 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 187 /* ArrayLiteralExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 188 /* ArrayLiteralExpression */: return 536875008 /* ArrayLiteralOrCallOrNewExcludes */; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return 537168896 /* ModuleExcludes */; - case 151 /* Parameter */: + case 152 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return 537371648 /* ArrowFunctionExcludes */; - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: return 537373696 /* FunctionExcludes */; - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return 536944640 /* VariableDeclarationListExcludes */; - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: return 536888320 /* ClassExcludes */; - case 157 /* Constructor */: + case 158 /* Constructor */: return 537372672 /* ConstructorExcludes */; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return 537372672 /* MethodOrAccessorExcludes */; - case 120 /* AnyKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 132 /* NeverKeyword */: - case 138 /* StringKeyword */: - case 136 /* ObjectKeyword */: - case 123 /* BooleanKeyword */: - case 139 /* SymbolKeyword */: - case 106 /* VoidKeyword */: - case 150 /* TypeParameter */: - case 153 /* PropertySignature */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 121 /* AnyKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 133 /* NeverKeyword */: + case 139 /* StringKeyword */: + case 137 /* ObjectKeyword */: + case 124 /* BooleanKeyword */: + case 140 /* SymbolKeyword */: + case 107 /* VoidKeyword */: + case 151 /* TypeParameter */: + case 154 /* PropertySignature */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return 536896512 /* ObjectLiteralExcludes */; - case 274 /* CatchClause */: + case 275 /* CatchClause */: return 536879104 /* CatchClauseExcludes */; - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: return 536875008 /* BindingPatternExcludes */; - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: - case 313 /* PartiallyEmittedExpression */: - case 195 /* ParenthesizedExpression */: - case 98 /* SuperKeyword */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: + case 314 /* PartiallyEmittedExpression */: + case 196 /* ParenthesizedExpression */: + case 99 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -31074,7 +31270,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 === 167 /* TypeQuery */) { + if (d.type && d.type.kind === 168 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -31173,8 +31369,6 @@ var ts; undefinedSymbol.declarations = []; var globalThisSymbol = createSymbol(1536 /* Module */, "globalThis", 8 /* Readonly */); globalThisSymbol.exports = globals; - globalThisSymbol.valueDeclaration = ts.createNode(72 /* Identifier */); - globalThisSymbol.valueDeclaration.escapedText = "globalThis"; globals.set(globalThisSymbol.escapedName, globalThisSymbol); var argumentsSymbol = createSymbol(4 /* Property */, "arguments"); var requireSymbol = createSymbol(4 /* Property */, "require"); @@ -31190,6 +31384,11 @@ var ts; getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, getTypeCount: function () { return typeCount; }, + getRelationCacheSizes: function () { return ({ + assignable: assignableRelation.size, + identity: identityRelation.size, + subtype: subtypeRelation.size, + }); }, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, isUnknownSymbol: function (symbol) { return symbol === unknownSymbol; }, @@ -31256,6 +31455,10 @@ var ts; node = ts.getParseTreeNode(node); return node ? getTypeOfNode(node) : errorType; }, + getTypeOfAssignmentPattern: function (nodeIn) { + var node = ts.getParseTreeNode(nodeIn, ts.isAssignmentPattern); + return node && getTypeOfAssignmentPattern(node) || errorType; + }, getPropertySymbolOfDestructuringAssignment: function (locationIn) { var location = ts.getParseTreeNode(locationIn, ts.isIdentifier); return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined; @@ -31304,11 +31507,11 @@ var ts; }, isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: function (node, candidatesOutArray, agumentCount) { - return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, 0 /* Normal */); + getResolvedSignature: function (node, candidatesOutArray, argumentCount) { + return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */); }, - getResolvedSignatureForSignatureHelp: function (node, candidatesOutArray, agumentCount) { - return getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, 16 /* IsForSignatureHelp */); + getResolvedSignatureForSignatureHelp: function (node, candidatesOutArray, argumentCount) { + return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */); }, getExpandedParameters: getExpandedParameters, hasEffectiveRestParameter: hasEffectiveRestParameter, @@ -31451,7 +31654,7 @@ var ts; var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); - var conditionalTypes = ts.createMap(); + var substitutionTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); @@ -31461,10 +31664,10 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); - var undefinedType = createNullableType(32768 /* Undefined */, "undefined", 0); - var undefinedWideningType = strictNullChecks ? undefinedType : createNullableType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */); - var nullType = createNullableType(65536 /* Null */, "null", 0); - var nullWideningType = strictNullChecks ? nullType : createNullableType(65536 /* Null */, "null", 131072 /* ContainsWideningType */); + var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */); + var nullType = createIntrinsicType(65536 /* Null */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */); var stringType = createIntrinsicType(4 /* String */, "string"); var numberType = createIntrinsicType(8 /* Number */, "number"); var bigintType = createIntrinsicType(64 /* BigInt */, "bigint"); @@ -31490,6 +31693,7 @@ var ts; var voidType = createIntrinsicType(16384 /* Void */, "void"); var neverType = createIntrinsicType(131072 /* Never */, "never"); var silentNeverType = createIntrinsicType(131072 /* Never */, "never"); + var nonInferrableType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */); var implicitNeverType = createIntrinsicType(131072 /* Never */, "never"); var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object"); var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); @@ -31506,7 +31710,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.objectFlags |= 524288 /* ContainsAnyFunctionType */; + anyFunctionType.objectFlags |= 524288 /* NonInferrableType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -31530,6 +31734,7 @@ var ts; * This is only used if there is no exact match. */ var patternAmbientModules; + var patternAmbientModuleAugmentations; var globalObjectType; var globalFunctionType; var globalCallableFunctionType; @@ -31564,8 +31769,7 @@ var ts; var deferredGlobalTemplateStringsArrayType; var deferredGlobalImportMetaType; var deferredGlobalExtractSymbol; - var deferredGlobalExcludeSymbol; - var deferredGlobalPickSymbol; + var deferredGlobalOmitSymbol; var deferredGlobalBigIntType; var allPotentiallyUnusedIdentifiers = ts.createMap(); // key is file name var flowLoopStart = 0; @@ -31584,6 +31788,8 @@ var ts; var symbolLinks = []; var nodeLinks = []; var flowLoopCaches = []; + var flowAssignmentKeys = []; + var flowAssignmentTypes = []; var flowLoopNodes = []; var flowLoopKeys = []; var flowLoopTypes = []; @@ -31700,6 +31906,7 @@ var ts; var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; + var outofbandVarianceMarkerHandler; var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); @@ -31724,6 +31931,18 @@ var ts; CheckMode[CheckMode["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; CheckMode[CheckMode["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; })(CheckMode || (CheckMode = {})); + var ContextFlags; + (function (ContextFlags) { + ContextFlags[ContextFlags["None"] = 0] = "None"; + ContextFlags[ContextFlags["Signature"] = 1] = "Signature"; + })(ContextFlags || (ContextFlags = {})); + var AccessFlags; + (function (AccessFlags) { + AccessFlags[AccessFlags["None"] = 0] = "None"; + AccessFlags[AccessFlags["NoIndexSignatures"] = 1] = "NoIndexSignatures"; + AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; + AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; + })(AccessFlags || (AccessFlags = {})); var CallbackCheck; (function (CallbackCheck) { CallbackCheck[CallbackCheck["None"] = 0] = "None"; @@ -31898,7 +32117,8 @@ var ts; * Note: if target is transient, then it is mutable, and mergeSymbol with both mutate and return it. * If target is not transient, mergeSymbol will produce a transient clone, mutate that and return it. */ - function mergeSymbol(target, source) { + function mergeSymbol(target, source, unidirectional) { + if (unidirectional === void 0) { unidirectional = false; } if (!(target.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); @@ -31926,17 +32146,24 @@ var ts; if (source.members) { if (!target.members) target.members = ts.createSymbolTable(); - mergeSymbolTable(target.members, source.members); + mergeSymbolTable(target.members, source.members, unidirectional); } if (source.exports) { if (!target.exports) target.exports = ts.createSymbolTable(); - mergeSymbolTable(target.exports, source.exports); + mergeSymbolTable(target.exports, source.exports, unidirectional); + } + if (!unidirectional) { + recordMergedSymbol(target, source); } - recordMergedSymbol(target, source); } else if (target.flags & 1024 /* NamespaceModule */) { - error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + // Do not report an error when merging `var globalThis` with the built-in `globalThis`, + // as we will already report a "Declaration name conflicts..." error, and this error + // won't make much sense. + if (target !== globalThisSymbol) { + error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); + } } else { // error var isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */); @@ -32001,10 +32228,11 @@ var ts; mergeSymbolTable(combined, second); return combined; } - function mergeSymbolTable(target, source) { + function mergeSymbolTable(target, source, unidirectional) { + if (unidirectional === void 0) { unidirectional = false; } source.forEach(function (sourceSymbol, id) { var targetSymbol = target.get(id); - target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol) : sourceSymbol); + target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : sourceSymbol); }); } function mergeModuleAugmentation(moduleName) { @@ -32025,14 +32253,29 @@ var ts; var moduleNotFoundError = !(moduleName.parent.parent.flags & 4194304 /* Ambient */) ? ts.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found : undefined; - var mainModule = resolveExternalModuleNameWorker(moduleName, moduleName, moduleNotFoundError, /*isForAugmentation*/ true); - if (!mainModule) { + var mainModule_1 = resolveExternalModuleNameWorker(moduleName, moduleName, moduleNotFoundError, /*isForAugmentation*/ true); + if (!mainModule_1) { return; } // obtain item referenced by 'export=' - mainModule = resolveExternalModuleSymbol(mainModule); - if (mainModule.flags & 1920 /* Namespace */) { - mainModule = mergeSymbol(mainModule, moduleAugmentation.symbol); + mainModule_1 = resolveExternalModuleSymbol(mainModule_1); + if (mainModule_1.flags & 1920 /* Namespace */) { + // If we’re merging an augmentation to a pattern ambient module, we want to + // perform the merge unidirectionally from the augmentation ('a.foo') to + // the pattern ('*.foo'), so that 'getMergedSymbol()' on a.foo gives you + // all the exports both from the pattern and from the augmentation, but + // 'getMergedSymbol()' on *.foo only gives you exports from *.foo. + if (ts.some(patternAmbientModules, function (module) { return mainModule_1 === module.symbol; })) { + var merged = mergeSymbol(moduleAugmentation.symbol, mainModule_1, /*unidirectional*/ true); + if (!patternAmbientModuleAugmentations) { + patternAmbientModuleAugmentations = ts.createMap(); + } + // moduleName will be a StringLiteral since this is not `declare global`. + patternAmbientModuleAugmentations.set(moduleName.text, merged); + } + else { + mergeSymbol(mainModule_1, moduleAugmentation.symbol); + } } else { // moduleName will be a StringLiteral since this is not `declare global`. @@ -32066,7 +32309,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 284 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 285 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -32124,17 +32367,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 186 /* BindingElement */) { + if (declaration.kind === 187 /* 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, 186 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 187 /* 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, 237 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 238 /* VariableDeclaration */), usage); } - else if (declaration.kind === 237 /* VariableDeclaration */) { + else if (declaration.kind === 238 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -32142,6 +32385,10 @@ var ts; // still might be illegal if the usage is within a computed property name in the class (eg class A { static p = "a"; [A.p]() {} }) return !ts.findAncestor(usage, function (n) { return ts.isComputedPropertyName(n) && n.parent.parent === declaration; }); } + else if (ts.isPropertyDeclaration(declaration)) { + // still might be illegal if a self-referencing property initializer (eg private x = this.x) + return !isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage); + } return true; } // declaration is after usage, but it can still be legal if usage is deferred: @@ -32153,12 +32400,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 === 257 /* ExportSpecifier */ || (usage.parent.kind === 254 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 258 /* ExportSpecifier */ || (usage.parent.kind === 255 /* 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 === 254 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 255 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -32166,9 +32413,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 219 /* VariableStatement */: - case 225 /* ForStatement */: - case 227 /* ForOfStatement */: + case 220 /* VariableStatement */: + case 226 /* ForStatement */: + case 228 /* 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, container)) { @@ -32189,16 +32436,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 154 /* PropertyDeclaration */ && + current.parent.kind === 155 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 156 /* MethodDeclaration */) { + if (declaration.kind === 157 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 154 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 155 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -32207,6 +32454,36 @@ var ts; return false; }); } + function isPropertyImmediatelyReferencedWithinDeclaration(declaration, usage) { + // always legal if usage is after declaration + if (usage.end > declaration.end) { + return false; + } + // still might be legal if usage is deferred (e.g. x: any = () => this.x) + // otherwise illegal if immediately referenced within the declaration (e.g. x: any = this.x) + var ancestorChangingReferenceScope = ts.findAncestor(usage, function (node) { + if (node === declaration) { + return "quit"; + } + switch (node.kind) { + case 198 /* ArrowFunction */: + case 155 /* PropertyDeclaration */: + return true; + case 219 /* Block */: + switch (node.parent.kind) { + case 159 /* GetAccessor */: + case 157 /* MethodDeclaration */: + case 160 /* SetAccessor */: + return true; + default: + return false; + } + default: + return false; + } + }); + return ancestorChangingReferenceScope === undefined; + } } /** * Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and @@ -32225,6 +32502,8 @@ var ts; var lastLocation; var lastSelfReferenceLocation; var propertyWithInvalidInitializer; + var associatedDeclarationForContainingInitializer; + var withinDeferredContext = false; var errorLocation = location; var grandparent; var isInExternalModule = false; @@ -32240,12 +32519,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 & 67897832 /* Type */ && lastLocation.kind !== 296 /* JSDocComment */) { + if (meaning & result.flags & 67897832 /* Type */ && lastLocation.kind !== 297 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 151 /* Parameter */ || - lastLocation.kind === 150 /* TypeParameter */ + lastLocation.kind === 152 /* Parameter */ || + lastLocation.kind === 151 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -32262,13 +32541,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 === 151 /* Parameter */ || + lastLocation.kind === 152 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 175 /* ConditionalType */) { + else if (location.kind === 176 /* 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; @@ -32281,15 +32560,16 @@ var ts; } } } + withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 284 /* SourceFile */: + case 285 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 284 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 285 /* SourceFile */ || ts.isAmbientModule(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 */)) { @@ -32313,7 +32593,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 257 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 258 /* ExportSpecifier */)) { break; } } @@ -32327,20 +32607,19 @@ var ts; } } break; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* 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 // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. - if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32 /* Static */)) { + if (!ts.hasModifier(location, 32 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & 67220415 /* Value */)) { @@ -32350,9 +32629,9 @@ var ts; } } break; - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* 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! @@ -32371,7 +32650,7 @@ var ts; } break loop; } - if (location.kind === 209 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 210 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -32379,9 +32658,9 @@ var ts; } } break; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. - if (lastLocation === location.expression && location.parent.token === 86 /* ExtendsKeyword */) { + if (lastLocation === location.expression && location.parent.token === 87 /* ExtendsKeyword */) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67897832 /* Type */))) { if (nameNotFoundMessage) { @@ -32399,9 +32678,9 @@ var ts; // [foo<T>()]() { } // <-- Reference to T from class's own computed property // } // - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 241 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 242 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67897832 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -32409,24 +32688,24 @@ var ts; } } break; - case 197 /* ArrowFunction */: + case 198 /* 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 156 /* MethodDeclaration */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -32439,7 +32718,7 @@ var ts; } } break; - case 152 /* Decorator */: + case 153 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -32448,7 +32727,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 === 151 /* Parameter */) { + if (location.parent && location.parent.kind === 152 /* Parameter */) { location = location.parent; } // @@ -32463,15 +32742,28 @@ 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<T> {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 240 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 241 /* ClassDeclaration */)) { location = location.parent; } break; - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; + case 152 /* Parameter */: + if (lastLocation && lastLocation === location.initializer) { + associatedDeclarationForContainingInitializer = location; + } + break; + case 187 /* BindingElement */: + if (lastLocation && lastLocation === location.initializer) { + var root = ts.getRootDeclaration(location); + if (root.kind === 152 /* Parameter */) { + associatedDeclarationForContainingInitializer = location; + } + } + break; } if (isSelfReferenceLocation(location)) { lastSelfReferenceLocation = location; @@ -32487,7 +32779,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 284 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 285 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -32563,20 +32855,48 @@ var ts; if (result && isInExternalModule && (meaning & 67220415 /* Value */) === 67220415 /* Value */ && !(originalLocation.flags & 2097152 /* JSDoc */)) { var merged = getMergedSymbol(result); if (ts.length(merged.declarations) && ts.every(merged.declarations, function (d) { return ts.isNamespaceExportDeclaration(d) || ts.isSourceFile(d) && !!d.symbol.globalExports; })) { - error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); // TODO: GH#18217 + errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); + } + } + // If we're in a parameter initializer, we can't reference the values of the parameter whose initializer we're within or parameters to the right + if (result && associatedDeclarationForContainingInitializer && !withinDeferredContext && (meaning & 67220415 /* Value */) === 67220415 /* Value */) { + var candidate = getMergedSymbol(getLateBoundSymbol(result)); + var root = ts.getRootDeclaration(associatedDeclarationForContainingInitializer); + // A parameter initializer or binding pattern initializer within a parameter cannot refer to itself + if (candidate === getSymbolOfNode(associatedDeclarationForContainingInitializer)) { + error(errorLocation, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(associatedDeclarationForContainingInitializer.name)); + } + // And it cannot refer to any declarations which come after it + else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializer.pos && root.parent.locals && lookup(root.parent.locals, candidate.escapedName, meaning) === candidate) { + error(errorLocation, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(associatedDeclarationForContainingInitializer.name), ts.declarationNameToString(errorLocation)); } } } return result; } + function getIsDeferredContext(location, lastLocation) { + if (location.kind !== 198 /* ArrowFunction */ && location.kind !== 197 /* 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 === 155 /* PropertyDeclaration */ && !ts.hasModifier(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; + } + // generator functions and async functions are not inlined in control flow when immediately invoked + if (location.asteriskToken || ts.hasModifier(location, 256 /* Async */)) { + return true; + } + return !ts.getImmediatelyInvokedFunctionExpression(location); + } function isSelfReferenceLocation(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 244 /* ModuleDeclaration */: // For `namespace N { N; }` + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 245 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -32588,7 +32908,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 === 150 /* TypeParameter */) { + if (decl.kind === 151 /* 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 @@ -32643,10 +32963,10 @@ var ts; */ function getEntityNameForExtendingInterface(node) { switch (node.kind) { - case 72 /* Identifier */: - case 189 /* PropertyAccessExpression */: + case 73 /* Identifier */: + case 190 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -32735,7 +33055,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // 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 === 243 /* EnumDeclaration */) || ts.isInJSFile(d) && !!ts.getJSDocEnumTag(d); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 244 /* EnumDeclaration */) || ts.isInJSFile(d) && !!ts.getJSDocEnumTag(d); }); if (declaration === undefined) return ts.Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 4194304 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -32770,13 +33090,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return node; - case 250 /* ImportClause */: + case 251 /* ImportClause */: return node.parent; - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: return node.parent.parent; - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -32786,7 +33106,7 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 259 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 260 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); @@ -32843,7 +33163,16 @@ var ts; var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); if (!exportDefaultSymbol && !hasSyntheticDefault) { - error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); + if (hasExportAssignmentSymbol(moduleSymbol)) { + var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; + var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */); + var exportAssignment = exportEqualsSymbol.valueDeclaration; + var err = error(node.name, ts.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString(moduleSymbol), compilerOptionName); + ts.addRelatedInfo(err, ts.createDiagnosticForNode(exportAssignment, ts.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName)); + } + else { + error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); + } } else if (hasSyntheticDefault) { // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present @@ -32978,20 +33307,20 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 250 /* ImportClause */: + case 251 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 257 /* ExportSpecifier */: + case 258 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 67220415 /* Value */ | 67897832 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 254 /* ExportAssignment */: - case 204 /* BinaryExpression */: + case 255 /* ExportAssignment */: + case 205 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); default: return ts.Debug.fail(); @@ -33052,11 +33381,11 @@ var ts; var node = getDeclarationOfAliasSymbol(symbol); if (!node) return ts.Debug.fail(); - if (node.kind === 254 /* ExportAssignment */) { + if (node.kind === 255 /* ExportAssignment */) { // export default <symbol> checkExpressionCached(node.expression); } - else if (node.kind === 257 /* ExportSpecifier */) { + else if (node.kind === 258 /* ExportSpecifier */) { // export { <symbol> } or export { <symbol> as foo } checkExpressionCached(node.propertyName || node.name); } @@ -33074,17 +33403,17 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (entityName.kind === 72 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 73 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 72 /* Identifier */ || entityName.parent.kind === 148 /* QualifiedName */) { + if (entityName.kind === 73 /* Identifier */ || entityName.parent.kind === 149 /* 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 === 248 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 249 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 67220415 /* Value */ | 67897832 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -33100,17 +33429,17 @@ var ts; } var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJSFile(name) ? meaning & 67220415 /* Value */ : 0); var symbol; - if (name.kind === 72 /* Identifier */) { - var message = meaning === namespaceMeaning ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name).escapedText); + if (name.kind === 73 /* Identifier */) { + var message = meaning === namespaceMeaning ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name)); var symbolFromJSPrototype = ts.isInJSFile(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined; symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true); if (!symbol) { return symbolFromJSPrototype; } } - else if (name.kind === 148 /* QualifiedName */ || name.kind === 189 /* PropertyAccessExpression */) { - var left = name.kind === 148 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 148 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 149 /* QualifiedName */ || name.kind === 190 /* PropertyAccessExpression */) { + var left = name.kind === 149 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 149 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -33245,6 +33574,14 @@ var ts; if (patternAmbientModules) { var pattern = ts.findBestPatternMatch(patternAmbientModules, function (_) { return _.pattern; }, moduleReference); if (pattern) { + // If the module reference matched a pattern ambient module ('*.foo') but there’s also a + // module augmentation by the specific name requested ('a.foo'), we store the merged symbol + // by the augmentation name ('a.foo'), because asking for *.foo should not give you exports + // from a.foo. + var augmentation = patternAmbientModuleAugmentations && patternAmbientModuleAugmentations.get(moduleReference); + if (augmentation) { + return getMergedSymbol(augmentation); + } return getMergedSymbol(pattern.symbol); } } @@ -33335,7 +33672,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 284 /* SourceFile */)) { + if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 285 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -33597,7 +33934,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 157 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 158 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -33608,13 +33945,10 @@ var ts; result.id = typeCount; return result; } - function createIntrinsicType(kind, intrinsicName) { + function createIntrinsicType(kind, intrinsicName, objectFlags) { + if (objectFlags === void 0) { objectFlags = 0; } var type = createType(kind); type.intrinsicName = intrinsicName; - return type; - } - function createNullableType(kind, intrinsicName, objectFlags) { - var type = createIntrinsicType(kind, intrinsicName); type.objectFlags = objectFlags; return type; } @@ -33646,7 +33980,7 @@ var ts; return type; } // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // or the @ symbol. A third underscore indicates an escaped form of an identifier that started // with at least two underscores. The @ character indicates that the name is denoted by a well known ES // Symbol instance. function isReservedMemberName(name) { @@ -33686,12 +34020,12 @@ var ts; } } switch (location.kind) { - case 284 /* SourceFile */: + case 285 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -33755,7 +34089,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, 257 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 258 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; @@ -33791,7 +34125,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, 257 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 258 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -33806,10 +34140,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: continue; default: return false; @@ -33865,7 +34199,7 @@ var ts; var containers = getContainersOfSymbol(symbol, enclosingDeclaration); // If we're trying to reference some object literal in, eg `var a = { x: 1 }`, the symbol for the literal, `__object`, is distinct // from the symbol of the declaration it is being assigned to. Since we can use the declaration to refer to the literal, however, - // we'd like to make that connection here - potentially causing us to paint the declararation's visibiility, and therefore the literal. + // we'd like to make that connection here - potentially causing us to paint the declaration's visibility, and therefore the literal. var firstDecl = ts.first(symbol.declarations); if (!ts.length(containers) && meaning & 67220415 /* Value */ && firstDecl && ts.isObjectLiteralExpression(firstDecl)) { if (firstDecl.parent && ts.isVariableDeclaration(firstDecl.parent) && firstDecl === firstDecl.parent.initializer) { @@ -33926,10 +34260,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 284 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 285 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 284 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 285 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -33976,14 +34310,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 167 /* TypeQuery */ || + if (entityName.parent.kind === 168 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 149 /* ComputedPropertyName */) { + entityName.parent.kind === 150 /* ComputedPropertyName */) { // Typeof value meaning = 67220415 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 148 /* QualifiedName */ || entityName.kind === 189 /* PropertyAccessExpression */ || - entityName.parent.kind === 248 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 149 /* QualifiedName */ || entityName.kind === 190 /* PropertyAccessExpression */ || + entityName.parent.kind === 249 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -34032,10 +34366,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 166 /* ConstructorType */ : 165 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 167 /* ConstructorType */ : 166 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 162 /* ConstructSignature */ : 161 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -34062,6 +34396,15 @@ var ts; } return result; } + function getTypeNamesForErrorDisplay(left, right) { + var leftStr = typeToString(left); + var rightStr = typeToString(right); + if (leftStr === rightStr) { + leftStr = typeToString(left, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + rightStr = typeToString(right, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + } + return [leftStr, rightStr]; + } function toNodeBuilderFlags(flags) { if (flags === void 0) { flags = 0 /* None */; } return flags & 9469291 /* NodeBuilderFlagsMask */; @@ -34130,26 +34473,26 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return ts.createKeywordTypeNode(121 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.createKeywordTypeNode(143 /* UnknownKeyword */); + return ts.createKeywordTypeNode(144 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(138 /* StringKeyword */); + return ts.createKeywordTypeNode(139 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(135 /* NumberKeyword */); + return ts.createKeywordTypeNode(136 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(146 /* BigIntKeyword */); + return ts.createKeywordTypeNode(147 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; - return ts.createKeywordTypeNode(123 /* BooleanKeyword */); + return ts.createKeywordTypeNode(124 /* BooleanKeyword */); } if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); @@ -34167,8 +34510,9 @@ var ts; return ts.createLiteralTypeNode(ts.setEmitFlags(ts.createLiteral(type.value), 16777216 /* NoAsciiEscaping */)); } if (type.flags & 256 /* NumberLiteral */) { - context.approximateLength += (("" + type.value).length); - return ts.createLiteralTypeNode((ts.createLiteral(type.value))); + var value = type.value; + context.approximateLength += ("" + value).length; + return ts.createLiteralTypeNode(value < 0 ? ts.createPrefix(39 /* MinusToken */, ts.createLiteral(-value)) : ts.createLiteral(value)); } if (type.flags & 2048 /* BigIntLiteral */) { context.approximateLength += (ts.pseudoBigIntToString(type.value).length) + 1; @@ -34189,33 +34533,33 @@ var ts; } } context.approximateLength += 13; - return ts.createTypeOperatorNode(142 /* UniqueKeyword */, ts.createKeywordTypeNode(139 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(143 /* UniqueKeyword */, ts.createKeywordTypeNode(140 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; - return ts.createKeywordTypeNode(106 /* VoidKeyword */); + return ts.createKeywordTypeNode(107 /* VoidKeyword */); } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.createKeywordTypeNode(141 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(142 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; - return ts.createKeywordTypeNode(96 /* NullKeyword */); + return ts.createKeywordTypeNode(97 /* NullKeyword */); } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.createKeywordTypeNode(132 /* NeverKeyword */); + return ts.createKeywordTypeNode(133 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(139 /* SymbolKeyword */); + return ts.createKeywordTypeNode(140 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.createKeywordTypeNode(136 /* ObjectKeyword */); + return ts.createKeywordTypeNode(137 /* ObjectKeyword */); } - if (type.flags & 262144 /* TypeParameter */ && type.isThisType) { + if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) { context.encounteredError = true; @@ -34265,7 +34609,7 @@ var ts; } var typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 173 /* UnionType */ : 174 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 1048576 /* Union */ ? 174 /* UnionType */ : 175 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -34298,8 +34642,8 @@ var ts; context.inferTypeParameters = type.root.inferTypeParameters; var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); context.inferTypeParameters = saveInferTypeParameters; - var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); - var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + var trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context); + var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context); context.approximateLength += 15; return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } @@ -34339,7 +34683,7 @@ var ts; 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 === 209 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 210 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return symbolToTypeNode(symbol, context, 67220415 /* Value */); @@ -34386,7 +34730,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 === 284 /* SourceFile */ || declaration.parent.kind === 245 /* ModuleBlock */; + return declaration.parent.kind === 285 /* SourceFile */ || declaration.parent.kind === 246 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -34407,12 +34751,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 165 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 166 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 166 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 167 /* ConstructorType */, context); return signatureNode; } } @@ -34433,7 +34777,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(133 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.createTypeOperatorNode(134 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -34447,12 +34791,12 @@ var ts; ts.createOptionalTypeNode(tupleConstituentNodes[i]); } var tupleTypeNode = ts.createTupleTypeNode(tupleConstituentNodes); - return type.target.readonly ? ts.createTypeOperatorNode(133 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(134 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.createTupleTypeNode([]); - return type.target.readonly ? ts.createTypeOperatorNode(133 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.createTypeOperatorNode(134 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -34547,11 +34891,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 160 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 162 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -34598,15 +34942,15 @@ var ts; if (!(context.flags & 1 /* NoTruncation */)) { return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return ts.createKeywordTypeNode(121 /* AnyKeyword */); } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 4096 /* ReverseMapped */); + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */); var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; - if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 2048 /* Late */) { + if (context.tracker.trackSymbol && ts.getCheckFlags(propertySymbol) & 4096 /* Late */) { var decl = ts.first(propertySymbol.declarations); if (hasLateBindableName(decl)) { trackComputedName(decl.name, saveEnclosingDeclaration, context); @@ -34620,7 +34964,7 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 155 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 156 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; if (propertySymbol.valueDeclaration) { @@ -34638,10 +34982,10 @@ var ts; propertyTypeNode = createElidedInformationPlaceholder(context); } else { - propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(121 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(134 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -34692,7 +35036,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 138 /* StringKeyword */ : 135 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 139 /* StringKeyword */ : 136 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -34705,7 +35049,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(134 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var typeParameters; @@ -34716,7 +35060,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 157 /* Constructor */); }); + var parameters = getExpandedParameters(signature).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 158 /* Constructor */); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -34735,12 +35079,12 @@ var ts; returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } if (context.flags & 256 /* SuppressAnyReturnType */) { - if (returnTypeNode && returnTypeNode.kind === 120 /* AnyKeyword */) { + if (returnTypeNode && returnTypeNode.kind === 121 /* AnyKeyword */) { returnTypeNode = undefined; } } else if (!returnTypeNode) { - returnTypeNode = ts.createKeywordTypeNode(120 /* AnyKeyword */); + returnTypeNode = ts.createKeywordTypeNode(121 /* AnyKeyword */); } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); @@ -34769,9 +35113,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 151 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 152 /* Parameter */); if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 304 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 305 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -34779,16 +35123,16 @@ var ts; } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined; - var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 16384 /* RestParameter */; + var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 32768 /* RestParameter */; var dotDotDotToken = isRest ? ts.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? - parameterDeclaration.name.kind === 72 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 148 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 73 /* Identifier */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 149 /* QualifiedName */ ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); - var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 8192 /* OptionalParameter */; + var isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */; var questionToken = isOptional ? ts.createToken(56 /* QuestionToken */) : undefined; var parameterNode = ts.createParameter( /*decorators*/ undefined, modifiers, dotDotDotToken, name, questionToken, parameterTypeNode, @@ -34803,7 +35147,7 @@ var ts; } var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 186 /* BindingElement */) { + if (clone.kind === 187 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -34905,6 +35249,11 @@ var ts; function lookupTypeParameterNodes(chain, index, context) { ts.Debug.assert(chain && 0 <= index && index < chain.length); var symbol = chain[index]; + var symbolId = "" + getSymbolId(symbol); + if (context.typeParameterSymbolList && context.typeParameterSymbolList.get(symbolId)) { + return undefined; + } + (context.typeParameterSymbolList || (context.typeParameterSymbolList = ts.createMap())).set(symbolId, true); var typeParameterNodes; if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { var parentSymbol = symbol; @@ -34929,7 +35278,7 @@ var ts; return top; } function getSpecifierForModuleSymbol(symbol, context) { - var file = ts.getDeclarationOfKind(symbol, 284 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 285 /* SourceFile */); if (file && file.moduleName !== undefined) { // Use the amd name if it is available return file.moduleName; @@ -35169,8 +35518,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 177 /* ParenthesizedType */; }); - if (node.kind === 242 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 178 /* ParenthesizedType */; }); + if (node.kind === 243 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -35178,11 +35527,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 245 /* ModuleBlock */ && + node.parent.kind === 246 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 284 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 285 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = symbol.nameType; @@ -35223,7 +35572,7 @@ var ts; if (ts.isCallExpression(declaration) && ts.isBindableObjectDefinePropertyCall(declaration)) { return ts.symbolName(symbol); } - if (ts.isComputedPropertyName(name_2) && !(ts.getCheckFlags(symbol) & 2048 /* Late */) && symbol.nameType && symbol.nameType.flags & 384 /* StringOrNumberLiteral */) { + if (ts.isComputedPropertyName(name_2) && !(ts.getCheckFlags(symbol) & 4096 /* Late */) && symbol.nameType && symbol.nameType.flags & 384 /* StringOrNumberLiteral */) { // Computed property name isn't late bound, but has a well-known name type - use name type to generate a symbol name var result = getNameOfSymbolFromNameType(symbol, context); if (result !== undefined) { @@ -35232,17 +35581,17 @@ var ts; } return ts.declarationNameToString(name_2); } - if (declaration.parent && declaration.parent.kind === 237 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 238 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 209 /* ClassExpression */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 210 /* ClassExpression */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 209 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 210 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -35259,27 +35608,27 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 302 /* JSDocCallbackTag */: - case 309 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: // 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 186 /* BindingElement */: + case 187 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 237 /* VariableDeclaration */: + case 238 /* 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 244 /* ModuleDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 239 /* FunctionDeclaration */: - case 243 /* EnumDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 245 /* ModuleDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 240 /* FunctionDeclaration */: + case 244 /* EnumDeclaration */: + case 249 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -35287,53 +35636,53 @@ 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 !== 248 /* ImportEqualsDeclaration */ && parent.kind !== 284 /* SourceFile */ && parent.flags & 4194304 /* Ambient */)) { + !(node.kind !== 249 /* ImportEqualsDeclaration */ && parent.kind !== 285 /* SourceFile */ && parent.flags & 4194304 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: if (ts.hasModifier(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 157 /* Constructor */: - case 161 /* ConstructSignature */: - case 160 /* CallSignature */: - case 162 /* IndexSignature */: - case 151 /* Parameter */: - case 245 /* ModuleBlock */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 168 /* TypeLiteral */: - case 164 /* TypeReference */: - case 169 /* ArrayType */: - case 170 /* TupleType */: - case 173 /* UnionType */: - case 174 /* IntersectionType */: - case 177 /* ParenthesizedType */: + case 158 /* Constructor */: + case 162 /* ConstructSignature */: + case 161 /* CallSignature */: + case 163 /* IndexSignature */: + case 152 /* Parameter */: + case 246 /* ModuleBlock */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 169 /* TypeLiteral */: + case 165 /* TypeReference */: + case 170 /* ArrayType */: + case 171 /* TupleType */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: + case 178 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 250 /* ImportClause */: - case 251 /* NamespaceImport */: - case 253 /* ImportSpecifier */: + case 251 /* ImportClause */: + case 252 /* NamespaceImport */: + case 254 /* ImportSpecifier */: return false; // Type parameters are always visible - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: // Source file and namespace export are always visible - case 284 /* SourceFile */: - case 247 /* NamespaceExportDeclaration */: + case 285 /* SourceFile */: + case 248 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return false; default: return false; @@ -35342,10 +35691,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 254 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 255 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 67220415 /* Value */ | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 257 /* ExportSpecifier */) { + else if (node.parent.kind === 258 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 67220415 /* Value */ | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -35441,12 +35790,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 237 /* VariableDeclaration */: - case 238 /* VariableDeclarationList */: - case 253 /* ImportSpecifier */: - case 252 /* NamedImports */: - case 251 /* NamespaceImport */: - case 250 /* ImportClause */: + case 238 /* VariableDeclaration */: + case 239 /* VariableDeclarationList */: + case 254 /* ImportSpecifier */: + case 253 /* NamedImports */: + case 252 /* NamespaceImport */: + case 251 /* ImportClause */: return false; default: return true; @@ -35479,7 +35828,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 149 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); + return name.kind === 150 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteralLike(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); }); @@ -35494,13 +35843,11 @@ var ts; if (omitKeyType.flags & 131072 /* Never */) { return source; } - var pickTypeAlias = getGlobalPickSymbol(); - var excludeTypeAlias = getGlobalExcludeSymbol(); - if (!pickTypeAlias || !excludeTypeAlias) { + var omitTypeAlias = getGlobalOmitSymbol(); + if (!omitTypeAlias) { return errorType; } - var pickKeys = getTypeAliasInstantiation(excludeTypeAlias, [getIndexType(source), omitKeyType]); - return getTypeAliasInstantiation(pickTypeAlias, [source, pickKeys]); + return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]); } var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { @@ -35533,7 +35880,7 @@ var ts; if (parentAccess && parentAccess.flowNode) { var propName = getDestructuringPropertyName(node); if (propName) { - var result = ts.createNode(190 /* ElementAccessExpression */, node.pos, node.end); + var result = ts.createNode(191 /* ElementAccessExpression */, node.pos, node.end); result.parent = node; result.expression = parentAccess; var literal = ts.createNode(10 /* StringLiteral */, node.pos, node.end); @@ -35548,23 +35895,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 186 /* BindingElement */: - case 275 /* PropertyAssignment */: + case 187 /* BindingElement */: + case 276 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return ancestor.initializer; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 186 /* BindingElement */ && parent.kind === 184 /* ObjectBindingPattern */) { + if (node.kind === 187 /* BindingElement */ && parent.kind === 185 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 275 /* PropertyAssignment */ || node.kind === 276 /* ShorthandPropertyAssignment */) { + if (node.kind === 276 /* PropertyAssignment */ || node.kind === 277 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -35586,7 +35933,7 @@ var ts; parentType = getNonNullableType(parentType); } var type; - if (pattern.kind === 184 /* ObjectBindingPattern */) { + if (pattern.kind === 185 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -35650,30 +35997,30 @@ var ts; } function isNullOrUndefined(node) { var expr = ts.skipParentheses(node); - return expr.kind === 96 /* NullKeyword */ || expr.kind === 72 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol; + return expr.kind === 97 /* NullKeyword */ || expr.kind === 73 /* Identifier */ && getResolvedSymbol(expr) === undefinedSymbol; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 187 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 188 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function isParameterOfContextuallyTypedFunction(node) { - return node.kind === 151 /* Parameter */ && - (node.parent.kind === 196 /* FunctionExpression */ || node.parent.kind === 197 /* ArrowFunction */) && + return node.kind === 152 /* Parameter */ && + (node.parent.kind === 197 /* FunctionExpression */ || node.parent.kind === 198 /* ArrowFunction */) && !!getContextualType(node.parent); } // Return the inferred type for a variable, parameter, or property declaration 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 === 226 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 227 /* 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 === 227 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 228 /* 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, @@ -35692,7 +36039,7 @@ var ts; return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJSFile(declaration)) && - declaration.kind === 237 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 238 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 4194304 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -35706,11 +36053,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 151 /* Parameter */) { + if (declaration.kind === 152 /* Parameter */) { 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 === 159 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 158 /* GetAccessor */); + if (func.kind === 160 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 159 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -35847,7 +36194,7 @@ var ts; return type; } else if (declaredType !== errorType && type !== errorType && !isTypeIdenticalTo(declaredType, type)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(declaredType, declaration, type); + errorNextVariableOrPropertyDeclarationMustHaveSameType(/*firstDeclaration*/ undefined, declaredType, declaration, type); } } return declaredType; @@ -35914,9 +36261,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 === 157 /* Constructor */ || - thisContainer.kind === 239 /* FunctionDeclaration */ || - (thisContainer.kind === 196 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 158 /* Constructor */ || + thisContainer.kind === 240 /* FunctionDeclaration */ || + (thisContainer.kind === 197 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -35991,7 +36338,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var hasRestElement = !!(lastElement && lastElement.kind === 186 /* BindingElement */ && lastElement.dotDotDotToken); + var hasRestElement = !!(lastElement && lastElement.kind === 187 /* BindingElement */ && lastElement.dotDotDotToken); if (elements.length === 0 || elements.length === 1 && hasRestElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -36014,7 +36361,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 184 /* ObjectBindingPattern */ + return pattern.kind === 185 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -36053,7 +36400,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 151 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 152 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -36115,7 +36462,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 254 /* ExportAssignment */) { + if (declaration.kind === 255 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isInJSFile(declaration) && @@ -36166,7 +36513,7 @@ var ts; type = getTypeOfEnumMember(symbol); } else { - return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol)); + return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.formatSyntaxKind(declaration.kind) + " for " + ts.Debug.formatSymbol(symbol)); } if (!popTypeResolution()) { // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` @@ -36179,7 +36526,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 158 /* GetAccessor */) { + if (accessor.kind === 159 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -36206,8 +36553,8 @@ var ts; return links.type || (links.type = getTypeOfAccessorsWorker(symbol)); } function getTypeOfAccessorsWorker(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 158 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 159 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 159 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 160 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -36250,7 +36597,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 158 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 159 /* GetAccessor */); error(getter_1, 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)); } } @@ -36290,8 +36637,8 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration.kind === 204 /* BinaryExpression */ || - declaration.kind === 189 /* PropertyAccessExpression */ && declaration.parent.kind === 204 /* BinaryExpression */) { + else if (declaration.kind === 205 /* BinaryExpression */ || + declaration.kind === 190 /* PropertyAccessExpression */ && declaration.parent.kind === 205 /* BinaryExpression */) { return getWidenedTypeFromAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -36358,7 +36705,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 151 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 152 /* 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 @@ -36366,11 +36713,23 @@ var ts; // we have already reported an implicit any error so we don't report anything here. return anyType; } + function getTypeOfSymbolWithDeferredType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + ts.Debug.assertDefined(links.deferralParent); + ts.Debug.assertDefined(links.deferralConstituents); + links.type = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralConstituents) : getIntersectionType(links.deferralConstituents); + } + return links.type; + } function getTypeOfSymbol(symbol) { + if (ts.getCheckFlags(symbol) & 65536 /* DeferredType */) { + return getTypeOfSymbolWithDeferredType(symbol); + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (ts.getCheckFlags(symbol) & 4096 /* ReverseMapped */) { + if (ts.getCheckFlags(symbol) & 8192 /* ReverseMapped */) { return getTypeOfReverseMappedSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { @@ -36431,35 +36790,35 @@ var ts; return undefined; } switch (node.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 155 /* MethodSignature */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 294 /* JSDocFunctionType */: - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 242 /* TypeAliasDeclaration */: - case 308 /* JSDocTemplateTag */: - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: - case 181 /* MappedType */: - case 175 /* ConditionalType */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 156 /* MethodSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 295 /* JSDocFunctionType */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 243 /* TypeAliasDeclaration */: + case 309 /* JSDocTemplateTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: + case 182 /* MappedType */: + case 176 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 181 /* MappedType */) { + if (node.kind === 182 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 175 /* ConditionalType */) { + else if (node.kind === 176 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 240 /* ClassDeclaration */ || node.kind === 209 /* ClassExpression */ || node.kind === 241 /* InterfaceDeclaration */) && + (node.kind === 241 /* ClassDeclaration */ || node.kind === 210 /* ClassExpression */ || node.kind === 242 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -36467,7 +36826,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, 241 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 242 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -36476,9 +36835,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 241 /* InterfaceDeclaration */ || - node.kind === 240 /* ClassDeclaration */ || - node.kind === 209 /* ClassExpression */ || + if (node.kind === 242 /* InterfaceDeclaration */ || + node.kind === 241 /* ClassDeclaration */ || + node.kind === 210 /* ClassExpression */ || ts.isTypeAlias(node)) { var declaration = node; result = appendTypeParameters(result, ts.getEffectiveTypeParameterDeclarations(declaration)); @@ -36672,7 +37031,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 === 241 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 242 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -36708,7 +37067,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 241 /* InterfaceDeclaration */) { + if (declaration.kind === 242 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -36765,7 +37124,7 @@ var ts; return errorType; } var declaration = ts.find(symbol.declarations, function (d) { - return ts.isJSDocTypeAlias(d) || d.kind === 242 /* TypeAliasDeclaration */; + return ts.isJSDocTypeAlias(d) || d.kind === 243 /* TypeAliasDeclaration */; }); var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. @@ -36792,7 +37151,7 @@ var ts; if (expr.kind === 10 /* StringLiteral */) { return true; } - else if (expr.kind === 204 /* BinaryExpression */) { + else if (expr.kind === 205 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -36806,12 +37165,12 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return expr.operator === 39 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -36825,7 +37184,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 243 /* EnumDeclaration */) { + if (declaration.kind === 244 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 10 /* StringLiteral */) { @@ -36852,7 +37211,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 243 /* EnumDeclaration */) { + if (declaration.kind === 244 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getFreshTypeOfLiteralType(getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member))); // TODO: GH#18217 @@ -36923,23 +37282,23 @@ var ts; */ function isThislessType(node) { switch (node.kind) { - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 138 /* StringKeyword */: - case 135 /* NumberKeyword */: - case 146 /* BigIntKeyword */: - case 123 /* BooleanKeyword */: - case 139 /* SymbolKeyword */: - case 136 /* ObjectKeyword */: - case 106 /* VoidKeyword */: - case 141 /* UndefinedKeyword */: - case 96 /* NullKeyword */: - case 132 /* NeverKeyword */: - case 182 /* LiteralType */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 139 /* StringKeyword */: + case 136 /* NumberKeyword */: + case 147 /* BigIntKeyword */: + case 124 /* BooleanKeyword */: + case 140 /* SymbolKeyword */: + case 137 /* ObjectKeyword */: + case 107 /* VoidKeyword */: + case 142 /* UndefinedKeyword */: + case 97 /* NullKeyword */: + case 133 /* NeverKeyword */: + case 183 /* LiteralType */: return true; - case 169 /* ArrayType */: + case 170 /* ArrayType */: return isThislessType(node.elementType); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -36965,7 +37324,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 157 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 158 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -36981,14 +37340,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -37089,7 +37448,7 @@ var ts; * members. */ function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { - ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 2048 /* Late */), "Expected a late-bound symbol."); + ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 4096 /* Late */), "Expected a late-bound symbol."); symbol.flags |= symbolFlags; getSymbolLinks(member.symbol).lateSymbol = symbol; if (!symbol.declarations) { @@ -37146,7 +37505,7 @@ var ts; // Get or add a late-bound symbol for the member. This allows us to merge late-bound accessor declarations. var lateSymbol = lateSymbols.get(memberName); if (!lateSymbol) - lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */)); + lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */)); // Report an error if a late-bound member has the same name as an early-bound member, // or if we have another early-bound symbol declaration with the same name and // conflicting flags. @@ -37158,7 +37517,7 @@ var ts; var name_3 = !(type.flags & 8192 /* UniqueESSymbol */) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(decl.name); ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_3); }); error(decl.name || decl, ts.Diagnostics.Duplicate_property_0, name_3); - lateSymbol = createSymbol(0 /* None */, memberName, 2048 /* Late */); + lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */); } lateSymbol.nameType = type; addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); @@ -37223,11 +37582,12 @@ var ts; var links = getSymbolLinks(symbol); if (!links.lateSymbol && ts.some(symbol.declarations, hasLateBindableName)) { // force late binding of members/exports. This will set the late-bound symbol + var parent = getMergedSymbol(symbol.parent); if (ts.some(symbol.declarations, ts.hasStaticModifier)) { - getExportsOfSymbol(symbol.parent); + getExportsOfSymbol(parent); } else { - getMembersOfSymbol(symbol.parent); + getMembersOfSymbol(parent); } } return links.lateSymbol || (links.lateSymbol = symbol); @@ -37344,8 +37704,8 @@ var ts; var tupleRestIndex_1 = restType.target.hasRestElement ? elementTypes.length - 1 : -1; var restParams = ts.map(elementTypes, function (t, i) { var name = getParameterNameAtPosition(sig, restIndex_1 + i); - var checkFlags = i === tupleRestIndex_1 ? 16384 /* RestParameter */ : - i >= minLength_1 ? 8192 /* OptionalParameter */ : 0; + var checkFlags = i === tupleRestIndex_1 ? 32768 /* RestParameter */ : + i >= minLength_1 ? 16384 /* OptionalParameter */ : 0; var symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags); symbol.type = i === tupleRestIndex_1 ? createArrayType(t) : t; return symbol; @@ -37435,10 +37795,10 @@ var ts; // Union the result types when more than one signature matches if (unionSignatures.length > 1) { var thisParameter = signature.thisParameter; - if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - // TODO: GH#18217 We tested that *some* has thisParameter and now act as if *all* do + var firstThisParameterOfUnionSignatures = ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; }); + if (firstThisParameterOfUnionSignatures) { var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2 /* Subtype */); - thisParameter = createSymbolWithType(signature.thisParameter, thisType); + thisParameter = createSymbolWithType(firstThisParameterOfUnionSignatures, thisType); } s = createUnionSignature(signature, unionSignatures); s.thisParameter = thisParameter; @@ -37695,7 +38055,7 @@ var ts; var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { var prop = _a[_i]; - var checkFlags = 4096 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); inferredProp.declarations = prop.declarations; inferredProp.nameType = prop.nameType; @@ -37717,7 +38077,15 @@ var ts; return getIndexType(getApparentType(type.type)); } if (type.flags & 16777216 /* Conditional */) { - return getLowerBoundOfConditionalType(type); + if (type.root.isDistributive) { + var checkType = type.checkType; + var constraint = getLowerBoundOfKeyType(checkType); + if (constraint !== checkType) { + var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + } + } + return type; } if (type.flags & 1048576 /* Union */) { return getUnionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); @@ -37727,16 +38095,6 @@ var ts; } return neverType; } - function getLowerBoundOfConditionalType(type) { - if (type.root.isDistributive) { - var constraint = getLowerBoundOfKeyType(type.checkType); - if (constraint !== type.checkType) { - var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); - return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); - } - } - return type; - } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -37825,8 +38183,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 179 /* TypeOperator */ && - constraintDeclaration.operator === 129 /* KeyOfKeyword */; + return constraintDeclaration.kind === 180 /* TypeOperator */ && + constraintDeclaration.operator === 130 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -37843,7 +38201,7 @@ var ts; var declaredType = getTypeFromMappedTypeNode(type.declaration); var constraint = getConstraintTypeFromMappedType(declaredType); var extendedConstraint = constraint && constraint.flags & 262144 /* TypeParameter */ ? getConstraintOfTypeParameter(constraint) : constraint; - type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType; + type.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 /* Index */ ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : unknownType; } } return type.modifiersType; @@ -37939,6 +38297,26 @@ var ts; } return type.resolvedProperties; } + function getPossiblePropertiesOfUnionType(type) { + if (type.possiblePropertyCache) { + return type.possiblePropertyCache.size ? ts.arrayFrom(type.possiblePropertyCache.values()) : ts.emptyArray; + } + type.possiblePropertyCache = ts.createSymbolTable(); + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + for (var _b = 0, _c = getPropertiesOfType(t); _b < _c.length; _b++) { + var p = _c[_b]; + if (!type.possiblePropertyCache.has(p.escapedName)) { + var prop = getUnionOrIntersectionProperty(type, p.escapedName); + if (prop) { + type.possiblePropertyCache.set(p.escapedName, prop); + } + } + } + } + // We can't simply use the normal property cache here, since that will contain cached apparent type members :( + return type.possiblePropertyCache.size ? ts.arrayFrom(type.possiblePropertyCache.values()) : ts.emptyArray; + } function getPropertiesOfType(type) { type = getApparentType(type); return type.flags & 3145728 /* UnionOrIntersection */ ? @@ -37986,16 +38364,23 @@ var ts; function getConstraintOfIndexedAccess(type) { return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : undefined; } + function getSimplifiedTypeOrConstraint(type) { + var simplified = getSimplifiedType(type, /*writing*/ false); + return simplified !== type ? simplified : getConstraintOfType(type); + } function getConstraintFromIndexedAccess(type) { - var objectType = getConstraintOfType(type.objectType) || type.objectType; - if (objectType !== type.objectType) { - var constraint = getIndexedAccessType(objectType, type.indexType, /*accessNode*/ undefined, errorType); - if (constraint && constraint !== errorType) { - return constraint; + var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); + if (indexConstraint && indexConstraint !== type.indexType) { + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); + if (indexedAccess) { + return indexedAccess; } } - var baseConstraint = getBaseConstraintOfType(type); - return baseConstraint && baseConstraint !== type ? baseConstraint : undefined; + var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); + if (objectConstraint && objectConstraint !== type.objectType) { + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); + } + return undefined; } function getDefaultConstraintOfConditionalType(type) { if (!type.resolvedDefaultConstraint) { @@ -38004,7 +38389,7 @@ var ts; // just `any`. This result is _usually_ unwanted - so instead here we elide an `any` branch from the constraint type, // in effect treating `any` like `never` rather than `unknown` in this location. var trueConstraint = getInferredTrueTypeFromConditionalType(type); - var falseConstraint = type.falseType; + var falseConstraint = getFalseTypeFromConditionalType(type); type.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]); } return type.resolvedDefaultConstraint; @@ -38022,7 +38407,7 @@ var ts; // a union - once negated types exist and are applied to the conditional false branch, this "constraint" // likely doesn't need to exist. if (type.root.isDistributive && type.restrictiveInstantiation !== type) { - var simplified = getSimplifiedType(type.checkType); + var simplified = getSimplifiedType(type.checkType, /*writing*/ false); var constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint && constraint !== type.checkType) { var mapper = makeUnaryTypeMapper(type.root.checkType, constraint); @@ -38053,11 +38438,6 @@ var ts; constraint = getConstraintOfType(constraint); } if (constraint) { - // A constraint that isn't a union type implies that the final type would be a non-union - // type as well. Since non-union constraints are of no interest, we can exit here. - if (!(constraint.flags & 1048576 /* Union */)) { - return undefined; - } constraints = ts.append(constraints, constraint); } } @@ -38066,10 +38446,10 @@ var ts; } } // If the target is a union type or if we are intersecting with types belonging to one of the - // disjoint domans, we may end up producing a constraint that hasn't been examined before. + // disjoint domains, we may end up producing a constraint that hasn't been examined before. if (constraints && (targetIsUnion || hasDisjointDomainType)) { if (hasDisjointDomainType) { - // We add any types belong to one of the disjoint domans because they might cause the final + // 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 _b = 0, _c = type.types; _b < _c.length; _b++) { var t = _c[_b]; @@ -38115,7 +38495,7 @@ var ts; } if (constraintDepth >= 50) { // We have reached 50 recursive invocations of getImmediateBaseConstraint and there is a - // very high likelyhood we're dealing with an infinite generic type that perpetually generates + // 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. error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); @@ -38123,7 +38503,7 @@ var ts; return t.immediateBaseConstraint = noConstraintType; } constraintDepth++; - var result = computeBaseConstraint(getSimplifiedType(t)); + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { @@ -38175,8 +38555,8 @@ var ts; if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType, /*accessNode*/ undefined, errorType) : undefined; - return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined; + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); + return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { var constraint = getConstraintFromConditionalType(t); @@ -38257,17 +38637,18 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : 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 & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : - t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ESNext */) : + t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 8 /* ESNext */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : - t; + t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : + t; } function createUnionOrIntersectionProperty(containingType, name) { var propSet = ts.createMap(); @@ -38275,7 +38656,7 @@ var ts; var isUnion = containingType.flags & 1048576 /* Union */; var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols - var commonFlags = isUnion ? 0 /* None */ : 16777216 /* Optional */; + var optionalFlag = isUnion ? 0 /* None */ : 16777216 /* Optional */; var syntheticFlag = 4 /* SyntheticMethod */; var checkFlags = 0; for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { @@ -38285,16 +38666,21 @@ var ts; var prop = getPropertyOfType(type, name); var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0; if (prop && !(modifiers & excludeModifiers)) { - commonFlags &= prop.flags; + if (isUnion) { + optionalFlag |= (prop.flags & 16777216 /* Optional */); + } + else { + optionalFlag &= prop.flags; + } var id = "" + getSymbolId(prop); if (!propSet.has(id)) { propSet.set(id, prop); } checkFlags |= (isReadonlySymbol(prop) ? 8 /* Readonly */ : 0) | - (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 128 /* ContainsPublic */ : 0) | - (modifiers & 16 /* Protected */ ? 256 /* ContainsProtected */ : 0) | - (modifiers & 8 /* Private */ ? 512 /* ContainsPrivate */ : 0) | - (modifiers & 32 /* Static */ ? 1024 /* ContainsStatic */ : 0); + (!(modifiers & 24 /* NonPublicAccessibilityModifier */) ? 256 /* ContainsPublic */ : 0) | + (modifiers & 16 /* Protected */ ? 512 /* ContainsProtected */ : 0) | + (modifiers & 8 /* Private */ ? 1024 /* ContainsPrivate */ : 0) | + (modifiers & 32 /* Static */ ? 2048 /* ContainsStatic */ : 0); if (!isPrototypeProperty(prop)) { syntheticFlag = 2 /* SyntheticProperty */; } @@ -38303,10 +38689,11 @@ var ts; var indexInfo = !isLateBoundName(name) && (isNumericLiteralName(name) && getIndexInfoOfType(type, 1 /* Number */) || getIndexInfoOfType(type, 0 /* String */)); if (indexInfo) { checkFlags |= indexInfo.isReadonly ? 8 /* Readonly */ : 0; + checkFlags |= 32 /* WritePartial */; indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type); } else { - checkFlags |= 16 /* Partial */; + checkFlags |= 16 /* ReadPartial */; } } } @@ -38315,7 +38702,7 @@ var ts; return undefined; } var props = ts.arrayFrom(propSet.values()); - if (props.length === 1 && !(checkFlags & 16 /* Partial */) && !indexTypes) { + if (props.length === 1 && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) { return props[0]; } var declarations; @@ -38339,15 +38726,15 @@ var ts; nameType = prop.nameType; } else if (type !== firstType) { - checkFlags |= 32 /* HasNonUniformType */; + checkFlags |= 64 /* HasNonUniformType */; } if (isLiteralType(type)) { - checkFlags |= 64 /* HasLiteralType */; + checkFlags |= 128 /* HasLiteralType */; } propTypes.push(type); } ts.addRange(propTypes, indexTypes); - var result = createSymbol(4 /* Property */ | commonFlags, name, syntheticFlag | checkFlags); + var result = createSymbol(4 /* Property */ | optionalFlag, name, syntheticFlag | checkFlags); result.containingType = containingType; if (!hasNonUniformValueDeclaration && firstValueDeclaration) { result.valueDeclaration = firstValueDeclaration; @@ -38358,7 +38745,15 @@ var ts; } result.declarations = declarations; result.nameType = nameType; - result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); + if (propTypes.length > 2) { + // When `propTypes` has the potential to explode in size when normalized, defer normalization until absolutely needed + result.checkFlags |= 65536 /* DeferredType */; + result.deferralParent = containingType; + result.deferralConstituents = propTypes; + } + else { + result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); + } return result; } // Return the symbol for a given property in a union or intersection type, or undefined if the property @@ -38380,7 +38775,7 @@ var ts; function getPropertyOfUnionOrIntersectionType(type, name) { var property = getUnionOrIntersectionProperty(type, name); // We need to filter out partial properties in union types - return property && !(ts.getCheckFlags(property) & 16 /* Partial */) ? property : undefined; + return property && !(ts.getCheckFlags(property) & 16 /* ReadPartial */) ? property : undefined; } /** * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when @@ -38486,10 +38881,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 === 293 /* JSDocOptionalType */ + node.type && node.type.kind === 294 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 293 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 294 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -38523,7 +38918,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 293 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 294 /* JSDocOptionalType */; } function createIdentifierTypePredicate(parameterName, parameterIndex, type) { return { kind: 1 /* Identifier */, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -38561,7 +38956,7 @@ var ts; var baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); for (var i = numTypeArguments; i < numTypeParameters; i++) { var defaultType = getDefaultFromTypeParameter(typeParameters[i]); - if (isJavaScriptImplicitAny && defaultType && isTypeIdenticalTo(defaultType, emptyObjectType)) { + if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType) || isTypeIdenticalTo(defaultType, emptyObjectType))) { defaultType = anyType; } result[i] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result)) : baseDefaultType; @@ -38605,7 +39000,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 182 /* LiteralType */) { + if (type && type.kind === 183 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -38619,16 +39014,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 === 158 /* GetAccessor */ || declaration.kind === 159 /* SetAccessor */) && + if ((declaration.kind === 159 /* GetAccessor */ || declaration.kind === 160 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 158 /* GetAccessor */ ? 159 /* SetAccessor */ : 158 /* GetAccessor */; + var otherKind = declaration.kind === 159 /* GetAccessor */ ? 160 /* SetAccessor */ : 159 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 157 /* Constructor */ ? + var classType = declaration.kind === 158 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -38653,7 +39048,7 @@ var ts; var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); - var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 16384 /* RestParameter */); + var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */); syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType; if (lastParamVariadicType) { // Replace the last parameter with a rest parameter. @@ -38686,13 +39081,13 @@ var ts; if (!node) return false; switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - return node.name.kind === 149 /* ComputedPropertyName */ + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + return node.name.kind === 150 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -38767,7 +39162,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = getTypeFromTypeNode(node.type); - if (parameterName.kind === 72 /* Identifier */) { + if (parameterName.kind === 73 /* Identifier */) { return createIdentifierTypePredicate(parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } else { @@ -38808,7 +39203,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 157 /* Constructor */) { + if (declaration.kind === 158 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -38818,12 +39213,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 158 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 159 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 159 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 160 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -38848,7 +39243,7 @@ var ts; function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) { var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript)); if (inferredTypeParameters) { - var returnSignature = getSingleCallSignature(getReturnTypeOfSignature(instantiatedSignature)); + var returnSignature = getSingleCallOrConstructSignature(getReturnTypeOfSignature(instantiatedSignature)); if (returnSignature) { var newReturnSignature = cloneSignature(returnSignature); newReturnSignature.typeParameters = inferredTypeParameters; @@ -38901,7 +39296,7 @@ var ts; var typeParameters = signature.typeParameters; if (typeParameters) { var typeEraser_1 = createTypeEraser(typeParameters); - var baseConstraints = ts.map(typeParameters, function (tp) { return instantiateType(getBaseConstraintOfType(tp), typeEraser_1) || emptyObjectType; }); + var baseConstraints = ts.map(typeParameters, function (tp) { return instantiateType(getBaseConstraintOfType(tp), typeEraser_1) || unknownType; }); return instantiateSignature(signature, createTypeMapper(typeParameters, baseConstraints), /*eraseTypeParameters*/ true); } return signature; @@ -38912,7 +39307,8 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 157 /* Constructor */ || signature.declaration.kind === 161 /* ConstructSignature */; // TODO: GH#18217 + var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; + var isConstructor = kind === 158 /* Constructor */ || kind === 162 /* ConstructSignature */ || kind === 167 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -38926,7 +39322,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 135 /* NumberKeyword */ : 138 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 136 /* NumberKeyword */ : 139 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -38953,7 +39349,7 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 150 /* TypeParameter */); + var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 151 /* TypeParameter */); return decl && ts.getEffectiveConstraintOfTypeParameter(decl); } function getInferredTypeParameterConstraint(typeParameter) { @@ -38961,13 +39357,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 === 176 /* InferType */) { + if (declaration.parent.kind === 177 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo<infer T>'), 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 grandParent = declaration.parent.parent; - if (grandParent.kind === 164 /* TypeReference */) { + if (grandParent.kind === 165 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { @@ -38992,7 +39388,7 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter // declaration, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 151 /* Parameter */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 152 /* Parameter */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } } @@ -39016,7 +39412,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 150 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 151 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -39149,9 +39545,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return node.typeName; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -39250,16 +39646,22 @@ var ts; } } function getSubstitutionType(typeVariable, substitute) { - if (substitute.flags & 3 /* AnyOrUnknown */) { + if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === typeVariable) { return typeVariable; } + var id = getTypeId(typeVariable) + ">" + getTypeId(substitute); + var cached = substitutionTypes.get(id); + if (cached) { + return cached; + } var result = createType(33554432 /* Substitution */); result.typeVariable = typeVariable; result.substitute = substitute; + substitutionTypes.set(id, result); return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 170 /* TupleType */ && node.elementTypes.length === 1; + return node.kind === 171 /* TupleType */ && node.elementTypes.length === 1; } function getImpliedConstraint(typeVariable, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : @@ -39268,9 +39670,9 @@ var ts; } function getConstrainedTypeVariable(typeVariable, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 296 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 297 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 175 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 176 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -39281,7 +39683,7 @@ var ts; return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; } function isJSDocTypeReference(node) { - return !!(node.flags & 2097152 /* JSDoc */) && (node.kind === 164 /* TypeReference */ || node.kind === 183 /* ImportType */); + return !!(node.flags & 2097152 /* JSDoc */) && (node.kind === 165 /* TypeReference */ || node.kind === 184 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -39382,9 +39784,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: return declaration; } } @@ -39470,11 +39872,8 @@ var ts; function getGlobalExtractSymbol() { return deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalSymbol("Extract", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217 } - function getGlobalExcludeSymbol() { - return deferredGlobalExcludeSymbol || (deferredGlobalExcludeSymbol = getGlobalSymbol("Exclude", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217 - } - function getGlobalPickSymbol() { - return deferredGlobalPickSymbol || (deferredGlobalPickSymbol = getGlobalSymbol("Pick", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217 + function getGlobalOmitSymbol() { + return deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalSymbol("Omit", 524288 /* TypeAlias */, ts.Diagnostics.Cannot_find_global_type_0)); // TODO: GH#18217 } function getGlobalBigIntType(reportErrors) { return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, reportErrors)) || emptyObjectType; @@ -39511,7 +39910,7 @@ var ts; return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 133 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 134 /* ReadonlyKeyword */; } // We represent tuple types as type references to synthesized generic interface types created by // this function. The types are of the form: @@ -39586,8 +39985,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var lastElement = ts.lastOrUndefined(node.elementTypes); - var restElement_1 = lastElement && lastElement.kind === 172 /* RestType */ ? lastElement : undefined; - var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 171 /* OptionalType */ && n !== restElement_1; }) + 1; + var restElement_1 = lastElement && lastElement.kind === 173 /* RestType */ ? lastElement : undefined; + var minLength = ts.findLastIndex(node.elementTypes, function (n) { return n.kind !== 172 /* OptionalType */ && n !== restElement_1; }) + 1; var elementTypes = ts.map(node.elementTypes, function (n) { var type = getTypeFromTypeNode(n); return n === restElement_1 && getIndexTypeOfType(type, 1 /* Number */) || type; @@ -39974,6 +40373,14 @@ var ts; types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */); return true; } + function createIntersectionType(types, aliasSymbol, aliasTypeArguments) { + var result = createType(2097152 /* Intersection */); + result.objectFlags = getPropagatingFlagsOfTypes(types, /*excludeKinds*/ 98304 /* Nullable */); + result.types = types; + result.aliasSymbol = aliasSymbol; // See comment in `getUnionTypeFromSortedList`. + result.aliasTypeArguments = aliasTypeArguments; + return result; + } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection // types with union type constituents into equivalent union types with intersection type constituents and @@ -40011,30 +40418,36 @@ var ts; if (typeSet.length === 1) { return typeSet[0]; } - if (includes & 1048576 /* Union */) { - if (intersectUnionsOfPrimitiveTypes(typeSet)) { - // When the intersection creates a reduced set (which might mean that *all* union types have - // disappeared), we restart the operation to get a new set of combined flags. Once we have - // reduced we'll never reduce again, so this occurs at most once. - return getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); - } - // 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. - var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); - var unionType = typeSet[unionIndex_1]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); - } var id = getTypeListId(typeSet); - var type = intersectionTypes.get(id); - if (!type) { - type = createType(2097152 /* Intersection */); - intersectionTypes.set(id, type); - type.objectFlags = getPropagatingFlagsOfTypes(typeSet, /*excludeKinds*/ 98304 /* Nullable */); - type.types = typeSet; - type.aliasSymbol = aliasSymbol; // See comment in `getUnionTypeFromSortedList`. - type.aliasTypeArguments = aliasTypeArguments; + var result = intersectionTypes.get(id); + if (!result) { + if (includes & 1048576 /* Union */) { + if (intersectUnionsOfPrimitiveTypes(typeSet)) { + // When the intersection creates a reduced set (which might mean that *all* union types have + // disappeared), we restart the operation to get a new set of combined flags. Once we have + // reduced we'll never reduce again, so this occurs at most once. + result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } + else { + // 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. + 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; }); + var unionType = typeSet[unionIndex_1]; + result = getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); + } + } + else { + result = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } + intersectionTypes.set(id, result); } - return type; + return result; } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); @@ -40090,18 +40503,19 @@ var ts; var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */); return numberIndexInfo !== enumNumberIndexInfo ? numberIndexInfo : undefined; } - function getIndexType(type, stringsOnly) { + function getIndexType(type, stringsOnly, noIndexSignatures) { if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; } - return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) : - type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) : + 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); })) : maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : - type.flags & 1 /* Any */ ? keyofConstraintType : - stringsOnly ? getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromProperties(type, 128 /* StringLiteral */) : - getIndexInfoOfType(type, 0 /* String */) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, 8192 /* UniqueESSymbol */)]) : - getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, 128 /* StringLiteral */ | 8192 /* UniqueESSymbol */)]) : - getLiteralTypeFromProperties(type, 8576 /* StringOrNumberLiteralOrUnique */); + type.flags & 2 /* Unknown */ ? neverType : + type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : + stringsOnly ? !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? stringType : getLiteralTypeFromProperties(type, 128 /* StringLiteral */) : + !noIndexSignatures && getIndexInfoOfType(type, 0 /* String */) ? getUnionType([stringType, numberType, getLiteralTypeFromProperties(type, 8192 /* UniqueESSymbol */)]) : + getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromProperties(type, 128 /* StringLiteral */ | 8192 /* UniqueESSymbol */)]) : + getLiteralTypeFromProperties(type, 8576 /* StringOrNumberLiteralOrUnique */); } function getExtractStringType(type) { if (keyofStringsOnly) { @@ -40118,15 +40532,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 129 /* KeyOfKeyword */: + case 130 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 142 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 139 /* SymbolKeyword */ + case 143 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 140 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 133 /* ReadonlyKeyword */: + case 134 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; } @@ -40166,8 +40580,8 @@ var ts; } return false; } - function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol, missingType) { - var accessExpression = accessNode && accessNode.kind === 190 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags) { + var accessExpression = accessNode && accessNode.kind === 191 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -40180,12 +40594,12 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { - markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); + markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 101 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); - return missingType; + return undefined; } - if (cacheSymbol) { + if (accessFlags & 4 /* CacheSymbol */) { getNodeLinks(accessNode).resolvedSymbol = prop; } } @@ -40204,6 +40618,7 @@ var ts; error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); } } + errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } @@ -40211,17 +40626,21 @@ var ts; if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } - var indexInfo = isTypeAssignableToKind(indexType, 296 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || - getIndexInfoOfType(objectType, 0 /* String */) || - undefined; + var stringIndexInfo = getIndexInfoOfType(objectType, 0 /* String */); + var indexInfo = isTypeAssignableToKind(indexType, 296 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || stringIndexInfo; if (indexInfo) { + if (accessFlags & 1 /* NoIndexSignatures */ && indexInfo === stringIndexInfo) { + if (accessExpression) { + error(accessExpression, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + } + return undefined; + } 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 indexInfo.type; } - else if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { - error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); - } + errorIfWritingToReadonlyIndex(indexInfo); return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { @@ -40234,7 +40653,7 @@ var ts; if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418 /* BlockScoped */)) { error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType)); } - else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) { + else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !suppressNoImplicitAnyError) { if (propName !== undefined && typeHasStaticProperty(propName, objectType)) { error(accessExpression, ts.Diagnostics.Property_0_is_a_static_member_of_type_1, propName, typeToString(objectType)); } @@ -40249,11 +40668,35 @@ var ts; } } else { - error(accessExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(objectType)); + var suggestion_1 = getSuggestionForNonexistentIndexSignature(objectType, accessExpression); + if (suggestion_1 !== undefined) { + error(accessExpression, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType), suggestion_1); + } + else { + var errorInfo = void 0; + if (indexType.flags & 1024 /* EnumLiteral */) { + errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "[" + typeToString(indexType) + "]", typeToString(objectType)); + } + else if (indexType.flags & 8192 /* UniqueESSymbol */) { + var symbolName_2 = getFullyQualifiedName(indexType.symbol, accessExpression); + errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "[" + symbolName_2 + "]", typeToString(objectType)); + } + else if (indexType.flags & 128 /* StringLiteral */) { + errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)); + } + else if (indexType.flags & 256 /* NumberLiteral */) { + errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)); + } + else if (indexType.flags & (8 /* Number */ | 4 /* String */)) { + errorInfo = ts.chainDiagnosticMessages(/* details */ undefined, ts.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1, typeToString(indexType), typeToString(objectType)); + } + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1, typeToString(fullIndexType), typeToString(objectType)); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + } } } } - return missingType; + return undefined; } } if (isJSLiteralType(objectType)) { @@ -40274,14 +40717,19 @@ var ts; if (isTypeAny(indexType)) { return indexType; } - return missingType; + return undefined; + function errorIfWritingToReadonlyIndex(indexInfo) { + if (indexInfo && indexInfo.isReadonly && accessExpression && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) { + error(accessExpression, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); + } + } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 190 /* ElementAccessExpression */ + return accessNode.kind === 191 /* ElementAccessExpression */ ? accessNode.argumentExpression - : accessNode.kind === 180 /* IndexedAccessType */ + : accessNode.kind === 181 /* IndexedAccessType */ ? accessNode.indexType - : accessNode.kind === 149 /* ComputedPropertyName */ + : accessNode.kind === 150 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } @@ -40291,67 +40739,124 @@ var ts; function isGenericIndexType(type) { return maybeTypeOfKind(type, 58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */); } - function getSimplifiedType(type) { - return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type) : type; + function isThisTypeParameter(type) { + return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); } - function distributeIndexOverObjectType(objectType, indexType) { - // (T | U)[K] -> T[K] | U[K] - if (objectType.flags & 1048576 /* Union */) { - return mapType(objectType, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); }); - } + function getSimplifiedType(type, writing) { + return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : + type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : + type; + } + function distributeIndexOverObjectType(objectType, indexType, writing) { + // (T | U)[K] -> T[K] | U[K] (reading) + // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] - if (objectType.flags & 2097152 /* Intersection */) { - return getIntersectionType(ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType)); })); + if (objectType.flags & 3145728 /* UnionOrIntersection */) { + var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); }); + return objectType.flags & 2097152 /* Intersection */ || writing ? getIntersectionType(types) : getUnionType(types); } } - // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return - // the type itself if no transformation is possible. - function getSimplifiedIndexedAccessType(type) { - if (type.simplified) { - return type.simplified === circularConstraintType ? type : type.simplified; + function distributeObjectOverIndexType(objectType, indexType, writing) { + // T[A | B] -> T[A] | T[B] (reading) + // T[A | B] -> T[A] & T[B] (writing) + if (indexType.flags & 1048576 /* Union */) { + var types = ts.map(indexType.types, function (t) { return getSimplifiedType(getIndexedAccessType(objectType, t), writing); }); + return writing ? getIntersectionType(types) : getUnionType(types); } - type.simplified = circularConstraintType; + } + // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return + // the type itself if no transformation is possible. The writing flag indicates that the type is + // the target of an assignment. + function getSimplifiedIndexedAccessType(type, writing) { + var cache = writing ? "simplifiedForWriting" : "simplifiedForReading"; + if (type[cache]) { + return type[cache] === circularConstraintType ? type : type[cache]; + } + type[cache] = circularConstraintType; // We recursively simplify the object type as it may in turn be an indexed access type. For example, with // '{ [P in T]: { [Q in U]: number } }[T][U]' we want to first simplify the inner indexed access type. - var objectType = getSimplifiedType(type.objectType); - var indexType = getSimplifiedType(type.indexType); - // T[A | B] -> T[A] | T[B] - if (indexType.flags & 1048576 /* Union */) { - return type.simplified = mapType(indexType, function (t) { return getSimplifiedType(getIndexedAccessType(objectType, t)); }); + var objectType = getSimplifiedType(type.objectType, writing); + var indexType = getSimplifiedType(type.indexType, writing); + // T[A | B] -> T[A] | T[B] (reading) + // T[A | B] -> T[A] & T[B] (writing) + var distributedOverIndex = distributeObjectOverIndexType(objectType, indexType, writing); + if (distributedOverIndex) { + 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 & 63176704 /* Instantiable */)) { - var simplified = distributeIndexOverObjectType(objectType, indexType); - if (simplified) { - return type.simplified = simplified; + // (T | U)[K] -> T[K] | U[K] (reading) + // (T | U)[K] -> T[K] & U[K] (writing) + // (T & U)[K] -> T[K] & U[K] + var distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); + if (distributedOverObject) { + return type[cache] = distributedOverObject; } } - // So ultimately: + // So ultimately (reading): // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2] // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box<T[P]> }[X], we // construct the type Box<T[X]>. if (isGenericMappedType(objectType)) { - return type.simplified = mapType(substituteIndexedMappedType(objectType, type.indexType), getSimplifiedType); + return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), function (t) { return getSimplifiedType(t, writing); }); } - return type.simplified = type; + return type[cache] = type; + } + function getSimplifiedConditionalType(type, writing) { + var checkType = type.checkType; + var extendsType = type.extendsType; + var trueType = getTrueTypeFromConditionalType(type); + var falseType = getFalseTypeFromConditionalType(type); + // Simplifications for types of the form `T extends U ? T : never` and `T extends U ? never : T`. + if (falseType.flags & 131072 /* Never */ && getActualTypeVariable(trueType) === getActualTypeVariable(checkType)) { + if (checkType.flags & 1 /* Any */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true + return getSimplifiedType(trueType, writing); + } + else if (isIntersectionEmpty(checkType, extendsType)) { // Always false + return neverType; + } + } + else if (trueType.flags & 131072 /* Never */ && getActualTypeVariable(falseType) === getActualTypeVariable(checkType)) { + if (!(checkType.flags & 1 /* Any */) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true + return neverType; + } + else if (checkType.flags & 1 /* Any */ || isIntersectionEmpty(checkType, extendsType)) { // Always false + return getSimplifiedType(falseType, writing); + } + } + return type; + } + /** + * Invokes union simplification logic to determine if an intersection is considered empty as a union constituent + */ + function isIntersectionEmpty(type1, type2) { + return !!(getUnionType([intersectTypes(type1, type2), neverType]).flags & 131072 /* Never */); } function substituteIndexedMappedType(objectType, index) { var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]); var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, accessNode, missingType) { - if (missingType === void 0) { missingType = accessNode ? errorType : unknownType; } + function getIndexedAccessType(objectType, indexType, accessNode) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */) || (accessNode ? errorType : unknownType); + } + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags) { + if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } + // 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 */)) { + indexType = stringType; + } // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that 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 !== 180 /* IndexedAccessType */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind !== 181 /* IndexedAccessType */) && isGenericObjectType(objectType)) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } @@ -40372,25 +40877,25 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(apparentObjectType, t, accessNode, /*cacheSymbol*/ false, missingType); - if (propType === missingType) { - if (!accessNode) { - // If there's no error node, we can immeditely stop, since error reporting is off - return missingType; - } - else { - // Otherwise we set a flag and return at the end of the loop so we still mark all errors - wasMissingProp = true; - } + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); + if (propType) { + propTypes.push(propType); + } + else if (!accessNode) { + // If there's no error node, we can immeditely stop, since error reporting is off + return undefined; + } + else { + // Otherwise we set a flag and return at the end of the loop so we still mark all errors + wasMissingProp = true; } - propTypes.push(propType); } if (wasMissingProp) { - return missingType; + return undefined; } - return getUnionType(propTypes); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes) : getUnionType(propTypes); } - return getPropertyTypeForIndexType(apparentObjectType, indexType, accessNode, /*cacheSymbol*/ true, missingType); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -40420,13 +40925,14 @@ var ts; return links.resolvedType; } function getActualTypeVariable(type) { - return type.flags & 33554432 /* Substitution */ ? type.typeVariable : type; - } - /** - * Invokes union simplification logic to determine if an intersection is considered empty as a union constituent - */ - function isIntersectionEmpty(type1, type2) { - return !!(getUnionType([intersectTypes(type1, type2), neverType]).flags & 131072 /* Never */); + if (type.flags & 33554432 /* Substitution */) { + return type.typeVariable; + } + if (type.flags & 8388608 /* IndexedAccess */ && (type.objectType.flags & 33554432 /* Substitution */ || + type.indexType.flags & 33554432 /* Substitution */)) { + return getIndexedAccessType(getActualTypeVariable(type.objectType), getActualTypeVariable(type.indexType)); + } + return type; } function getConditionalType(root, mapper) { var checkType = instantiateType(root.checkType, mapper); @@ -40434,35 +40940,6 @@ var ts; if (checkType === wildcardType || extendsType === wildcardType) { return wildcardType; } - var trueType = instantiateType(root.trueType, mapper); - var falseType = instantiateType(root.falseType, mapper); - var instantiationId = "" + (root.isDistributive ? "d" : "") + getTypeId(checkType) + ">" + getTypeId(extendsType) + "?" + getTypeId(trueType) + ":" + getTypeId(falseType); - var result = conditionalTypes.get(instantiationId); - if (result) { - return result; - } - var newResult = getConditionalTypeWorker(root, mapper, checkType, extendsType, trueType, falseType); - conditionalTypes.set(instantiationId, newResult); - return newResult; - } - function getConditionalTypeWorker(root, mapper, checkType, extendsType, trueType, falseType) { - // Simplifications for types of the form `T extends U ? T : never` and `T extends U ? never : T`. - if (falseType.flags & 131072 /* Never */ && isTypeIdenticalTo(getActualTypeVariable(trueType), getActualTypeVariable(checkType))) { - if (checkType.flags & 1 /* Any */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true - return trueType; - } - else if (isIntersectionEmpty(checkType, extendsType)) { // Always false - return neverType; - } - } - else if (trueType.flags & 131072 /* Never */ && isTypeIdenticalTo(getActualTypeVariable(falseType), getActualTypeVariable(checkType))) { - if (!(checkType.flags & 1 /* Any */) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { // Always true - return neverType; - } - else if (checkType.flags & 1 /* Any */ || isIntersectionEmpty(checkType, extendsType)) { // Always false - return falseType; - } - } var checkTypeInstantiable = maybeTypeOfKind(checkType, 63176704 /* Instantiable */ | 131072 /* GenericMappedType */); var combinedMapper; if (root.inferTypeParameters) { @@ -40471,7 +40948,7 @@ var ts; // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. - inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */); + inferTypes(context.inferences, checkType, extendsType, 64 /* NoConstraints */ | 128 /* AlwaysStrict */); } combinedMapper = combineTypeMappers(mapper, context.mapper); } @@ -40480,18 +40957,18 @@ var ts; // We attempt to resolve the conditional type only when the check and extends types are non-generic if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, 63176704 /* Instantiable */ | 131072 /* GenericMappedType */)) { if (inferredExtendsType.flags & 3 /* AnyOrUnknown */) { - return trueType; + return instantiateType(root.trueType, combinedMapper || mapper); } // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), falseType]); + return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } // Return falseType for a definitely false extends check. We check an instantiations of the two // types with type parameters mapped to the wildcard type, the most permissive instantiations // possible (the wildcard type is assignable to and from all types). If those are not related, // then no instantiations will be and we can just return the false branch type. if (!isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType))) { - return falseType; + return instantiateType(root.falseType, mapper); } // Return trueType for a definitely true extends check. We check instantiations of the two // types with type parameters mapped to their restrictive form, i.e. a form of the type parameter @@ -40503,9 +40980,6 @@ var ts; } } // Return a deferred type for a check that is neither definitely true nor definitely false - return getDeferredConditionalType(root, mapper, combinedMapper, checkType, extendsType, trueType, falseType); - } - function getDeferredConditionalType(root, mapper, combinedMapper, checkType, extendsType, trueType, falseType) { var erasedCheckType = getActualTypeVariable(checkType); var result = createType(16777216 /* Conditional */); result.root = root; @@ -40513,14 +40987,18 @@ var ts; result.extendsType = extendsType; result.mapper = mapper; result.combinedMapper = combinedMapper; - result.trueType = trueType; - result.falseType = falseType; result.aliasSymbol = root.aliasSymbol; result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper); // TODO: GH#18217 return result; } + function getTrueTypeFromConditionalType(type) { + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); + } + function getFalseTypeFromConditionalType(type) { + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); + } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = instantiateType(type.root.trueType, type.combinedMapper || type.mapper)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -40533,20 +41011,6 @@ var ts; } return result; } - function isPossiblyReferencedInConditionalType(tp, node) { - if (isTypeParameterPossiblyReferenced(tp, node)) { - return true; - } - while (node) { - if (node.kind === 175 /* ConditionalType */) { - if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) { - return true; - } - } - node = node.parent; - } - return false; - } function getTypeFromConditionalTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -40554,7 +41018,7 @@ var ts; var aliasSymbol = getAliasSymbolForTypeNode(node); var aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); - var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); }); + var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); }); var root = { node: node, checkType: checkType, @@ -40865,9 +41329,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 241 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 242 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 157 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 158 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -40883,89 +41347,89 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 120 /* AnyKeyword */: - case 289 /* JSDocAllType */: - case 290 /* JSDocUnknownType */: + case 121 /* AnyKeyword */: + case 290 /* JSDocAllType */: + case 291 /* JSDocUnknownType */: return anyType; - case 143 /* UnknownKeyword */: + case 144 /* UnknownKeyword */: return unknownType; - case 138 /* StringKeyword */: + case 139 /* StringKeyword */: return stringType; - case 135 /* NumberKeyword */: + case 136 /* NumberKeyword */: return numberType; - case 146 /* BigIntKeyword */: + case 147 /* BigIntKeyword */: return bigintType; - case 123 /* BooleanKeyword */: + case 124 /* BooleanKeyword */: return booleanType; - case 139 /* SymbolKeyword */: + case 140 /* SymbolKeyword */: return esSymbolType; - case 106 /* VoidKeyword */: + case 107 /* VoidKeyword */: return voidType; - case 141 /* UndefinedKeyword */: + case 142 /* UndefinedKeyword */: return undefinedType; - case 96 /* NullKeyword */: + case 97 /* NullKeyword */: return nullType; - case 132 /* NeverKeyword */: + case 133 /* NeverKeyword */: return neverType; - case 136 /* ObjectKeyword */: + case 137 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 178 /* ThisType */: - case 100 /* ThisKeyword */: + case 179 /* ThisType */: + case 101 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 182 /* LiteralType */: + case 183 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return getTypeFromTypeReference(node); - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: return booleanType; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 169 /* ArrayType */: + case 170 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 170 /* TupleType */: + case 171 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 171 /* OptionalType */: + case 172 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 173 /* UnionType */: + case 174 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 174 /* IntersectionType */: + case 175 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 291 /* JSDocNullableType */: + case 292 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 293 /* JSDocOptionalType */: + case 294 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 177 /* ParenthesizedType */: - case 172 /* RestType */: - case 292 /* JSDocNonNullableType */: - case 288 /* JSDocTypeExpression */: + case 178 /* ParenthesizedType */: + case 173 /* RestType */: + case 293 /* JSDocNonNullableType */: + case 289 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 295 /* JSDocVariadicType */: + case 296 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 168 /* TypeLiteral */: - case 297 /* JSDocTypeLiteral */: - case 294 /* JSDocFunctionType */: - case 298 /* JSDocSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 169 /* TypeLiteral */: + case 298 /* JSDocTypeLiteral */: + case 295 /* JSDocFunctionType */: + case 299 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 179 /* TypeOperator */: + case 180 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 181 /* MappedType */: + case 182 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 176 /* InferType */: + case 177 /* InferType */: return getTypeFromInferTypeNode(node); - case 183 /* ImportType */: + case 184 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode - case 72 /* Identifier */: - case 148 /* QualifiedName */: + case 73 /* Identifier */: + case 149 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -41025,7 +41489,7 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(context, index) { - return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? emptyObjectType : t; }; + return function (t) { return ts.findIndex(context.inferences, function (info) { return info.typeParameter === t; }) >= index ? unknownType : t; }; } function combineTypeMappers(mapper1, mapper2) { if (!mapper1) @@ -41108,7 +41572,7 @@ var ts; } // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and // also transient so that we can just store data on it directly. - var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (8 /* Readonly */ | 2048 /* Late */ | 8192 /* OptionalParameter */ | 16384 /* RestParameter */)); + var result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | ts.getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */)); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -41174,28 +41638,31 @@ var ts; return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 148 /* QualifiedName */ || - node.parent.kind === 164 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName); + return !(node.kind === 149 /* QualifiedName */ || + node.parent.kind === 165 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks // between the node and the type parameter declaration, if the node contains actual references to the // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { - var container_3 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 218 /* Block */ ? "quit" : n === container_3; })) { - return !!ts.forEachChild(node, containsReference); + var container = tp.symbol.declarations[0].parent; + for (var n = node; n !== container; n = n.parent) { + if (!n || n.kind === 219 /* Block */ || n.kind === 176 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + return true; + } } + return !!ts.forEachChild(node, containsReference); } return true; function containsReference(node) { switch (node.kind) { - case 178 /* ThisType */: + case 179 /* ThisType */: return !!tp.isThisType; - case 72 /* Identifier */: + case 73 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNode(node) === tp; - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -41343,7 +41810,7 @@ var ts; // If the anonymous type originates in a declaration of a function, method, class, or // interface, in an object type literal, or in an object literal expression, we may need // to instantiate the type because it might reference a type parameter. - return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ? + return couldContainTypeVariables(type) ? getAnonymousTypeInstantiation(type, mapper) : type; } if (objectFlags & 32 /* Mapped */) { @@ -41382,7 +41849,7 @@ var ts; } else { var sub = instantiateType(type.substitute, mapper); - if (sub.flags & 3 /* AnyOrUnknown */ || isTypeSubtypeOf(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) { + if (sub.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(maybeVariable), getRestrictiveInstantiation(sub))) { return maybeVariable; } return sub; @@ -41416,34 +41883,34 @@ 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 !== 156 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 157 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return node.operatorToken.kind === 55 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 267 /* JsxAttribute */: { + case 268 /* 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 270 /* JsxExpression */: { + case 271 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g <div x={} />) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -41460,7 +41927,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 197 /* ArrowFunction */) { + if (node.kind !== 198 /* 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); @@ -41472,7 +41939,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !!node.body && node.body.kind !== 218 /* Block */ && isContextSensitive(node.body); + return !!node.body && node.body.kind !== 219 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -41525,7 +41992,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 1048576 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 1048576 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + 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)); @@ -41574,23 +42041,23 @@ var ts; return true; } switch (node.kind) { - case 270 /* JsxExpression */: - case 195 /* ParenthesizedExpression */: + case 271 /* JsxExpression */: + case 196 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: switch (node.operatorToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage); } break; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation); } return false; @@ -41659,11 +42126,11 @@ var ts; var reportedError = false; for (var status = iterator.next(); !status.done; status = iterator.next()) { var _a = status.value, prop = _a.errorNode, next = _a.innerExpression, nameType = _a.nameType, errorMessage = _a.errorMessage; - var targetPropType = getIndexedAccessType(target, nameType, /*accessNode*/ undefined, errorType); - if (targetPropType === errorType || targetPropType.flags & 8388608 /* IndexedAccess */) + var targetPropType = getIndexedAccessTypeOrUndefined(target, nameType); + if (!targetPropType || targetPropType.flags & 8388608 /* IndexedAccess */) continue; // Don't elaborate on indexes on generic variables - var sourcePropType = getIndexedAccessType(source, nameType, /*accessNode*/ undefined, errorType); - if (sourcePropType !== errorType && targetPropType !== errorType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { + var sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); + if (sourcePropType && !checkTypeRelatedTo(sourcePropType, targetPropType, relation, /*errorNode*/ undefined)) { var elaborated = next && elaborateError(next, sourcePropType, targetPropType, relation, /*headMessage*/ undefined); if (elaborated) { reportedError = true; @@ -41762,7 +42229,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -41771,15 +42238,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - case 264 /* JsxFragment */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + case 265 /* 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) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation); var invalidTextDiagnostic; @@ -41789,7 +42259,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.filter(containingElement.children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -41873,6 +42343,8 @@ var ts; }); } function elaborateArrayLiteral(node, source, target, relation) { + if (target.flags & 131068 /* Primitive */) + return false; if (isTupleLikeType(source)) { return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation); } @@ -41903,11 +42375,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 159 /* SetAccessor */: return [3 /*break*/, 2]; - case 158 /* GetAccessor */: return [3 /*break*/, 2]; - case 156 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 276 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 275 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 160 /* SetAccessor */: return [3 /*break*/, 2]; + case 159 /* GetAccessor */: return [3 /*break*/, 2]; + case 157 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 277 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 276 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -41929,6 +42401,8 @@ var ts; }); } function elaborateObjectLiteral(node, source, target, relation) { + if (target.flags & 131068 /* Primitive */) + return false; return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation); } /** @@ -41977,8 +42451,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 156 /* MethodDeclaration */ && - kind !== 155 /* MethodSignature */ && kind !== 157 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 157 /* MethodDeclaration */ && + kind !== 156 /* MethodSignature */ && kind !== 158 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -42026,12 +42500,14 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - var targetReturnType = (target.declaration && isJSConstructor(target.declaration)) ? + // If a signature reolution is already in-flight, skip issuing a circularity error + // here and just use the `any` type directly + var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType : (target.declaration && isJSConstructor(target.declaration)) ? getJSClassType(target.declaration.symbol) : getReturnTypeOfSignature(target); if (targetReturnType === voidType) { return result; } - var sourceReturnType = (source.declaration && isJSConstructor(source.declaration)) ? + var sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType : (source.declaration && isJSConstructor(source.declaration)) ? getJSClassType(source.declaration.symbol) : getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions var targetTypePredicate = getTypePredicateOfSignature(target); @@ -42110,6 +42586,11 @@ var ts; function isEmptyAnonymousObjectType(type) { return !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && isEmptyObjectType(type); } + function isStringIndexSignatureOnlyType(type) { + return type.flags & 524288 /* Object */ && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfoOfType(type, 0 /* String */) && !getIndexInfoOfType(type, 1 /* Number */) || + type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isStringIndexSignatureOnlyType) || + false; + } function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) { if (sourceSymbol === targetSymbol) { return true; @@ -42218,8 +42699,8 @@ var ts; } return false; } - function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { - return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + function isIgnoredJsxProperty(source, sourceProp) { + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !isUnhyphenatedJsxName(sourceProp.escapedName); } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). @@ -42241,7 +42722,7 @@ var ts; var depth = 0; var expandingFlags = 0 /* None */; var overflow = false; - var suppressNextError = false; + var overrideNextErrorInfo; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); var result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { @@ -42249,9 +42730,9 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - var chain_1 = containingMessageChain(); - if (chain_1) { - errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + var chain = containingMessageChain(); + if (chain) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain, errorInfo); } } var relatedInformation = void 0; @@ -42291,11 +42772,9 @@ var ts; } } function reportRelationError(message, source, target) { - var sourceType = typeToString(source); - var targetType = typeToString(target); - if (sourceType === targetType) { - sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); - targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1]; + if (target.flags & 262144 /* TypeParameter */ && target.immediateBaseConstraint !== undefined && isTypeAssignableTo(source, target.immediateBaseConstraint)) { + reportError(ts.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, sourceType, targetType, typeToString(target.immediateBaseConstraint)); } if (!message) { if (relation === comparableRelation) { @@ -42320,24 +42799,38 @@ var ts; reportError(ts.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); } } - function isUnionOrIntersectionTypeWithoutNullableConstituents(type) { - if (!(type.flags & 3145728 /* UnionOrIntersection */)) { - return false; - } - // at this point we know that this is union or intersection type possibly with nullable constituents. - // check if we still will have compound type if we ignore nullable components. - var seenNonNullable = false; - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (t.flags & 98304 /* Nullable */) { - continue; + /** + * Try and elaborate array and tuple errors. Returns false + * if we have found an elaboration, or we should ignore + * any other elaborations when relating the `source` and + * `target` types. + * + * @param source + * @param target + * @param reportErrors + */ + function tryElaborateArrayLikeErrors(source, target, reportErrors) { + if (isTupleLikeType(source)) { + var sourceTuple = source.target; + if (sourceTuple && sourceTuple.readonly && isArrayOrTupleLikeType(target) && + (!isReadonlyArrayType(target) || isTupleType(target) && !target.target.readonly)) { + if (reportErrors) { + reportError(ts.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target)); + } + return false; } - if (seenNonNullable) { - return true; + return isArrayLikeType(target); + } + if (isTupleLikeType(target)) { + return isArrayLikeType(source); + } + if (isReadonlyArrayType(source) && isArrayType(target) && !isReadonlyArrayType(target)) { + if (reportErrors) { + reportError(ts.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source), typeToString(target)); } - seenNonNullable = true; + return false; } - return false; + return true; } /** * Compare two types and return @@ -42359,11 +42852,11 @@ var ts; if (target.flags & 33554432 /* Substitution */) { target = target.typeVariable; } - if (source.flags & 8388608 /* IndexedAccess */) { - source = getSimplifiedType(source); + if (source.flags & 25165824 /* Simplifiable */) { + source = getSimplifiedType(source, /*writing*/ false); } - if (target.flags & 8388608 /* IndexedAccess */) { - target = getSimplifiedType(target); + if (target.flags & 25165824 /* Simplifiable */) { + target = getSimplifiedType(target, /*writing*/ true); } // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`. // If so, reporting the `null` and `undefined` in the type is hardly useful. @@ -42391,7 +42884,8 @@ var ts; isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); - if (isObjectLiteralType(source) && ts.getObjectFlags(source) & 32768 /* FreshLiteral */) { + var isPerformingExcessPropertyChecks = (isObjectLiteralType(source) && ts.getObjectFlags(source) & 32768 /* FreshLiteral */); + if (isPerformingExcessPropertyChecks) { var discriminantType = target.flags & 1048576 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { @@ -42399,13 +42893,6 @@ var ts; } return 0 /* False */; } - // Above we check for excess properties with respect to the entire target type. When union - // and intersection types are further deconstructed on the target side, we don't want to - // make the check again (as it might fail for a partial target type). Therefore we obtain - // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { - source = getRegularTypeOfObjectLiteral(source); - } } if (relation !== comparableRelation && !isApparentIntersectionConstituent && source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType && @@ -42438,11 +42925,24 @@ var ts; } else { if (target.flags & 1048576 /* Union */) { - result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */)); + result = typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */)); + if (result && isPerformingExcessPropertyChecks) { + // Validate against excess props using the original `source` + var discriminantType = target.flags & 1048576 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (!propertiesRelatedTo(source, discriminantType || target, reportErrors, /*excludedProperties*/ undefined)) { + return 0 /* False */; + } + } } else if (target.flags & 2097152 /* Intersection */) { isIntersectionConstituent = true; // set here to affect the following trio of checks - result = typeRelatedToEachType(source, target, reportErrors); + result = typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors); + if (result && isPerformingExcessPropertyChecks) { + // Validate against excess props using the original `source` + if (!propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined)) { + return 0 /* False */; + } + } } else if (source.flags & 2097152 /* Intersection */) { // Check to see if any constituents of the intersection are immediately related to the target. @@ -42484,8 +42984,15 @@ var ts; } } if (!result && reportErrors) { - var maybeSuppress = suppressNextError; - suppressNextError = false; + var maybeSuppress = overrideNextErrorInfo; + overrideNextErrorInfo = undefined; + if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { + var currentError = errorInfo; + tryElaborateArrayLikeErrors(source, target, reportErrors); + if (errorInfo !== currentError) { + maybeSuppress = errorInfo; + } + } if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) { tryElaborateErrorsForPrimitivesAndObjects(source, target); } @@ -42580,7 +43087,7 @@ var ts; return { value: true }; } }; - for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; var state_3 = _loop_7(prop); if (typeof state_3 === "object") @@ -42687,8 +43194,8 @@ var ts; } // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly function findMatchingDiscriminantType(source, target) { - if (target.flags & 1048576 /* Union */) { - var sourceProperties = getPropertiesOfObjectType(source); + if (target.flags & 1048576 /* Union */ && source.flags & (2097152 /* Intersection */ | 524288 /* Object */)) { + var sourceProperties = getPropertiesOfType(source); if (sourceProperties) { var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); if (sourcePropertiesFiltered) { @@ -42751,13 +43258,20 @@ var ts; // When variance information isn't available we default to covariance. This happens // in the process of computing variance information for recursive types and when // comparing 'this' type arguments. - var variance = i < variances.length ? variances[i] : 1 /* Covariant */; + var varianceFlags = i < variances.length ? variances[i] : 1 /* Covariant */; + var variance = varianceFlags & 7 /* VarianceMask */; // We ignore arguments for independent type parameters (because they're never witnessed). if (variance !== 4 /* Independent */) { var s = sources[i]; var t = targets[i]; var related = -1 /* True */; - if (variance === 1 /* Covariant */) { + if (varianceFlags & 8 /* Unmeasurable */) { + // Even an `Unmeasurable` variance works out without a structural check if the source and target are _identical_. + // We can't simply assume invariance, because `Unmeasurable` marks nonlinear relations, for example, a relation tained by + // the `-?` modifier in a mapped type (where, no matter how the inputs are related, the outputs still might not be) + related = relation === identityRelation ? isRelatedTo(s, t, /*reportErrors*/ false) : compareTypesIdentical(s, t); + } + else if (variance === 1 /* Covariant */) { related = isRelatedTo(s, t, reportErrors); } else if (variance === 2 /* Contravariant */) { @@ -42790,6 +43304,17 @@ var ts; } return result; } + function propagateSidebandVarianceFlags(typeArguments, variances) { + for (var i = 0; i < variances.length; i++) { + var v = variances[i]; + if (v & 8 /* Unmeasurable */) { + instantiateType(typeArguments[i], reportUnmeasurableMarkers); + } + if (v & 16 /* Unreliable */) { + instantiateType(typeArguments[i], reportUnreliableMarkers); + } + } + } // Determine if possibly recursive types are related. First, check if the result is already available in the global cache. // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are @@ -42807,6 +43332,16 @@ var ts; // as a failure, and should be updated as a reported failure by the bottom of this function. } else { + if (outofbandVarianceMarkerHandler) { + // We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component + if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol && + source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { + propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol)); + } + if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && ts.length(source.typeArguments)) { + propagateSidebandVarianceFlags(source.typeArguments, getVariances(source.target)); + } + } return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } @@ -42876,8 +43411,8 @@ var ts; if (source.root.isDistributive === target.root.isDistributive) { if (result_3 = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { if (result_3 &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { - if (result_3 &= isRelatedTo(source.trueType, target.trueType, /*reportErrors*/ false)) { - if (result_3 &= isRelatedTo(source.falseType, target.falseType, /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result_3 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { return result_3; } } @@ -42927,8 +43462,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // simplified form of T or, if T doesn't simplify, the constraint of T. - var simplified = getSimplifiedType(target.type); - var constraint = simplified !== target.type ? simplified : getConstraintOfType(target.type); + var constraint = getSimplifiedTypeOrConstraint(target.type); if (constraint) { // We require Ternary.True here such that circular constraints don't cause // false positives. For example, given 'T extends { [K in keyof T]: string }', @@ -42940,13 +43474,17 @@ var ts; } } else if (target.flags & 8388608 /* IndexedAccess */) { - // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, - // where C is the base constraint of T[K] - if (relation !== identityRelation && - !(isGenericObjectType(target.objectType) && isGenericIndexType(target.indexType))) { - var constraint = getBaseConstraintOfType(target); - if (constraint && constraint !== target) { - if (result = isRelatedTo(source, constraint, reportErrors)) { + // A type S is related to a type T[K] if S is related to C, where C is the base + // constraint of T[K] for writing. + if (relation !== identityRelation) { + var objectType = target.objectType; + var indexType = target.indexType; + var baseObjectType = getBaseConstraintOfType(objectType) || objectType; + var baseIndexType = getBaseConstraintOfType(indexType) || indexType; + if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { + var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); + if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } @@ -42963,7 +43501,7 @@ var ts; } if (!isGenericMappedType(source)) { var targetConstraint = getConstraintTypeFromMappedType(target); - var sourceKeys_1 = getIndexType(source); + var sourceKeys_1 = getIndexType(source, /*stringsOnly*/ undefined, /*noIndexSignatures*/ true); var hasOptionalUnionKeys = modifiers & 4 /* IncludeOptional */ && targetConstraint.flags & 1048576 /* Union */; var filteredByApplicability = hasOptionalUnionKeys ? filterType(targetConstraint, function (t) { return !!isRelatedTo(t, sourceKeys_1); }) : undefined; // A source type T is related to a target type { [P in Q]: X } if Q is related to keyof T and T[Q] is related to X. @@ -42994,23 +43532,25 @@ var ts; return result; } } - var constraint = getConstraintOfType(source); - if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) { - // A type variable with no constraint is not related to the non-primitive object type. - if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) { + else { + var constraint = getConstraintOfType(source); + if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) { + // A type variable with no constraint is not related to the non-primitive object type. + if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) { + errorInfo = saveErrorInfo; + return result; + } + } + // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed + else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { + errorInfo = saveErrorInfo; + return result; + } + // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example + else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { errorInfo = saveErrorInfo; return result; } - } - // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed - else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { - errorInfo = saveErrorInfo; - return result; - } - // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example - else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { - errorInfo = saveErrorInfo; - return result; } } else if (source.flags & 4194304 /* Index */) { @@ -43026,8 +43566,8 @@ var ts; // and Y1 is related to Y2. if (isTypeIdenticalTo(source.extendsType, target.extendsType) && (isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) { - if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { - result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) { + result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors); } if (result) { errorInfo = saveErrorInfo; @@ -43097,7 +43637,7 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) { // Report structural errors only if we haven't reported any errors yet var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive; - result = propertiesRelatedTo(source, target, reportStructuralErrors); + result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined); if (result) { result &= signaturesRelatedTo(source, target, 0 /* Call */, reportStructuralErrors); if (result) { @@ -43117,22 +43657,35 @@ var ts; return result; } } - } - return 0 /* False */; - function isNonGeneric(type) { - // If we're already in identity relationship checking, we should use `isRelatedTo` - // to catch the `Maybe` from an excessively deep type (which we then assume means - // that the type could possibly contain a generic) - if (relation === identityRelation) { - return isRelatedTo(type, getPermissiveInstantiation(type)) === -1 /* True */; + // If S is an object type and T is a discriminated union, S may be related to T if + // there exists a constituent of T for every combination of the discriminants of S + // with respect to T. We do not report errors here, as we will use the existing + // error result from checking each constituent of the union. + if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { + var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */); + if (objectOnlyTarget.flags & 1048576 /* Union */) { + var result_4 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_4) { + return result_4; + } + } } - return isTypeIdenticalTo(type, getPermissiveInstantiation(type)); } + return 0 /* False */; function relateVariances(sourceTypeArguments, targetTypeArguments, variances) { if (result = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors)) { return result; } - var allowStructuralFallback = (targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances)) || isNonGeneric(source) || isNonGeneric(target); + if (ts.some(variances, function (v) { return !!(v & 24 /* AllowsStructuralFallback */); })) { + // If some type parameter was `Unmeasurable` or `Unreliable`, and we couldn't pass by assuming it was identical, then we + // have to allow a structural fallback check + // We elide the variance-based error elaborations, since those might not be too helpful, since we'll potentially + // be assuming identity of the type parameter. + originalErrorInfo = undefined; + errorInfo = saveErrorInfo; + return undefined; + } + var allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances); varianceCheckFailed = !allowStructuralFallback; // The type arguments did not relate appropriately, but it may be because we have no variance // information (in which case typeArgumentsRelatedTo defaulted to covariance for all type @@ -43150,7 +43703,7 @@ var ts; // reveal the reason). // We can switch on `reportErrors` here, since varianceCheckFailed guarantees we return `False`, // we can return `False` early here to skip calculating the structural error message we don't need. - if (varianceCheckFailed && !(reportErrors && ts.some(variances, function (v) { return v === 0 /* Invariant */; }))) { + if (varianceCheckFailed && !(reportErrors && ts.some(variances, function (v) { return (v & 7 /* VarianceMask */) === 0 /* Invariant */; }))) { return 0 /* False */; } // We remember the original error information so we can restore it in case the structural @@ -43161,6 +43714,18 @@ var ts; } } } + function reportUnmeasurableMarkers(p) { + if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) { + outofbandVarianceMarkerHandler(/*onlyUnreliable*/ false); + } + return p; + } + function reportUnreliableMarkers(p) { + if (outofbandVarianceMarkerHandler && (p === markerSuperType || p === markerSubType || p === markerOtherType)) { + outofbandVarianceMarkerHandler(/*onlyUnreliable*/ true); + } + return p; + } // A type [P in S]: X is related to a type [Q in T]: Y if T is related to S and X' is // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice // that S and T are contra-variant whereas X and Y are co-variant. @@ -43168,45 +43733,281 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_4; - if (result_4 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + var result_5; + var targetConstraint = getConstraintTypeFromMappedType(target); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers); + if (result_5 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - return result_4 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + return result_5 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; } - function propertiesRelatedTo(source, target, reportErrors) { + function typeRelatedToDiscriminatedType(source, target) { + // 1. Generate the combinations of discriminant properties & types 'source' can satisfy. + // a. If the number of combinations is above a set limit, the comparison is too complex. + // 2. Filter 'target' to the subset of types whose discriminants exist in the matrix. + // a. If 'target' does not satisfy all discriminants in the matrix, 'source' is not related. + // 3. For each type in the filtered 'target', determine if all non-discriminant properties of + // 'target' are related to a property in 'source'. + // + // NOTE: See ~/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithDiscriminatedUnion.ts + // for examples. + var sourceProperties = getPropertiesOfObjectType(source); + var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); + if (!sourcePropertiesFiltered) + return 0 /* False */; + // Though we could compute the number of combinations as we generate + // the matrix, this would incur additional memory overhead due to + // array allocations. To reduce this overhead, we first compute + // the number of combinations to ensure we will not surpass our + // fixed limit before incurring the cost of any allocations: + var numCombinations = 1; + for (var _i = 0, sourcePropertiesFiltered_1 = sourcePropertiesFiltered; _i < sourcePropertiesFiltered_1.length; _i++) { + var sourceProperty = sourcePropertiesFiltered_1[_i]; + numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); + if (numCombinations > 25) { + // We've reached the complexity limit. + return 0 /* False */; + } + } + // Compute the set of types for each discriminant property. + var sourceDiscriminantTypes = new Array(sourcePropertiesFiltered.length); + var excludedProperties = ts.createUnderscoreEscapedMap(); + for (var i = 0; i < sourcePropertiesFiltered.length; i++) { + var sourceProperty = sourcePropertiesFiltered[i]; + var sourcePropertyType = getTypeOfSymbol(sourceProperty); + sourceDiscriminantTypes[i] = sourcePropertyType.flags & 1048576 /* Union */ + ? sourcePropertyType.types + : [sourcePropertyType]; + excludedProperties.set(sourceProperty.escapedName, true); + } + // Match each combination of the cartesian product of discriminant properties to one or more + // 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_8 = function (combination) { + var hasMatch = false; + outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { + var type = _a[_i]; + var _loop_9 = function (i) { + var sourceProperty = sourcePropertiesFiltered[i]; + var targetProperty = getPropertyOfObjectType(type, sourceProperty.escapedName); + if (!targetProperty) + return "continue-outer"; + if (sourceProperty === targetProperty) + return "continue"; + // We compare the source property to the target in the context of a single discriminant type. + var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, /*reportErrors*/ false); + // If the target property could not be found, or if the properties were not related, + // then this constituent is not a match. + if (!related) { + return "continue-outer"; + } + }; + for (var i = 0; i < sourcePropertiesFiltered.length; i++) { + var state_5 = _loop_9(i); + switch (state_5) { + case "continue-outer": continue outer; + } + } + ts.pushIfUnique(matchingTypes, type, ts.equateValues); + hasMatch = true; + } + if (!hasMatch) { + return { value: 0 /* False */ }; + } + }; + for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { + var combination = discriminantCombinations_1[_a]; + var state_4 = _loop_8(combination); + if (typeof state_4 === "object") + return state_4.value; + } + // Compare the remaining non-discriminant properties of each match. + var result = -1 /* True */; + for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) { + var type = matchingTypes_1[_b]; + result &= propertiesRelatedTo(source, type, /*reportErrors*/ false, excludedProperties); + if (result) { + result &= signaturesRelatedTo(source, type, 0 /* Call */, /*reportStructuralErrors*/ false); + if (result) { + result &= signaturesRelatedTo(source, type, 1 /* Construct */, /*reportStructuralErrors*/ false); + if (result) { + result &= indexTypesRelatedTo(source, type, 0 /* String */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false); + if (result) { + result &= indexTypesRelatedTo(source, type, 1 /* Number */, /*sourceIsPrimitive*/ false, /*reportStructuralErrors*/ false); + } + } + } + } + if (!result) { + return result; + } + } + return result; + } + function excludeProperties(properties, excludedProperties) { + if (!excludedProperties || properties.length === 0) + return properties; + var result; + for (var i = 0; i < properties.length; i++) { + if (!excludedProperties.has(properties[i].escapedName)) { + if (result) { + result.push(properties[i]); + } + } + else if (!result) { + result = properties.slice(0, i); + } + } + return result || properties; + } + function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors) { + var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48 /* Partial */); + var source = getTypeOfSourceProperty(sourceProp); + if (ts.getCheckFlags(targetProp) & 65536 /* DeferredType */ && !getSymbolLinks(targetProp).type) { + // Rather than resolving (and normalizing) the type, relate constituent-by-constituent without performing normalization or seconadary passes + var links = getSymbolLinks(targetProp); + ts.Debug.assertDefined(links.deferralParent); + ts.Debug.assertDefined(links.deferralConstituents); + var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); + var result_6 = 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]; + var related = isRelatedTo(source, targetType, /*reportErrors*/ false, /*headMessage*/ undefined, /*isIntersectionConstituent*/ !unionParent); + if (!unionParent) { + if (!related) { + // 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_6 &= related; + } + else { + if (related) { + return related; + } + } + } + if (unionParent && !result_6 && targetIsOptional) { + result_6 = isRelatedTo(source, undefinedType); + } + if (unionParent && !result_6 && 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_6; + } + else { + return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); + } + } + function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors) { + var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); + var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); + if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { + var hasDifferingDeclarations = sourceProp.valueDeclaration !== targetProp.valueDeclaration; + if (ts.getCheckFlags(sourceProp) & 1024 /* ContainsPrivate */ && hasDifferingDeclarations) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); + } + return 0 /* False */; + } + if (hasDifferingDeclarations) { + if (reportErrors) { + if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { + reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); + } + else { + reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 8 /* Private */ ? source : target), typeToString(sourcePropFlags & 8 /* Private */ ? target : source)); + } + } + return 0 /* False */; + } + } + else if (targetPropFlags & 16 /* Protected */) { + if (!isValidOverrideOf(sourceProp, targetProp)) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); + } + return 0 /* False */; + } + } + else if (sourcePropFlags & 16 /* Protected */) { + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + // If the target comes from a partial union prop, allow `undefined` in the target type + var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); + } + return 0 /* False */; + } + // When checking for comparability, be more lenient with optional properties. + if (relation !== comparableRelation && sourceProp.flags & 16777216 /* Optional */ && !(targetProp.flags & 16777216 /* Optional */)) { + // TypeScript 1.0 spec (April 2014): 3.8.3 + // S is a subtype of a type T, and T is a supertype of S if ... + // S' and T are object types and, for each member M in T.. + // M is a property and S' contains a property N where + // if M is a required property, N is also a required property + // (M - property in T) + // (N - property in S) + if (reportErrors) { + reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); + } + return 0 /* False */; + } + return related; + } + function propertiesRelatedTo(source, target, reportErrors, excludedProperties) { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target); + return propertiesIdenticalTo(source, target, excludedProperties); } var requireOptionalProperties = relation === subtypeRelation && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source); var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false); if (unmatchedProperty) { if (reportErrors) { var props = ts.arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false)); + var shouldSkipElaboration = false; if (!headMessage || (headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) { - suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it + shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it } if (props.length === 1) { var propName = symbolToString(unmatchedProperty); - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, typeToString(source), typeToString(target)); + reportError.apply(void 0, [ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName].concat(getTypeNamesForErrorDisplay(source, target))); if (ts.length(unmatchedProperty.declarations)) { associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName)); } + if (shouldSkipElaboration) { + overrideNextErrorInfo = errorInfo; + } } - else if (props.length > 5) { // arbitrary cutoff for too-long list form - reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), ts.map(props.slice(0, 4), function (p) { return symbolToString(p); }).join(", "), props.length - 4); - } - else { - reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), ts.map(props, function (p) { return symbolToString(p); }).join(", ")); + else if (tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ false)) { + if (props.length > 5) { // arbitrary cutoff for too-long list form + reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), ts.map(props.slice(0, 4), function (p) { return symbolToString(p); }).join(", "), props.length - 4); + } + else { + reportError(ts.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), ts.map(props, function (p) { return symbolToString(p); }).join(", ")); + } + if (shouldSkipElaboration) { + overrideNextErrorInfo = errorInfo; + } } + // ELSE: No array like or unmatched property error - just issue top level error (errorInfo = undefined) } return 0 /* False */; } if (isObjectLiteralType(target)) { - for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { + for (var _i = 0, _a = excludeProperties(getPropertiesOfType(source), excludedProperties); _i < _a.length; _i++) { var sourceProp = _a[_i]; if (!getPropertyOfObjectType(target, sourceProp.escapedName)) { var sourceType = getTypeOfSymbol(sourceProp); @@ -43247,84 +44048,30 @@ var ts; } } } - var properties = getPropertiesOfObjectType(target); - for (var _b = 0, properties_2 = properties; _b < properties_2.length; _b++) { - var targetProp = properties_2[_b]; + // We only call this for union target types when we're attempting to do excess property checking - in those cases, we want to get _all possible props_ + // from the target union, across all members + var properties = target.flags & 1048576 /* Union */ ? getPossiblePropertiesOfUnionType(target) : getPropertiesOfType(target); + for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) { + var targetProp = _c[_b]; if (!(targetProp.flags & 4194304 /* Prototype */)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { - if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { - continue; - } - var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); - var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); - if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { - var hasDifferingDeclarations = sourceProp.valueDeclaration !== targetProp.valueDeclaration; - if (ts.getCheckFlags(sourceProp) & 512 /* ContainsPrivate */ && hasDifferingDeclarations) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source)); - } - return 0 /* False */; - } - if (hasDifferingDeclarations) { - if (reportErrors) { - if (sourcePropFlags & 8 /* Private */ && targetPropFlags & 8 /* Private */) { - reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); - } - else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourcePropFlags & 8 /* Private */ ? source : target), typeToString(sourcePropFlags & 8 /* Private */ ? target : source)); - } - } - return 0 /* False */; - } - } - else if (targetPropFlags & 16 /* Protected */) { - if (!isValidOverrideOf(sourceProp, targetProp)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(getDeclaringClass(sourceProp) || source), typeToString(getDeclaringClass(targetProp) || target)); - } - return 0 /* False */; - } - } - else if (sourcePropFlags & 16 /* Protected */) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return 0 /* False */; - } - var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + var related = propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSymbol, reportErrors); if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); - } return 0 /* False */; } result &= related; - // When checking for comparability, be more lenient with optional properties. - if (relation !== comparableRelation && sourceProp.flags & 16777216 /* Optional */ && !(targetProp.flags & 16777216 /* Optional */)) { - // TypeScript 1.0 spec (April 2014): 3.8.3 - // S is a subtype of a type T, and T is a supertype of S if ... - // S' and T are object types and, for each member M in T.. - // M is a property and S' contains a property N where - // if M is a required property, N is also a required property - // (M - property in T) - // (N - property in S) - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return 0 /* False */; - } } } } return result; } - function propertiesIdenticalTo(source, target) { + function propertiesIdenticalTo(source, target, excludedProperties) { if (!(source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */)) { return 0 /* False */; } - var sourceProperties = getPropertiesOfObjectType(source); - var targetProperties = getPropertiesOfObjectType(target); + var sourceProperties = excludeProperties(getPropertiesOfObjectType(source), excludedProperties); + var targetProperties = excludeProperties(getPropertiesOfObjectType(target), excludedProperties); if (sourceProperties.length !== targetProperties.length) { return 0 /* False */; } @@ -43444,7 +44191,7 @@ var ts; var result = -1 /* True */; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; - if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { + if (isIgnoredJsxProperty(source, prop)) { continue; } // Skip over symbol-named members @@ -43476,7 +44223,7 @@ var ts; return indexTypesIdenticalTo(source, target, kind); } var targetInfo = getIndexInfoOfType(target, kind); - if (!targetInfo || targetInfo.type.flags & 3 /* AnyOrUnknown */ && !sourceIsPrimitive) { + if (!targetInfo || targetInfo.type.flags & 1 /* Any */ && !sourceIsPrimitive) { // Index signature of type any permits assignment from everything but primitives return -1 /* True */; } @@ -43616,8 +44363,11 @@ var ts; // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { - var tp = typeParameters_1[_i]; + var _loop_10 = function (tp) { + var unmeasurable = false; + var unreliable = false; + var oldHandler = outofbandVarianceMarkerHandler; + outofbandVarianceMarkerHandler = function (onlyUnreliable) { return onlyUnreliable ? unreliable = true : unmeasurable = true; }; // We first compare instantiations where the type parameter is replaced with // marker types that have a known subtype relationship. From this we can infer // invariance, covariance, contravariance or bivariance. @@ -43632,7 +44382,20 @@ var ts; if (variance === 3 /* Bivariant */ && isTypeAssignableTo(createMarkerType(cache, tp, markerOtherType), typeWithSuper)) { variance = 4 /* Independent */; } + outofbandVarianceMarkerHandler = oldHandler; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8 /* Unmeasurable */; + } + if (unreliable) { + variance |= 16 /* Unreliable */; + } + } variances.push(variance); + }; + for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { + var tp = typeParameters_1[_i]; + _loop_10(tp); } cache.variances = variances; } @@ -43649,7 +44412,7 @@ var ts; // See comment at call in recursiveTypeRelatedTo for when this case matters. function hasCovariantVoidArgument(typeArguments, variances) { for (var i = 0; i < variances.length; i++) { - if (variances[i] === 1 /* Covariant */ && typeArguments[i].flags & 16384 /* Void */) { + if ((variances[i] & 7 /* VarianceMask */) === 1 /* Covariant */ && typeArguments[i].flags & 16384 /* Void */) { return true; } } @@ -44074,6 +44837,30 @@ var ts; function getNonNullableType(type) { return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type; } + /** + * Is source potentially coercible to target type under `==`. + * Assumes that `source` is a constituent of a union, hence + * the boolean literal flag on the LHS, but not on the RHS. + * + * This does not fully replicate the semantics of `==`. The + * intention is to catch cases that are clearly not right. + * + * Comparing (string | number) to number should not remove the + * string element. + * + * Comparing (string | number) to 1 will remove the string + * element, though this is not sound. This is a pragmatic + * choice. + * + * @see narrowTypeByEquality + * + * @param source + * @param target + */ + function isCoercibleUnderDoubleEquals(source, target) { + return ((source.flags & (8 /* Number */ | 4 /* String */ | 512 /* BooleanLiteral */)) !== 0) + && ((target.flags & (8 /* Number */ | 4 /* String */ | 16 /* Boolean */)) !== 0); + } /** * Return true if type was inferred from an object literal, written as an object type literal, or is the shape of a module * with no call or construct signatures. @@ -44202,7 +44989,7 @@ var ts; var stringIndexInfo = getIndexInfoOfType(type, 0 /* String */); var numberIndexInfo = getIndexInfoOfType(type, 1 /* Number */); var result = createAnonymousType(type.symbol, members, ts.emptyArray, ts.emptyArray, stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly), numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly)); - result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Retain js literal flag through widening + result.objectFlags |= (ts.getObjectFlags(type) & (16384 /* JSLiteral */ | 524288 /* NonInferrableType */)); // Retain js literal flag through widening return result; } function getWidenedType(type) { @@ -44210,26 +44997,34 @@ var ts; } function getWidenedTypeWithContext(type, context) { if (ts.getObjectFlags(type) & 393216 /* RequiresWidening */) { + if (context === undefined && type.widened) { + return type.widened; + } + var result = void 0; if (type.flags & 98304 /* Nullable */) { - return anyType; + result = anyType; } - if (isObjectLiteralType(type)) { - return getWidenedTypeOfObjectLiteral(type, context); + else if (isObjectLiteralType(type)) { + result = getWidenedTypeOfObjectLiteral(type, context); } - if (type.flags & 1048576 /* Union */) { + else if (type.flags & 1048576 /* Union */) { var unionContext_1 = context || createWideningContext(/*parent*/ undefined, /*propertyName*/ undefined, type.types); var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 98304 /* Nullable */ ? t : getWidenedTypeWithContext(t, unionContext_1); }); // Widening an empty object literal transitions from a highly restrictive type to // a highly inclusive one. For that reason we perform subtype reduction here if the // union includes empty object types (e.g. reducing {} | string to just {}). - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); + result = getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } - if (type.flags & 2097152 /* Intersection */) { - return getIntersectionType(ts.sameMap(type.types, getWidenedType)); + else if (type.flags & 2097152 /* Intersection */) { + result = getIntersectionType(ts.sameMap(type.types, getWidenedType)); } - if (isArrayType(type) || isTupleType(type)) { - return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); + else if (isArrayType(type) || isTupleType(type)) { + result = createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); + } + if (result && context === undefined) { + type.widened = result; } + return result || type; } return type; } @@ -44291,12 +45086,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 204 /* BinaryExpression */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 205 /* BinaryExpression */: + case 155 /* PropertyDeclaration */: + case 154 /* 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 151 /* Parameter */: + case 152 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -44311,30 +45106,30 @@ 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 186 /* BindingElement */: + case 187 /* 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 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = noImplicitAny ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type : ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage; break; - case 181 /* MappedType */: + case 182 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -44454,7 +45249,7 @@ var ts; var objectFlags = ts.getObjectFlags(type); return !!(type.flags & 63176704 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || - objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || + objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & 32 /* Mapped */ || type.flags & 3145728 /* UnionOrIntersection */ && couldUnionOrIntersectionContainTypeVariables(type)); } @@ -44502,19 +45297,20 @@ var ts; reverseMappedCache.set(key, type); return type; } + // We consider a type to be partially inferable if it isn't marked non-inferable or if it is + // an object literal type with at least one property of an inferable type. For example, an object + // literal { a: 123, b: x => true } is marked non-inferable because it contains a context sensitive + // arrow function, but is considered partially inferable because property 'a' has an inferable type. + function isPartiallyInferableType(type) { + return !(ts.getObjectFlags(type) & 524288 /* NonInferrableType */) || + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); + } function createReverseMappedType(source, target, constraint) { - var properties = getPropertiesOfType(source); - if (properties.length === 0 && !getIndexInfoOfType(source, 0 /* String */)) { + // We consider a source type reverse mappable if it has a string index signature or if + // it has one or more properties and is of a partially inferable type. + if (!(getIndexInfoOfType(source, 0 /* String */) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) { return undefined; } - // If any property contains context sensitive functions that have been skipped, the source type - // is incomplete and we can't infer a meaningful input type. - for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { - var prop = properties_3[_i]; - if (ts.getObjectFlags(getTypeOfSymbol(prop)) & 524288 /* ContainsAnyFunctionType */) { - return undefined; - } - } // For arrays and tuples we infer new arrays and tuples where the reverse mapping has been // applied to the element type(s). if (isArrayType(source)) { @@ -44542,20 +45338,20 @@ var ts; var templateType = getTemplateTypeFromMappedType(target); var inference = createInferenceInfo(typeParameter); inferTypes([inference], sourceType, templateType); - return getTypeFromInference(inference); + return getTypeFromInference(inference) || unknownType; } function getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { - var properties, _i, properties_4, targetProp, sourceProp, targetType, sourceType; + var properties, _i, properties_2, targetProp, sourceProp, targetType, sourceType; return __generator(this, function (_a) { switch (_a.label) { case 0: - properties = target.flags & 2097152 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); - _i = 0, properties_4 = properties; + properties = target.flags & 1048576 /* Union */ ? getPossiblePropertiesOfUnionType(target) : getPropertiesOfType(target); + _i = 0, properties_2 = properties; _a.label = 1; case 1: - if (!(_i < properties_4.length)) return [3 /*break*/, 6]; - targetProp = properties_4[_i]; - if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */))) return [3 /*break*/, 5]; + if (!(_i < properties_2.length)) return [3 /*break*/, 6]; + targetProp = properties_2[_i]; + if (!(requireOptionalProperties || !(targetProp.flags & 16777216 /* Optional */ || ts.getCheckFlags(targetProp) & 48 /* Partial */))) return [3 /*break*/, 5]; sourceProp = getPropertyOfType(source, targetProp.escapedName); if (!!sourceProp) return [3 /*break*/, 3]; return [4 /*yield*/, targetProp]; @@ -44596,7 +45392,7 @@ var ts; function getTypeFromInference(inference) { return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : - emptyObjectType; + undefined; } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } @@ -44670,6 +45466,9 @@ var ts; target = removeTypesFromUnionOrIntersection(target, matchingTypes); } } + else if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) { + target = getActualTypeVariable(target); + } if (target.flags & 8650752 /* TypeVariable */) { // If target is a type parameter, make an inference, unless the source type contains // the anyFunctionType (the wildcard type that's used to avoid contextually typing functions). @@ -44678,7 +45477,7 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (ts.getObjectFlags(source) & 524288 /* ContainsAnyFunctionType */ || source === silentNeverType || (priority & 8 /* ReturnType */ && (source === autoType || source === autoArrayType))) { + if (ts.getObjectFlags(source) & 524288 /* NonInferrableType */ || source === silentNeverType || (priority & 16 /* ReturnType */ && (source === autoType || source === autoArrayType))) { return; } var inference = getInferenceInfoForType(target); @@ -44705,7 +45504,7 @@ var ts; inference.inferredType = undefined; } } - if (!(priority & 8 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 16 /* ReturnType */) && target.flags & 262144 /* TypeParameter */ && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; inference.inferredType = undefined; } @@ -44714,16 +45513,16 @@ var ts; } else { // Infer to the simplified version of an indexed access, if possible, to (hopefully) expose more bare type parameters to the inference engine - var simplified = getSimplifiedType(target); + var simplified = getSimplifiedType(target, /*writing*/ false); if (simplified !== target) { inferFromTypesOnce(source, simplified); } else if (target.flags & 8388608 /* IndexedAccess */) { - var indexType = getSimplifiedType(target.indexType); + 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 & 63176704 /* Instantiable */) { - var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType), indexType); + var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { inferFromTypesOnce(source, simplified_1); } @@ -44731,9 +45530,6 @@ var ts; } } } - else if (target.flags & 33554432 /* Substitution */) { - inferFromTypes(source, target.typeVariable); - } if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments || ts.emptyArray; @@ -44741,7 +45537,7 @@ var ts; var count = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; var variances = getVariances(source.target); for (var i = 0; i < count; i++) { - if (i < variances.length && variances[i] === 2 /* Contravariant */) { + if (i < variances.length && (variances[i] & 7 /* VarianceMask */) === 2 /* Contravariant */) { inferFromContravariantTypes(sourceTypes[i], targetTypes[i]); } else { @@ -44758,7 +45554,7 @@ var ts; var empty = createEmptyObjectTypeFromStringLiteral(source); contravariant = !contravariant; var savePriority = priority; - priority |= 16 /* LiteralKeyof */; + priority |= 32 /* LiteralKeyof */; inferFromTypes(empty, target.type); priority = savePriority; contravariant = !contravariant; @@ -44770,37 +45566,53 @@ var ts; else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { inferFromTypes(source.checkType, target.checkType); inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(source.trueType, target.trueType); - inferFromTypes(source.falseType, target.falseType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */ && !contravariant) { - inferFromTypes(source, target.trueType); - inferFromTypes(source, target.falseType); + inferFromTypes(source, getTrueTypeFromConditionalType(target)); + inferFromTypes(source, getFalseTypeFromConditionalType(target)); } else if (target.flags & 3145728 /* UnionOrIntersection */) { + // We infer from types that are not naked type variables first so that inferences we + // make from nested naked type variables and given slightly higher priority by virtue + // of being first in the candidates array. + var typeVariableCount = 0; for (var _d = 0, _e = target.types; _d < _e.length; _d++) { var t = _e[_d]; - var savePriority = priority; - // Inferences directly to naked type variables are given lower priority as they are - // less specific. For example, when inferring from Promise<string> to T | Promise<T>, - // we want to infer string for T, not Promise<string> | string. if (getInferenceInfoForType(t)) { - priority |= 1 /* NakedTypeVariable */; + typeVariableCount++; + } + else { + inferFromTypes(source, t); + } + } + // Inferences directly to naked type variables are given lower priority as they are + // less specific. For example, when inferring from Promise<string> to T | Promise<T>, + // we want to infer string for T, not Promise<string> | string. For intersection types + // we only infer to single naked type variables. + if (target.flags & 1048576 /* Union */ ? typeVariableCount !== 0 : typeVariableCount === 1) { + var savePriority = priority; + priority |= 1 /* NakedTypeVariable */; + for (var _f = 0, _g = target.types; _f < _g.length; _f++) { + var t = _g[_f]; + if (getInferenceInfoForType(t)) { + inferFromTypes(source, t); + } } - inferFromTypes(source, t); priority = savePriority; } } else if (source.flags & 1048576 /* Union */) { // Source is a union or intersection type, infer from each constituent type var sourceTypes = source.types; - for (var _f = 0, sourceTypes_3 = sourceTypes; _f < sourceTypes_3.length; _f++) { - var sourceType = sourceTypes_3[_f]; + for (var _h = 0, sourceTypes_3 = sourceTypes; _h < sourceTypes_3.length; _h++) { + var sourceType = sourceTypes_3[_h]; inferFromTypes(sourceType, target); } } else { - if (!(priority & 32 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { + if (!(priority & 64 /* 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` @@ -44853,7 +45665,7 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes || priority & 64 /* AlwaysStrict */) { + if (strictFunctionTypes || priority & 128 /* AlwaysStrict */) { contravariant = !contravariant; inferFromTypes(source, target); contravariant = !contravariant; @@ -44892,7 +45704,11 @@ var ts; var inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType); if (inferredType) { var savePriority = priority; - priority |= 2 /* HomomorphicMappedType */; + // We assign a lower priority to inferences made from types containing non-inferrable + // types because we may only have a partial result (i.e. we may have failed to make + // reverse inferences for some properties). + priority |= ts.getObjectFlags(source) & 524288 /* NonInferrableType */ ? + 4 /* PartialHomomorphicMappedType */ : 2 /* HomomorphicMappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -44903,7 +45719,7 @@ var ts; // We're inferring from some source type S to a mapped type { [P in K]: X }, where K is a type // parameter. First infer from 'keyof S' to K. var savePriority = priority; - priority |= 4 /* MappedTypeConstraint */; + priority |= 8 /* MappedTypeConstraint */; inferFromTypes(getIndexType(source), constraintType); priority = savePriority; // If K is constrained to a type C, also infer to C. Thus, for a mapped type { [P in K]: X }, @@ -44916,11 +45732,11 @@ var ts; } // If no inferences can be made to K's constraint, infer from a union of the property types // in the source to the template type X. - var valueTypes = ts.compact([ - getIndexTypeOfType(source, 0 /* String */), - getIndexTypeOfType(source, 1 /* Number */) - ].concat(ts.map(getPropertiesOfType(source), getTypeOfSymbol))); - inferFromTypes(getUnionType(valueTypes), getTemplateTypeFromMappedType(target)); + var propTypes = ts.map(getPropertiesOfType(source), getTypeOfSymbol); + var stringIndexType = getIndexTypeOfType(source, 0 /* String */); + var numberIndexInfo = getNonEnumNumberIndexInfo(source); + var numberIndexType = numberIndexInfo && numberIndexInfo.type; + inferFromTypes(getUnionType(ts.append(ts.append(propTypes, stringIndexType), numberIndexType)), getTemplateTypeFromMappedType(target)); return true; } return false; @@ -44974,8 +45790,8 @@ var ts; } } var properties = getPropertiesOfObjectType(target); - for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) { - var targetProp = properties_5[_i]; + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var targetProp = properties_3[_i]; var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -44988,7 +45804,7 @@ var ts; var sourceLen = sourceSignatures.length; var targetLen = targetSignatures.length; var len = sourceLen < targetLen ? sourceLen : targetLen; - var skipParameters = !!(ts.getObjectFlags(source) & 524288 /* ContainsAnyFunctionType */); + var skipParameters = !!(ts.getObjectFlags(source) & 524288 /* NonInferrableType */); for (var i = 0; i < len; i++) { inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i]), getBaseSignature(targetSignatures[targetLen - len + i]), skipParameters); } @@ -44998,7 +45814,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 === 156 /* MethodDeclaration */ || kind === 155 /* MethodSignature */ || kind === 157 /* Constructor */; + bivariant = bivariant || kind === 157 /* MethodDeclaration */ || kind === 156 /* MethodSignature */ || kind === 158 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -45065,7 +45881,7 @@ var ts; return candidates; } function getContravariantInference(inference) { - return inference.priority & 28 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); + return inference.priority & 56 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); } function getCovariantInference(inference, signature) { // Extract all object literal types and replace them with a single widened and normalized type. @@ -45082,15 +45898,15 @@ var ts; candidates; // If all inferences were made from a position that implies a combined result, infer a union type. // Otherwise, infer a common supertype. - var unwidenedType = inference.priority & 28 /* PriorityImpliesCombination */ ? + var unwidenedType = inference.priority & 56 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates); return getWidenedType(unwidenedType); } function getInferredType(context, index) { var inference = context.inferences[index]; - var inferredType = inference.inferredType; - if (!inferredType) { + if (!inference.inferredType) { + var inferredType = void 0; var signature = context.signature; if (signature) { var inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined; @@ -45121,27 +45937,24 @@ var ts; // parameter should be instantiated to the empty object type. inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context, index), context.nonFixingMapper)); } - else { - inferredType = getDefaultTypeArgumentType(!!(context.flags & 2 /* AnyDefault */)); - } } } else { inferredType = getTypeFromInference(inference); } - inference.inferredType = inferredType; + inference.inferredType = inferredType || getDefaultTypeArgumentType(!!(context.flags & 2 /* AnyDefault */)); var constraint = getConstraintOfTypeParameter(inference.typeParameter); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper); - if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { inference.inferredType = inferredType = instantiatedConstraint; } } } - return inferredType; + return inference.inferredType; } function getDefaultTypeArgumentType(isInJavaScriptFile) { - return isInJavaScriptFile ? anyType : emptyObjectType; + return isInJavaScriptFile ? anyType : unknownType; } function getInferredTypes(context) { var result = []; @@ -45151,8 +45964,8 @@ var ts; return result; } // EXPRESSION TYPE CHECKING - function getCannotFindNameDiagnosticForName(name) { - switch (name) { + function getCannotFindNameDiagnosticForName(node) { + switch (node.escapedText) { case "document": case "console": return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; @@ -45183,14 +45996,20 @@ var ts; case "Iterator": case "AsyncIterator": 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: return ts.Diagnostics.Cannot_find_name_0; + default: + if (node.parent.kind === 277 /* ShorthandPropertyAssignment */) { + return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; + } + else { + return ts.Diagnostics.Cannot_find_name_0; + } } } function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 67220415 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node.escapedText), node, !ts.isWriteOnlyAccess(node), + resolveName(node, node.escapedText, 67220415 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node), /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; @@ -45199,7 +46018,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 === 167 /* TypeQuery */ ? true : n.kind === 72 /* Identifier */ || n.kind === 148 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 168 /* TypeQuery */ ? true : n.kind === 73 /* Identifier */ || n.kind === 149 /* 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 @@ -45207,21 +46026,21 @@ var ts; // The result is undefined if the reference isn't a dotted name. We prefix nodes // occurring in an apparent type position with '@' because the control flow type // of such nodes may be based on the apparent type instead of the declared type. - function getFlowCacheKey(node) { + function getFlowCacheKey(node, declaredType, initialType, flowContainer) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: var symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; - case 100 /* ThisKeyword */: + return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + case 101 /* ThisKeyword */: return "0"; - case 213 /* NonNullExpression */: - case 195 /* ParenthesizedExpression */: - return getFlowCacheKey(node.expression); - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 214 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: + return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { - var key = getFlowCacheKey(node.expression); + var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); return key && key + "." + propName; } } @@ -45229,24 +46048,24 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 195 /* ParenthesizedExpression */: - case 213 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: + case 214 /* NonNullExpression */: return isMatchingReference(source, target.expression); } switch (source.kind) { - case 72 /* Identifier */: - return target.kind === 72 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 237 /* VariableDeclaration */ || target.kind === 186 /* BindingElement */) && + case 73 /* Identifier */: + return target.kind === 73 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || + (target.kind === 238 /* VariableDeclaration */ || target.kind === 187 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); - case 100 /* ThisKeyword */: - return target.kind === 100 /* ThisKeyword */; - case 98 /* SuperKeyword */: - return target.kind === 98 /* SuperKeyword */; - case 213 /* NonNullExpression */: - case 195 /* ParenthesizedExpression */: + case 101 /* ThisKeyword */: + return target.kind === 101 /* ThisKeyword */; + case 99 /* SuperKeyword */: + return target.kind === 99 /* SuperKeyword */; + case 214 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -45254,7 +46073,7 @@ var ts; return false; } function getAccessedPropertyName(access) { - return access.kind === 189 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 190 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringLiteral(access.argumentExpression) || ts.isNumericLiteral(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -45279,7 +46098,7 @@ var ts; isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), name); } function getDeclaredTypeOfReference(expr) { - if (expr.kind === 72 /* Identifier */) { + if (expr.kind === 73 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } if (ts.isAccessExpression(expr)) { @@ -45301,7 +46120,7 @@ var ts; if (prop && ts.getCheckFlags(prop) & 2 /* SyntheticProperty */) { if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = - (prop.checkFlags & 96 /* Discriminant */) === 96 /* Discriminant */ && + (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && isDiscriminantType(getTypeOfSymbol(prop)); } return !!prop.isDiscriminantProperty; @@ -45310,7 +46129,7 @@ var ts; return false; } function isSyntheticThisPropertyAccess(expr) { - return ts.isAccessExpression(expr) && expr.expression.kind === 100 /* ThisKeyword */ && !!(expr.expression.flags & 8 /* Synthesized */); + return ts.isAccessExpression(expr) && expr.expression.kind === 101 /* ThisKeyword */ && !!(expr.expression.flags & 8 /* Synthesized */); } function findDiscriminantProperties(sourceProperties, target) { var result; @@ -45338,7 +46157,7 @@ var ts; } } } - if (callExpression.expression.kind === 189 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 190 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -45457,7 +46276,7 @@ var ts; return strictNullChecks ? 7888800 /* ObjectStrictFacts */ : 16736160 /* ObjectFacts */; } if (flags & 63176704 /* Instantiable */) { - return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); + return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); @@ -45493,15 +46312,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 187 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 275 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 188 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 276 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 204 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 227 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 205 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 228 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -45518,21 +46337,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return stringType; - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return undefinedType; - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -45540,7 +46359,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 184 /* ObjectBindingPattern */ ? + var type = pattern.kind === 185 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -45558,37 +46377,37 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 226 /* ForInStatement */) { + if (node.parent.parent.kind === 227 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 227 /* ForOfStatement */) { + if (node.parent.parent.kind === 228 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 237 /* VariableDeclaration */ ? + return node.kind === 238 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node, reference) { - return getConstraintForLocation(node.kind === 237 /* VariableDeclaration */ || node.kind === 186 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 238 /* VariableDeclaration */ || node.kind === 187 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } function isEmptyArrayAssignment(node) { - return node.kind === 237 /* VariableDeclaration */ && node.initializer && + return node.kind === 238 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 186 /* BindingElement */ && node.parent.kind === 204 /* BinaryExpression */ && + node.kind !== 187 /* BindingElement */ && node.parent.kind === 205 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: switch (node.operatorToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: return getReferenceCandidate(node.left); case 27 /* CommaToken */: return getReferenceCandidate(node.right); @@ -45598,13 +46417,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 195 /* ParenthesizedExpression */ || - parent.kind === 204 /* BinaryExpression */ && parent.operatorToken.kind === 59 /* EqualsToken */ && parent.left === node || - parent.kind === 204 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 196 /* ParenthesizedExpression */ || + parent.kind === 205 /* BinaryExpression */ && parent.operatorToken.kind === 60 /* EqualsToken */ && parent.left === node || + parent.kind === 205 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 271 /* CaseClause */) { + if (clause.kind === 272 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -45626,7 +46445,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 271 /* CaseClause */) { + if (clause.kind === 272 /* CaseClause */) { if (clause.expression.kind === 10 /* StringLiteral */) { witnesses.push(clause.expression.text); continue; @@ -45672,6 +46491,9 @@ var ts; } return f(type) ? type : neverType; } + function countTypes(type) { + return type.flags & 1048576 /* Union */ ? type.types.length : 1; + } function mapType(type, mapper, noReductions) { if (type.flags & 131072 /* Never */) { return type; @@ -45679,25 +46501,20 @@ var ts; if (!(type.flags & 1048576 /* Union */)) { return mapper(type); } - var types = type.types; - var mappedType; var mappedTypes; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var current = types_13[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + for (var _i = 0, _a = type.types; _i < _a.length; _i++) { + var t = _a[_i]; + var mapped = mapper(t); + if (mapped) { + if (!mappedTypes) { + mappedTypes = [mapped]; } else { - mappedTypes.push(t); + mappedTypes.push(mapped); } } } - return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : mappedType; + return mappedTypes && getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */); } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -45765,8 +46582,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - 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]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -45789,12 +46606,12 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 189 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 191 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 190 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 190 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 192 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 191 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 204 /* BinaryExpression */ && - parent.parent.operatorToken.kind === 59 /* EqualsToken */ && + parent.parent.kind === 205 /* BinaryExpression */ && + parent.parent.operatorToken.kind === 60 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296 /* NumberLike */); @@ -45808,7 +46625,7 @@ var ts; return links.maybeTypePredicate; } function getMaybeTypePredicate(node) { - if (node.expression.kind !== 98 /* SuperKeyword */) { + if (node.expression.kind !== 99 /* SuperKeyword */) { var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); @@ -45826,6 +46643,7 @@ var ts; function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, couldBeUninitialized) { if (initialType === void 0) { initialType = declaredType; } var key; + var keySet = false; var flowDepth = 0; if (flowAnalysisDisabled) { return errorType; @@ -45841,10 +46659,17 @@ 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 (reference.parent && reference.parent.kind === 213 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (reference.parent && reference.parent.kind === 214 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; + function getOrSetCacheKey() { + if (keySet) { + return key; + } + keySet = true; + return key = getFlowCacheKey(reference, declaredType, initialType, flowContainer); + } function getTypeAtFlowNode(flow) { if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error @@ -45856,6 +46681,15 @@ var ts; flowDepth++; while (true) { var flags = flow.flags; + if (flags & 8192 /* Cached */) { + var key_2 = getOrSetCacheKey(); + if (key_2) { + var id = getFlowNodeId(flow); + if (flowAssignmentKeys[id] === key_2) { + return flowAssignmentTypes[id]; + } + } + } if (flags & 1024 /* Shared */) { // We cache results of flow type resolution for shared nodes that were previously visited in // the same getFlowTypeOfReference invocation. A node is considered shared when it is the @@ -45886,6 +46720,15 @@ var ts; flow = flow.antecedent; continue; } + else if (flowLoopCount === flowLoopStart) { // Only cache assignments when not within loop analysis + var key_3 = getOrSetCacheKey(); + if (key_3 && !isIncomplete(type)) { + flow.flags |= 8192 /* Cached */; + var id = getFlowNodeId(flow); + flowAssignmentKeys[id] = key_3; + flowAssignmentTypes[id] = type; + } + } } else if (flags & 96 /* Condition */) { type = getTypeAtFlowCondition(flow); @@ -45913,9 +46756,9 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.container; if (container && container !== flowContainer && - reference.kind !== 189 /* PropertyAccessExpression */ && - reference.kind !== 190 /* ElementAccessExpression */ && - reference.kind !== 100 /* ThisKeyword */) { + reference.kind !== 190 /* PropertyAccessExpression */ && + reference.kind !== 191 /* ElementAccessExpression */ && + reference.kind !== 101 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -45967,14 +46810,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 === 196 /* FunctionExpression */ || init.kind === 197 /* ArrowFunction */)) { + if (init && (init.kind === 197 /* FunctionExpression */ || init.kind === 198 /* 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 === 226 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 227 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -45983,7 +46826,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 191 /* CallExpression */ ? + var expr = node.kind === 192 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -45991,7 +46834,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 191 /* CallExpression */) { + if (node.kind === 192 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -46044,7 +46887,7 @@ var ts; else if (isMatchingReferenceDiscriminant(expr, type)) { type = narrowTypeByDiscriminant(type, expr, function (t) { return narrowTypeBySwitchOnDiscriminant(t, flow.switchStatement, flow.clauseStart, flow.clauseEnd); }); } - else if (expr.kind === 199 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 200 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else if (containsMatchingReferenceDiscriminant(reference, expr)) { @@ -46091,12 +46934,10 @@ var ts; // this flow loop junction, return the cached type. var id = getFlowNodeId(flow); var cache = flowLoopCaches[id] || (flowLoopCaches[id] = ts.createMap()); + var key = getOrSetCacheKey(); if (!key) { - key = getFlowCacheKey(reference); // No cache key is generated when binding patterns are in unnarrowable situations - if (!key) { - return declaredType; - } + return declaredType; } var cached = cache.get(key); if (cached) { @@ -46204,7 +47045,7 @@ var ts; return !assumeTrue; } function narrowByInKeyword(type, literal, assumeTrue) { - if ((type.flags & (1048576 /* Union */ | 524288 /* Object */)) || (type.flags & 262144 /* TypeParameter */ && type.isThisType)) { + if (type.flags & (1048576 /* Union */ | 524288 /* Object */) || isThisTypeParameter(type)) { var propName_1 = ts.escapeLeadingUnderscores(literal.text); return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); } @@ -46212,8 +47053,8 @@ var ts; } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { - case 59 /* EqualsToken */: - return narrowTypeByTruthiness(type, expr.left, assumeTrue); + case 60 /* EqualsToken */: + return narrowTypeByTruthiness(narrowType(type, expr.right, assumeTrue), expr.left, assumeTrue); case 33 /* EqualsEqualsToken */: case 34 /* ExclamationEqualsToken */: case 35 /* EqualsEqualsEqualsToken */: @@ -46221,10 +47062,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 === 199 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 200 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 199 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 200 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -46243,9 +47084,9 @@ var ts; return declaredType; } break; - case 94 /* InstanceOfKeyword */: + case 95 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); - case 93 /* InKeyword */: + case 94 /* InKeyword */: var target = getReferenceCandidate(expr.right); if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { return narrowByInKeyword(type, expr.left, assumeTrue); @@ -46289,7 +47130,10 @@ var ts; return type; } if (assumeTrue) { - var narrowedType = filterType(type, function (t) { return areTypesComparable(t, valueType); }); + var filterFn = operator === 33 /* EqualsEqualsToken */ ? + (function (t) { return areTypesComparable(t, valueType) || isCoercibleUnderDoubleEquals(t, valueType); }) : + function (t) { return areTypesComparable(t, valueType); }; + var narrowedType = filterType(type, filterFn); return narrowedType.flags & 131072 /* Never */ ? type : replacePrimitivesWithLiterals(narrowedType, valueType); } if (isUnitType(valueType)) { @@ -46578,19 +47422,19 @@ var ts; // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 72 /* Identifier */: - case 100 /* ThisKeyword */: - case 98 /* SuperKeyword */: - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 73 /* Identifier */: + case 101 /* ThisKeyword */: + case 99 /* SuperKeyword */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: if (expr.operator === 52 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -46605,7 +47449,7 @@ var ts; // an dotted name expression, and if the location is not an assignment target, obtain the type // of the expression (which will reflect control flow analysis). If the expression indeed // resolved to the given symbol, return the narrowed type. - if (location.kind === 72 /* Identifier */) { + if (location.kind === 73 /* Identifier */) { if (ts.isRightSideOfQualifiedNameOrPropertyAccess(location)) { location = location.parent; } @@ -46626,9 +47470,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 245 /* ModuleBlock */ || - node.kind === 284 /* SourceFile */ || - node.kind === 154 /* PropertyDeclaration */; + node.kind === 246 /* ModuleBlock */ || + node.kind === 285 /* SourceFile */ || + node.kind === 155 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -46647,10 +47491,10 @@ var ts; return !!ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */); }); } function markParameterAssignments(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 151 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 152 /* Parameter */) { symbol.isAssigned = true; } } @@ -46665,7 +47509,7 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 151 /* Parameter */ && + declaration.kind === 152 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -46673,13 +47517,13 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 189 /* PropertyAccessExpression */ || - parent.kind === 191 /* CallExpression */ && parent.expression === node || - parent.kind === 190 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 186 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 190 /* PropertyAccessExpression */ || + parent.kind === 192 /* CallExpression */ && parent.expression === node || + parent.kind === 191 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 187 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 98304 /* Nullable */); + return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); } function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, @@ -46710,7 +47554,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 197 /* ArrowFunction */) { + if (container.kind === 198 /* 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.hasModifier(container, 256 /* Async */)) { @@ -46731,7 +47575,7 @@ var ts; // 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 === 240 /* ClassDeclaration */ + if (declaration.kind === 241 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -46743,14 +47587,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 209 /* ClassExpression */) { + else if (declaration.kind === 210 /* 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 !== 284 /* SourceFile */) { + while (container.kind !== 285 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 154 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 155 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -46799,7 +47643,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 === 151 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 152 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -46808,19 +47652,19 @@ 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 === 196 /* FunctionExpression */ || - flowContainer.kind === 197 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 197 /* FunctionExpression */ || + flowContainer.kind === 198 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } // We only look for uninitialized variables in strict null checking mode, and only when we can analyze // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). - var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 3 /* AnyOrUnknown */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 257 /* ExportSpecifier */) || - node.parent.kind === 213 /* NonNullExpression */ || - declaration.kind === 237 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 258 /* ExportSpecifier */) || + node.parent.kind === 214 /* NonNullExpression */ || + declaration.kind === 238 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 4194304 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -46855,7 +47699,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 274 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 275 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -46878,7 +47722,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container) && - ts.getAncestor(symbol.valueDeclaration, 238 /* VariableDeclarationList */).parent === container) { + ts.getAncestor(symbol.valueDeclaration, 239 /* VariableDeclarationList */).parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { var links = getNodeLinks(part); @@ -46896,8 +47740,8 @@ 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 (container.kind === 225 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 238 /* VariableDeclarationList */).parent === container && + if (container.kind === 226 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 239 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -46915,7 +47759,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 195 /* ParenthesizedExpression */) { + while (current.parent.kind === 196 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -46923,7 +47767,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 202 /* PrefixUnaryExpression */ || current.parent.kind === 203 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 203 /* PrefixUnaryExpression */ || current.parent.kind === 204 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 44 /* PlusPlusToken */ || expr.operator === 45 /* MinusMinusToken */; } @@ -46936,7 +47780,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 154 /* PropertyDeclaration */ || container.kind === 157 /* Constructor */) { + if (container.kind === 155 /* PropertyDeclaration */ || container.kind === 158 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -47004,37 +47848,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 157 /* Constructor */) { + if (container.kind === 158 /* 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 === 197 /* ArrowFunction */) { + if (container.kind === 198 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 244 /* ModuleDeclaration */: + case 245 /* 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 243 /* EnumDeclaration */: + case 244 /* 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 157 /* Constructor */: + case 158 /* 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 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { 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 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -47084,7 +47928,7 @@ var ts; // * /** @constructor */ function [name]() { ... } // * /** @constructor */ var x = function() { ... } else if (isInJS && - (container.kind === 196 /* FunctionExpression */ || container.kind === 239 /* FunctionDeclaration */) && + (container.kind === 197 /* FunctionExpression */ || container.kind === 240 /* FunctionDeclaration */) && ts.getJSDocClassTag(container)) { var classType = getJSClassType(getMergedSymbol(container.symbol)); if (classType) { @@ -47120,7 +47964,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 196 /* FunctionExpression */ && + if (container.kind === 197 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -47130,16 +47974,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 156 /* MethodDeclaration */ && - container.parent.kind === 188 /* ObjectLiteralExpression */ && + else if (container.kind === 157 /* MethodDeclaration */ && + container.parent.kind === 189 /* 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 === 196 /* FunctionExpression */ && - container.parent.kind === 275 /* PropertyAssignment */ && - container.parent.parent.kind === 188 /* ObjectLiteralExpression */ && + else if (container.kind === 197 /* FunctionExpression */ && + container.parent.kind === 276 /* PropertyAssignment */ && + container.parent.parent.kind === 189 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -47147,7 +47991,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 === 196 /* FunctionExpression */ && + else if (container.kind === 197 /* 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") && @@ -47172,7 +48016,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 294 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 295 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -47186,15 +48030,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 151 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 152 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 191 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 192 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); 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 === 197 /* ArrowFunction */) { + while (container && container.kind === 198 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -47207,14 +48051,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 149 /* ComputedPropertyName */; }); - if (current && current.kind === 149 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 150 /* ComputedPropertyName */; }); + if (current && current.kind === 150 /* 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 === 188 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 189 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -47222,7 +48066,7 @@ var ts; } return errorType; } - if (!isCallExpression && container.kind === 157 /* Constructor */) { + if (!isCallExpression && container.kind === 158 /* 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.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -47291,7 +48135,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 === 156 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 157 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -47305,7 +48149,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 188 /* ObjectLiteralExpression */) { + if (container.parent.kind === 189 /* 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; @@ -47326,7 +48170,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 157 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 158 /* 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; @@ -47341,7 +48185,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 === 157 /* Constructor */; + return container.kind === 158 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -47349,21 +48193,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 === 188 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 189 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 156 /* MethodDeclaration */ || - container.kind === 155 /* MethodSignature */ || - container.kind === 158 /* GetAccessor */ || - container.kind === 159 /* SetAccessor */; + return container.kind === 157 /* MethodDeclaration */ || + container.kind === 156 /* MethodSignature */ || + container.kind === 159 /* GetAccessor */ || + container.kind === 160 /* SetAccessor */; } else { - return container.kind === 156 /* MethodDeclaration */ || - container.kind === 155 /* MethodSignature */ || - container.kind === 158 /* GetAccessor */ || - container.kind === 159 /* SetAccessor */ || - container.kind === 154 /* PropertyDeclaration */ || - container.kind === 153 /* PropertySignature */ || - container.kind === 157 /* Constructor */; + return container.kind === 157 /* MethodDeclaration */ || + container.kind === 156 /* MethodSignature */ || + container.kind === 159 /* GetAccessor */ || + container.kind === 160 /* SetAccessor */ || + container.kind === 155 /* PropertyDeclaration */ || + container.kind === 154 /* PropertySignature */ || + container.kind === 158 /* Constructor */; } } } @@ -47371,10 +48215,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 156 /* MethodDeclaration */ || - func.kind === 158 /* GetAccessor */ || - func.kind === 159 /* SetAccessor */) && func.parent.kind === 188 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 196 /* FunctionExpression */ && func.parent.kind === 275 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 157 /* MethodDeclaration */ || + func.kind === 159 /* GetAccessor */ || + func.kind === 160 /* SetAccessor */) && func.parent.kind === 189 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 197 /* FunctionExpression */ && func.parent.kind === 276 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -47386,7 +48230,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 197 /* ArrowFunction */) { + if (func.kind === 198 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -47413,7 +48257,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 275 /* PropertyAssignment */) { + if (literal.parent.kind !== 276 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -47427,9 +48271,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 204 /* BinaryExpression */ && parent.operatorToken.kind === 59 /* EqualsToken */) { + if (parent.kind === 205 /* BinaryExpression */ && parent.operatorToken.kind === 60 /* EqualsToken */) { var target = parent.left; - if (target.kind === 189 /* PropertyAccessExpression */ || target.kind === 190 /* ElementAccessExpression */) { + if (target.kind === 190 /* PropertyAccessExpression */ || target.kind === 191 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -47480,9 +48324,9 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 151 /* Parameter */: + case 152 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return getContextualTypeForBindingElement(declaration); // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } @@ -47603,16 +48447,16 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 193 /* TaggedTemplateExpression */) { + if (template.parent.kind === 194 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; } - function getContextualTypeForBinaryOperand(node) { + function getContextualTypeForBinaryOperand(node, contextFlags) { var binaryExpression = node.parent; var left = binaryExpression.left, operatorToken = binaryExpression.operatorToken, right = binaryExpression.right; switch (operatorToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: if (node !== right) { return undefined; } @@ -47625,12 +48469,12 @@ var ts; // When an || expression has a contextual type, the operands are contextually typed by that type. When an || // expression has no contextual type, the right operand is contextually typed by the type of the left operand, // except for the special case of Javascript declarations of the form `namespace.prop = namespace.prop || {}` - var type = getContextualType(binaryExpression); + var type = getContextualType(binaryExpression, contextFlags); return !type && node === right && !ts.isDefaultedExpandoInitializer(binaryExpression) ? getTypeOfExpression(left) : type; case 54 /* AmpersandAmpersandToken */: case 27 /* CommaToken */: - return node === right ? getContextualType(binaryExpression) : undefined; + return node === right ? getContextualType(binaryExpression, contextFlags) : undefined; default: return undefined; } @@ -47737,24 +48581,24 @@ var ts; // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one // exists. Otherwise, it is the type of the string index signature in T, if one exists. - function getContextualTypeForObjectLiteralMethod(node) { + function getContextualTypeForObjectLiteralMethod(node, contextFlags) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); if (node.flags & 8388608 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } - return getContextualTypeForObjectLiteralElement(node); + return getContextualTypeForObjectLiteralElement(node, contextFlags); } - function getContextualTypeForObjectLiteralElement(element) { + function getContextualTypeForObjectLiteralElement(element, contextFlags) { var objectLiteral = element.parent; - var type = getApparentTypeOfContextualType(objectLiteral); + var type = getApparentTypeOfContextualType(objectLiteral, contextFlags); if (type) { if (!hasNonBindableDynamicName(element)) { // For a (non-symbol) computed property, there is no reason to look up the name // in the type. It will just be "__computed", which does not appear in any // SymbolTable. - var symbolName_2 = getSymbolOfNode(element).escapedName; - var propertyType = getTypeOfPropertyOfContextualType(type, symbolName_2); + var symbolName_3 = getSymbolOfNode(element).escapedName; + var propertyType = getTypeOfPropertyOfContextualType(type, symbolName_3); if (propertyType) { return propertyType; } @@ -47773,9 +48617,9 @@ var ts; || getIteratedTypeOrElementType(arrayContextualType, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. - function getContextualTypeForConditionalOperand(node) { + function getContextualTypeForConditionalOperand(node, contextFlags) { var conditional = node.parent; - return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; + return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : undefined; } function getContextualTypeForChildJsxExpression(node, child) { var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); @@ -47784,16 +48628,17 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var childIndex = node.children.indexOf(child); + var realChildren = getSemanticJsxChildren(node.children); + var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); - return childFieldType && mapType(childFieldType, function (t) { + return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { if (isArrayLikeType(t)) { return getIndexedAccessType(t, getLiteralType(childIndex)); } else { return t; } - }, /*noReductions*/ true); + }, /*noReductions*/ true)); } function getContextualTypeForJsxExpression(node) { var exprParent = node.parent; @@ -47827,30 +48672,30 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 96 /* NullKeyword */: - case 72 /* Identifier */: - case 141 /* UndefinedKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 97 /* NullKeyword */: + case 73 /* Identifier */: + case 142 /* UndefinedKeyword */: return true; - case 189 /* PropertyAccessExpression */: - case 195 /* ParenthesizedExpression */: + case 190 /* PropertyAccessExpression */: + case 196 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 270 /* JsxExpression */: + case 271 /* 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 === 275 /* 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 === 276 /* 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 === 267 /* 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 === 268 /* 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. - function getApparentTypeOfContextualType(node) { - var contextualType = instantiateContextualType(getContextualType(node), node); + function getApparentTypeOfContextualType(node, contextFlags) { + var contextualType = instantiateContextualType(getContextualType(node, contextFlags), node, contextFlags); if (contextualType) { var apparentType = mapType(contextualType, getApparentType, /*noReductions*/ true); if (apparentType.flags & 1048576 /* Union */) { @@ -47866,11 +48711,22 @@ 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) { + function instantiateContextualType(contextualType, node, contextFlags) { if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); - if (inferenceContext && inferenceContext.returnMapper) { - return instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); + // 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. + if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) { + // For contextual signatures we incorporate all inferences made so far, e.g. from return + // types as well as arguments to the left in a function call. + if (contextFlags && contextFlags & 1 /* Signature */) { + return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); + } + // For other purposes (e.g. determining whether to produce literal types) we only + // incorporate inferences made from the return type in a function call. + if (inferenceContext.returnMapper) { + return instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); + } } } return contextualType; @@ -47907,7 +48763,7 @@ var ts; * @param node the expression whose contextual type will be returned. * @returns the contextual type of an expression. */ - function getContextualType(node) { + function getContextualType(node, contextFlags) { if (node.flags & 8388608 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; @@ -47917,54 +48773,54 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 237 /* VariableDeclaration */: - case 151 /* Parameter */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 186 /* BindingElement */: + case 238 /* VariableDeclaration */: + case 152 /* Parameter */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 187 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 197 /* ArrowFunction */: - case 230 /* ReturnStatement */: + case 198 /* ArrowFunction */: + case 231 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent); - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? undefined : getTypeFromTypeNode(parent.type); - case 204 /* BinaryExpression */: - return getContextualTypeForBinaryOperand(node); - case 275 /* PropertyAssignment */: - case 276 /* ShorthandPropertyAssignment */: - return getContextualTypeForObjectLiteralElement(parent); - case 277 /* SpreadAssignment */: - return getApparentTypeOfContextualType(parent.parent); - case 187 /* ArrayLiteralExpression */: { + case 205 /* BinaryExpression */: + return getContextualTypeForBinaryOperand(node, contextFlags); + case 276 /* PropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: + return getContextualTypeForObjectLiteralElement(parent, contextFlags); + case 278 /* SpreadAssignment */: + return getApparentTypeOfContextualType(parent.parent, contextFlags); + case 188 /* ArrayLiteralExpression */: { var arrayLiteral = parent; - var type = getApparentTypeOfContextualType(arrayLiteral); + var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 205 /* ConditionalExpression */: - return getContextualTypeForConditionalOperand(node); - case 216 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 206 /* TemplateExpression */); + case 206 /* ConditionalExpression */: + return getContextualTypeForConditionalOperand(node, contextFlags); + case 217 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 207 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 195 /* ParenthesizedExpression */: { + case 196 /* 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); + return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 267 /* JsxAttribute */: - case 269 /* JsxSpreadAttribute */: + case 268 /* JsxAttribute */: + case 270 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 262 /* JsxOpeningElement */: - case 261 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent); } return undefined; @@ -47986,7 +48842,7 @@ var ts; return getJsxReferenceKind(node) !== 0 /* Component */ ? getJsxPropsTypeFromCallSignature(signature, node) : getJsxPropsTypeFromClassType(signature, node); } function getJsxPropsTypeFromCallSignature(sig, context) { - var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType); + var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType); propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType); var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== errorType) { @@ -48057,7 +48913,7 @@ var ts; var forcedLookupLocation = getJsxElementPropertiesName(ns); var attributesType = forcedLookupLocation === undefined // If there is no type ElementAttributesProperty, return the type of the first parameter of the signature, which should be the props type - ? getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType) + ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType) : forcedLookupLocation === "" // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead ? getReturnTypeOfSignature(sig) @@ -48068,7 +48924,7 @@ var ts; if (!!forcedLookupLocation && !!ts.length(context.attributes.properties)) { error(context, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(forcedLookupLocation)); } - return emptyObjectType; + return unknownType; } attributesType = getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType); if (isTypeAny(attributesType)) { @@ -48119,7 +48975,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 196 /* FunctionExpression */ || node.kind === 197 /* ArrowFunction */; + return node.kind === 197 /* FunctionExpression */ || node.kind === 198 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -48127,23 +48983,20 @@ var ts; ? getContextualSignature(node) : undefined; } - function getContextualTypeForFunctionLikeDeclaration(node) { - return ts.isObjectLiteralMethod(node) ? - getContextualTypeForObjectLiteralMethod(node) : - getApparentTypeOfContextualType(node); - } // Return the contextual signature for a given expression node. A contextual type provides a // contextual signature if it has a single call signature and if that call signature is non-generic. // If the contextual type is a union type, get the signature from each type possible and if they are // 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 !== 156 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 157 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; } - var type = getContextualTypeForFunctionLikeDeclaration(node); + var type = ts.isObjectLiteralMethod(node) ? + getContextualTypeForObjectLiteralMethod(node, 1 /* Signature */) : + getApparentTypeOfContextualType(node, 1 /* Signature */); if (!type) { return undefined; } @@ -48152,8 +49005,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var current = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var current = types_14[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -48181,8 +49034,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 186 /* BindingElement */ && !!node.initializer) || - (node.kind === 204 /* BinaryExpression */ && node.operatorToken.kind === 59 /* EqualsToken */); + return (node.kind === 187 /* BindingElement */ && !!node.initializer) || + (node.kind === 205 /* BinaryExpression */ && node.operatorToken.kind === 60 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -48194,7 +49047,7 @@ var ts; var inConstContext = isConstContext(node); for (var index = 0; index < elementCount; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 208 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 209 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -48219,12 +49072,12 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple); elementTypes.push(type); } - if (index < elementCount - 1 && e.kind === 208 /* SpreadElement */) { + if (index < elementCount - 1 && e.kind === 209 /* SpreadElement */) { hasNonEndingSpreadElement = true; } } if (!hasNonEndingSpreadElement) { - var hasRestElement = elementCount > 0 && elements[elementCount - 1].kind === 208 /* SpreadElement */; + var hasRestElement = elementCount > 0 && elements[elementCount - 1].kind === 209 /* SpreadElement */; var minLength = elementCount - (hasRestElement ? 1 : 0); // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such // that we get the same behavior for "var [x, y] = []" and "[x, y] = []". @@ -48254,15 +49107,15 @@ var ts; var pattern = contextualType && contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (!hasRestElement && pattern && (pattern.kind === 185 /* ArrayBindingPattern */ || pattern.kind === 187 /* ArrayLiteralExpression */)) { + if (!hasRestElement && pattern && (pattern.kind === 186 /* ArrayBindingPattern */ || pattern.kind === 188 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementCount; i < patternElements.length; i++) { var e = patternElements[i]; if (hasDefaultValue(e)) { elementTypes.push(contextualType.typeArguments[i]); } - else if (i < patternElements.length - 1 || !(e.kind === 186 /* BindingElement */ && e.dotDotDotToken || e.kind === 208 /* SpreadElement */)) { - if (e.kind !== 210 /* OmittedExpression */) { + else if (i < patternElements.length - 1 || !(e.kind === 187 /* BindingElement */ && e.dotDotDotToken || e.kind === 209 /* SpreadElement */)) { + if (e.kind !== 211 /* OmittedExpression */) { error(e, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); @@ -48274,9 +49127,9 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return isNumericComputedName(name); - case 72 /* Identifier */: + case 73 /* Identifier */: return isNumericLiteralName(name.escapedText); case 8 /* NumericLiteral */: case 10 /* StringLiteral */: @@ -48364,7 +49217,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 184 /* ObjectBindingPattern */ || contextualType.pattern.kind === 188 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 185 /* ObjectBindingPattern */ || contextualType.pattern.kind === 189 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -48379,13 +49232,13 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 149 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 150 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 275 /* PropertyAssignment */ || - memberDecl.kind === 276 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 276 /* PropertyAssignment */ || + memberDecl.kind === 277 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 275 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 276 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : + var type = memberDecl.kind === 276 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 277 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -48400,7 +49253,7 @@ var ts; objectFlags |= ts.getObjectFlags(type) & 917504 /* PropagatingFlags */; var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined; var prop = nameType ? - createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 2048 /* Late */) : + createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags); if (nameType) { prop.nameType = nameType; @@ -48408,8 +49261,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 === 275 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 276 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 276 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 277 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -48434,7 +49287,7 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 277 /* SpreadAssignment */) { + else if (memberDecl.kind === 278 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -48460,7 +49313,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 === 158 /* GetAccessor */ || memberDecl.kind === 159 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 159 /* GetAccessor */ || memberDecl.kind === 160 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -48568,7 +49421,7 @@ var ts; * Returns true iff React would emit this tag name as a string rather than an identifier or qualified name */ function isJsxIntrinsicIdentifier(tagName) { - return tagName.kind === 72 /* Identifier */ && ts.isIntrinsicJsxName(tagName.escapedText); + return tagName.kind === 73 /* Identifier */ && ts.isIntrinsicJsxName(tagName.escapedText); } function checkJsxAttribute(node, checkMode) { return node.initializer @@ -48613,7 +49466,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 269 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 270 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -48636,7 +49489,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 260 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 261 /* 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); @@ -49054,8 +49907,8 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 148 /* QualifiedName */ ? node.right : node.kind === 183 /* ImportType */ ? node : node.name; - if (ts.getCheckFlags(prop) & 512 /* ContainsPrivate */) { + var errorNode = node.kind === 149 /* QualifiedName */ ? node.right : node.kind === 184 /* ImportType */ ? node : node.name; + if (ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */) { // Synthetic property with private constituent property error(errorNode, ts.Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(prop), typeToString(type)); return false; @@ -49160,7 +50013,7 @@ var ts; return type; } function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { - if (type.flags & 2 /* Unknown */) { + if (strictNullChecks && type.flags & 2 /* Unknown */) { error(node, ts.Diagnostics.Object_is_of_type_unknown); return errorType; } @@ -49175,6 +50028,13 @@ var ts; } return type; } + function checkNonNullNonVoidType(type, node) { + var nonNullType = checkNonNullType(type, node); + if (nonNullType !== errorType && nonNullType.flags & 16384 /* Void */) { + error(node, ts.Diagnostics.Object_is_possibly_undefined); + } + return nonNullType; + } function checkPropertyAccessExpression(node) { return checkPropertyAccessExpressionOrQualifiedName(node, node.expression, node.name); } @@ -49198,7 +50058,7 @@ var ts; markAliasReferenced(parentSymbol, node); } if (!prop) { - var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); + var indexInfo = assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) ? getIndexInfoOfType(apparentType, 0 /* String */) : undefined; if (!(indexInfo && indexInfo.type)) { if (isJSLiteralType(leftType)) { return anyType; @@ -49213,7 +50073,7 @@ var ts; return anyType; } if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { - reportNonexistentProperty(right, leftType.flags & 262144 /* TypeParameter */ && leftType.isThisType ? apparentType : leftType); + reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType); } return errorType; } @@ -49224,9 +50084,9 @@ var ts; } else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); - markPropertyAsReferenced(prop, node, left.kind === 100 /* ThisKeyword */); + markPropertyAsReferenced(prop, node, left.kind === 101 /* ThisKeyword */); getNodeLinks(node).resolvedSymbol = prop; - checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); + checkPropertyAccessibility(node, left.kind === 99 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); @@ -49238,7 +50098,7 @@ var ts; // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 189 /* PropertyAccessExpression */ || + if (node.kind !== 190 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 1048576 /* Union */)) { return propType; @@ -49248,11 +50108,11 @@ var ts; // and if we are in a constructor of the same class as the property declaration, assume that // the property is uninitialized at the top of the control flow. var assumeUninitialized = false; - if (strictNullChecks && strictPropertyInitialization && left.kind === 100 /* ThisKeyword */) { + if (strictNullChecks && strictPropertyInitialization && left.kind === 101 /* ThisKeyword */) { var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 157 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 158 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -49283,8 +50143,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 240 /* ClassDeclaration */ && - node.parent.kind !== 164 /* TypeReference */ && + else if (valueDeclaration.kind === 241 /* ClassDeclaration */ && + node.parent.kind !== 165 /* TypeReference */ && !(valueDeclaration.flags & 4194304 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -49296,22 +50156,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return true; - case 275 /* PropertyAssignment */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 277 /* SpreadAssignment */: - case 149 /* ComputedPropertyName */: - case 216 /* TemplateSpan */: - case 270 /* JsxExpression */: - case 267 /* JsxAttribute */: - case 268 /* JsxAttributes */: - case 269 /* JsxSpreadAttribute */: - case 262 /* JsxOpeningElement */: - case 211 /* ExpressionWithTypeArguments */: - case 273 /* HeritageClause */: + case 276 /* PropertyAssignment */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 278 /* SpreadAssignment */: + case 150 /* ComputedPropertyName */: + case 217 /* TemplateSpan */: + case 271 /* JsxExpression */: + case 268 /* JsxAttribute */: + case 269 /* JsxAttributes */: + case 270 /* JsxSpreadAttribute */: + case 263 /* JsxOpeningElement */: + case 212 /* ExpressionWithTypeArguments */: + case 274 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -49417,6 +50277,32 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetModule); return suggestion && ts.symbolName(suggestion); } + function getSuggestionForNonexistentIndexSignature(objectType, expr) { + // check if object type has setter or getter + var hasProp = function (name, argCount) { + if (argCount === void 0) { argCount = 1; } + var prop = getPropertyOfObjectType(objectType, name); + if (prop) { + var s = getSingleCallSignature(getTypeOfSymbol(prop)); + if (s && getMinArgumentCount(s) === argCount && typeToString(getTypeAtPosition(s, 0)) === "string") { + return true; + } + } + return false; + }; + var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get"; + if (!hasProp(suggestedMethod)) { + return undefined; + } + var suggestion = ts.tryGetPropertyAccessOrIdentifierToString(expr); + if (suggestion === undefined) { + suggestion = suggestedMethod; + } + else { + suggestion += "." + suggestedMethod; + } + return suggestion; + } /** * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough. * Names less than length 3 only check for case-insensitive equality, not levenshtein distance. @@ -49457,34 +50343,17 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 189 /* PropertyAccessExpression */: - return isValidPropertyAccessWithType(node, node.expression.kind === 98 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 148 /* QualifiedName */: + case 190 /* PropertyAccessExpression */: + return isValidPropertyAccessWithType(node, node.expression.kind === 99 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); + case 149 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 183 /* ImportType */: + case 184 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 189 /* PropertyAccessExpression */ && node.expression.kind === 98 /* SuperKeyword */, property.escapedName, type) - && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); - } - function isValidMethodAccess(method, actualThisType) { - var propType = getTypeOfPropertyOfType(actualThisType, method.escapedName); - var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); - ts.Debug.assert(signatures.length !== 0); - return signatures.some(function (sig) { - var signatureThisType = getThisTypeOfSignature(sig); - return !signatureThisType || isTypeAssignableTo(actualThisType, getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType)); - }); - } - function getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType) { - if (!sig.typeParameters) { - return signatureThisType; - } - var context = createInferenceContext(sig.typeParameters, sig, 0 /* None */); - inferTypes(context.inferences, actualThisType, signatureThisType); - return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context))); + return isValidPropertyAccessWithType(node, node.kind === 190 /* PropertyAccessExpression */ && node.expression.kind === 99 /* 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) { if (type === errorType || isTypeAny(type)) { @@ -49500,13 +50369,13 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 238 /* VariableDeclarationList */) { + if (initializer.kind === 239 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); } } - else if (initializer.kind === 72 /* Identifier */) { + else if (initializer.kind === 73 /* Identifier */) { return getResolvedSymbol(initializer); } return undefined; @@ -49523,13 +50392,13 @@ var ts; */ function isForInVariableForNumericPropertyNames(expr) { var e = ts.skipParentheses(expr); - if (e.kind === 72 /* Identifier */) { + if (e.kind === 73 /* Identifier */) { var symbol = getResolvedSymbol(e); if (symbol.flags & 3 /* Variable */) { var child = expr; var node = expr.parent; while (node) { - if (node.kind === 226 /* ForInStatement */ && + if (node.kind === 227 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -49547,7 +50416,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 192 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 193 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -49567,7 +50436,12 @@ var ts; error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return errorType; } - return checkIndexedAccessIndexType(getIndexedAccessType(objectType, isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType, node), node); + var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType; + var accessFlags = ts.isAssignmentTarget(node) ? + 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : + 0 /* None */; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; + return checkIndexedAccessIndexType(indexedAccessType, node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === errorType) { @@ -49613,13 +50487,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 193 /* TaggedTemplateExpression */) { + if (node.kind === 194 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 152 /* Decorator */) { + else if (node.kind !== 153 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -49683,7 +50557,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 208 /* SpreadElement */ || arg.kind === 215 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 209 /* SpreadElement */ || arg.kind === 216 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -49697,9 +50571,9 @@ var ts; 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 === 193 /* TaggedTemplateExpression */) { + if (node.kind === 194 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 206 /* TemplateExpression */) { + if (node.template.kind === 207 /* 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. @@ -49714,7 +50588,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 152 /* Decorator */) { + else if (node.kind === 153 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -49729,7 +50603,7 @@ var ts; else { if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 192 /* NewExpression */); + ts.Debug.assert(node.kind === 193 /* NewExpression */); return getMinArgumentCount(signature) === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; @@ -49768,11 +50642,22 @@ var ts; } // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. function getSingleCallSignature(type) { + return getSingleSignature(type, 0 /* Call */, /*allowMembers*/ false); + } + function getSingleCallOrConstructSignature(type) { + return getSingleSignature(type, 0 /* Call */, /*allowMembers*/ false) || + getSingleSignature(type, 1 /* Construct */, /*allowMembers*/ false); + } + function getSingleSignature(type, kind, allowMembers) { if (type.flags & 524288 /* Object */) { var resolved = resolveStructuredTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - return resolved.callSignatures[0]; + if (allowMembers || resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { + if (kind === 0 /* Call */ && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) { + return resolved.callSignatures[0]; + } + if (kind === 1 /* Construct */ && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) { + return resolved.constructSignatures[0]; + } } } return undefined; @@ -49792,7 +50677,7 @@ var ts; }); if (!inferenceContext) { applyToReturnTypes(contextualSignature, signature, function (source, target) { - inferTypes(context.inferences, source, target, 8 /* ReturnType */); + inferTypes(context.inferences, source, target, 16 /* ReturnType */); }); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJSFile(contextualSignature.declaration)); @@ -49811,7 +50696,7 @@ var ts; // example, given a 'function wrap<T, U>(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 !== 152 /* Decorator */) { + if (node.kind !== 153 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -49832,7 +50717,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 16 /* ReturnType */); // Create a type mapper for instantiating generic contextual types using the inferences made // from the return type. context.returnMapper = getMapperFromContext(cloneInferredPartOfContext(context)); @@ -49848,7 +50733,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 !== 210 /* OmittedExpression */) { + if (arg.kind !== 211 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -49862,7 +50747,7 @@ var ts; } function getArrayifiedType(type) { if (forEachType(type, function (t) { return !(t.flags & (1 /* Any */ | 63176704 /* Instantiable */) || isArrayType(t) || isTupleType(t)); })) { - return createArrayType(getIndexTypeOfType(type, 1 /* Number */) || errorType); + return createArrayType(getIndexedAccessType(type, numberType)); } return type; } @@ -49872,20 +50757,20 @@ 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 arg.kind === 215 /* SyntheticExpression */ ? + return arg.kind === 216 /* SyntheticExpression */ ? createArrayType(arg.type) : getArrayifiedType(checkExpressionWithContextualType(arg.expression, restType, context, 0 /* Normal */)); } } - var contextualType = getIndexTypeOfType(restType, 1 /* Number */) || anyType; - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); var types = []; var spreadIndex = -1; for (var i = index; i < argCount; i++) { + var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(args[i], contextualType, context, 0 /* Normal */); if (spreadIndex < 0 && isSpreadArgument(args[i])) { spreadIndex = i - index; } + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); } return spreadIndex < 0 ? @@ -49946,7 +50831,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 192 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 193 /* 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. @@ -49963,7 +50848,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 !== 210 /* OmittedExpression */) { + if (arg.kind !== 211 /* 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), @@ -49986,15 +50871,15 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 191 /* CallExpression */) { + if (node.kind === 192 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); - if (callee.kind === 189 /* PropertyAccessExpression */ || callee.kind === 190 /* ElementAccessExpression */) { + if (callee.kind === 190 /* PropertyAccessExpression */ || callee.kind === 191 /* ElementAccessExpression */) { return callee.expression; } } } function createSyntheticExpression(parent, type, isSpread) { - var result = ts.createNode(215 /* SyntheticExpression */, parent.pos, parent.end); + var result = ts.createNode(216 /* SyntheticExpression */, parent.pos, parent.end); result.parent = parent; result.type = type; result.isSpread = isSpread || false; @@ -50004,17 +50889,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 193 /* TaggedTemplateExpression */) { + if (node.kind === 194 /* TaggedTemplateExpression */) { var template = node.template; - var args_4 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 206 /* TemplateExpression */) { + var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; + if (template.kind === 207 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { - args_4.push(span.expression); + args_3.push(span.expression); }); } - return args_4; + return args_3; } - if (node.kind === 152 /* Decorator */) { + if (node.kind === 153 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -50027,7 +50912,7 @@ var ts; // of the argument is a tuple type, spread the tuple elements into the argument list. We can // call checkExpressionCached because spread expressions never have a contextual type. var spreadArgument_1 = args[length - 1]; - var type = checkExpressionCached(spreadArgument_1.expression); + var type = flowLoopCount ? checkExpression(spreadArgument_1.expression) : checkExpressionCached(spreadArgument_1.expression); if (isTupleType(type)) { var typeArguments = type.typeArguments || ts.emptyArray; var restIndex_2 = type.target.hasRestElement ? typeArguments.length - 1 : -1; @@ -50044,30 +50929,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* 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 151 /* Parameter */: + case 152 /* 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 === 157 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 158 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* 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 !== 154 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 155 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -50081,17 +50966,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: return 1; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return 2; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* 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 151 /* Parameter */: + case 152 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -50148,7 +51033,7 @@ var ts; spanArray = ts.createNodeArray(args); if (hasSpreadArgument && argCount) { var nextArg = ts.elementAt(args, getSpreadArgumentIndex(args) + 1) || undefined; - spanArray = ts.createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : max)); + spanArray = ts.createNodeArray(args.slice(max > argCount && nextArg ? args.indexOf(nextArg) : Math.min(max, args.length - 1))); } } else { @@ -50191,15 +51076,15 @@ 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, fallbackError) { - var isTaggedTemplate = node.kind === 193 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 152 /* Decorator */; + var isTaggedTemplate = node.kind === 194 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 153 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray; var typeArguments; if (!isDecorator) { typeArguments = node.typeArguments; // We already perform checking on the type arguments on the class declaration itself. - if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 98 /* SuperKeyword */) { + if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 99 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } @@ -50254,7 +51139,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 === 191 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 192 /* 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 @@ -50405,7 +51290,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_8 = function (i) { + var _loop_11 = function (i) { var symbols = ts.mapDefined(candidates, function (_a) { var parameters = _a.parameters, hasRestParameter = _a.hasRestParameter; return hasRestParameter ? @@ -50416,7 +51301,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_8(i); + _loop_11(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return c.hasRestParameter ? ts.last(c.parameters) : undefined; }); var hasRestParameter = restParameterSymbols.length !== 0; @@ -50494,7 +51379,7 @@ var ts; return maxParamsIndex; } function resolveCallExpression(node, candidatesOutArray, checkMode) { - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { var superType = checkSuperExpression(node.expression); if (isTypeAny(superType)) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { @@ -50569,7 +51454,7 @@ var ts; // returns a function type, we choose to defer processing. This narrowly permits function composition // operators to flow inferences through return types, but otherwise processes calls right away. We // use the resolvingSignature singleton to indicate that we deferred processing. This result will be - // propagated out and eventually turned into silentNeverType (a type that is assignable to anything and + // propagated out and eventually turned into nonInferrableType (a type that is assignable to anything and // from which we never make inferences). if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { skippedGenericFunction(node, checkMode); @@ -50771,16 +51656,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 151 /* Parameter */: + case 152 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -50823,7 +51708,7 @@ var ts; // file would probably be preferable. var typeSymbol = exports && getSymbol(exports, JsxNames.Element, 67897832 /* Type */); var returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 67897832 /* Type */, node); - var declaration = ts.createFunctionTypeNode(/*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotdotdot*/ undefined, "props", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : ts.createKeywordTypeNode(120 /* AnyKeyword */)); + var declaration = ts.createFunctionTypeNode(/*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotdotdot*/ undefined, "props", /*questionMark*/ undefined, nodeBuilder.typeToTypeNode(result, node))], returnNode ? ts.createTypeReferenceNode(returnNode, /*typeArguments*/ undefined) : ts.createKeywordTypeNode(121 /* AnyKeyword */)); var parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props"); parameterSymbol.type = result; return createSignature(declaration, @@ -50870,16 +51755,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 191 /* CallExpression */: + case 192 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 152 /* Decorator */: + case 153 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 262 /* JsxOpeningElement */: - case 261 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -50966,10 +51851,10 @@ var ts; return false; } var parent = node.parent; - while (parent && parent.kind === 189 /* PropertyAccessExpression */) { + while (parent && parent.kind === 190 /* PropertyAccessExpression */) { parent = parent.parent; } - if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 59 /* EqualsToken */) { + if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 60 /* EqualsToken */) { var right = ts.getInitializerOfBinaryExpression(parent); return ts.isObjectLiteralExpression(right) && right; } @@ -50992,18 +51877,18 @@ var ts; var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode); if (signature === resolvingSignature) { // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that - // returns a function type. We defer checking and return anyFunctionType. - return silentNeverType; + // returns a function type. We defer checking and return nonInferrableType. + return nonInferrableType; } - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { return voidType; } - if (node.kind === 192 /* NewExpression */) { + if (node.kind === 193 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 157 /* Constructor */ && - declaration.kind !== 161 /* ConstructSignature */ && - declaration.kind !== 166 /* ConstructorType */ && + declaration.kind !== 158 /* Constructor */ && + declaration.kind !== 162 /* ConstructSignature */ && + declaration.kind !== 167 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -51120,9 +52005,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 239 /* FunctionDeclaration */ + ? 240 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 237 /* VariableDeclaration */ + ? 238 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -51147,18 +52032,25 @@ var ts; case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 187 /* ArrayLiteralExpression */: - case 188 /* ObjectLiteralExpression */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 188 /* ArrayLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return true; - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 39 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 38 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: + var expr = node.expression; + if (ts.isIdentifier(expr)) { + var symbol = getSymbolAtLocation(expr); + return !!(symbol && (symbol.flags & 384 /* Enum */) && getEnumKind(symbol) === 1 /* Literal */); + } } return false; } @@ -51166,7 +52058,7 @@ var ts; var exprType = checkExpression(expression, checkMode); if (ts.isConstTypeReference(type)) { if (!isValidConstAssertionArgument(expression)) { - error(expression, ts.Diagnostics.A_const_assertion_can_only_be_applied_to_a_string_number_boolean_array_or_object_literal); + error(expression, ts.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals); } return getRegularTypeOfLiteralType(exprType); } @@ -51186,10 +52078,10 @@ var ts; } function checkMetaProperty(node) { checkGrammarMetaProperty(node); - if (node.keywordToken === 95 /* NewKeyword */) { + if (node.keywordToken === 96 /* NewKeyword */) { return checkNewTargetMetaProperty(node); } - if (node.keywordToken === 92 /* ImportKeyword */) { + if (node.keywordToken === 93 /* ImportKeyword */) { return checkImportMetaProperty(node); } return ts.Debug.assertNever(node.keywordToken); @@ -51200,7 +52092,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 === 157 /* Constructor */) { + else if (container.kind === 158 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -51210,7 +52102,7 @@ var ts; } } function checkImportMetaProperty(node) { - if (languageVersion < 7 /* ESNext */ || moduleKind < ts.ModuleKind.ESNext) { + if (languageVersion < 8 /* ESNext */ || moduleKind < ts.ModuleKind.ESNext) { error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options); } var file = ts.getSourceFileOfNode(node); @@ -51386,7 +52278,7 @@ var ts; for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { var element = _a[_i]; if (!ts.isOmittedExpression(element)) { - if (element.name.kind === 72 /* Identifier */) { + if (element.name.kind === 73 /* Identifier */) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } else { @@ -51400,9 +52292,9 @@ var ts; if (!links.type) { links.type = contextualType; var decl = parameter.valueDeclaration; - if (decl.name.kind !== 72 /* Identifier */) { + if (decl.name.kind !== 73 /* Identifier */) { // if inference didn't come up with anything but {}, fall back to the binding pattern if present. - if (links.type === emptyObjectType) { + if (links.type === unknownType) { links.type = getTypeFromBindingPattern(decl.name); } assignBindingElementTypes(decl.name); @@ -51414,24 +52306,24 @@ var ts; var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true); if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || emptyObjectType; + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseType, [promisedType]); } - return emptyObjectType; + return unknownType; } function createPromiseLikeType(promisedType) { // creates a `PromiseLike<T>` type where `T` is the promisedType argument var globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); if (globalPromiseLikeType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type - promisedType = getAwaitedType(promisedType) || emptyObjectType; + promisedType = getAwaitedType(promisedType) || unknownType; return createTypeReference(globalPromiseLikeType, [promisedType]); } - return emptyObjectType; + return unknownType; } function createPromiseReturnType(func, promisedType) { var promiseType = createPromiseType(promisedType); - if (promiseType === emptyObjectType) { + if (promiseType === unknownType) { error(func, ts.isImportCall(func) ? ts.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); @@ -51450,7 +52342,7 @@ var ts; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 218 /* Block */) { + if (func.body.kind !== 219 /* Block */) { type = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -51592,7 +52484,7 @@ var ts; if (!node.possiblyExhaustive) { return false; } - if (node.expression.kind === 199 /* TypeOfExpression */) { + if (node.expression.kind === 200 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); // This cast is safe because the switch is possibly exhaustive and does not contain a default case, so there can be no undefined. var witnesses = getSwitchClauseTypeOfWitnesses(node); @@ -51615,7 +52507,7 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 232 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 233 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; @@ -51658,11 +52550,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return true; - case 156 /* MethodDeclaration */: - return func.parent.kind === 188 /* ObjectLiteralExpression */; + case 157 /* MethodDeclaration */: + return func.parent.kind === 189 /* ObjectLiteralExpression */; default: return false; } @@ -51686,7 +52578,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 === 155 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 218 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 156 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 219 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -51719,7 +52611,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 156 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 157 /* 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)) { @@ -51732,14 +52624,14 @@ var ts; var returnType = getReturnTypeFromBody(node, checkMode); var returnOnlySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, returnType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts.emptyArray, undefined, undefined); - returnOnlyType.objectFlags |= 524288 /* ContainsAnyFunctionType */; + returnOnlyType.objectFlags |= 524288 /* NonInferrableType */; return links_1.contextFreeType = returnOnlyType; } return anyFunctionType; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 196 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 197 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -51784,7 +52676,7 @@ var ts; getAwaitedType(type) || errorType : type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 156 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 157 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnOrPromisedType = getReturnOrPromisedType(node, functionFlags); if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function @@ -51800,7 +52692,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 218 /* Block */) { + if (node.body.kind === 219 /* Block */) { checkSourceElement(node.body); } else { @@ -51878,11 +52770,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 189 /* PropertyAccessExpression */ || expr.kind === 190 /* ElementAccessExpression */) && - expr.expression.kind === 100 /* ThisKeyword */) { + (expr.kind === 190 /* PropertyAccessExpression */ || expr.kind === 191 /* ElementAccessExpression */) && + expr.expression.kind === 101 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 157 /* Constructor */)) { + if (!(func && func.kind === 158 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -51895,13 +52787,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 189 /* PropertyAccessExpression */ || expr.kind === 190 /* ElementAccessExpression */) { + if (expr.kind === 190 /* PropertyAccessExpression */ || expr.kind === 191 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return !!declaration && declaration.kind === 251 /* NamespaceImport */; + return !!declaration && declaration.kind === 252 /* NamespaceImport */; } } } @@ -51910,7 +52802,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 72 /* Identifier */ && node.kind !== 189 /* PropertyAccessExpression */ && node.kind !== 190 /* ElementAccessExpression */) { + if (node.kind !== 73 /* Identifier */ && node.kind !== 190 /* PropertyAccessExpression */ && node.kind !== 191 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -51919,7 +52811,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 189 /* PropertyAccessExpression */ && expr.kind !== 190 /* ElementAccessExpression */) { + if (expr.kind !== 190 /* PropertyAccessExpression */ && expr.kind !== 191 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -51942,7 +52834,19 @@ var ts; // Grammar checking if (produceDiagnostics) { if (!(node.flags & 16384 /* AwaitContext */)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); + // use of 'await' in non-async function + var sourceFile = ts.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); + var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function); + var func = ts.getContainingFunction(node); + if (func && func.kind !== 158 /* 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); + } + diagnostics.add(diagnostic); + } } if (isInParameterInitializerBeforeContainingFunction(node)) { error(node, ts.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); @@ -52034,8 +52938,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - 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]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -52114,16 +53018,17 @@ var ts; if (strictNullChecks && properties.length === 0) { return checkNonNullType(sourceType, node); } - for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { - var p = properties_6[_i]; - checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties, rightIsThis); + for (var i = 0; i < properties.length; i++) { + checkObjectLiteralDestructuringPropertyAssignment(node, sourceType, i, properties, rightIsThis); } return sourceType; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ - function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties, rightIsThis) { + function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis) { if (rightIsThis === void 0) { rightIsThis = false; } - if (property.kind === 275 /* PropertyAssignment */ || property.kind === 276 /* ShorthandPropertyAssignment */) { + var properties = node.properties; + var property = properties[propertyIndex]; + if (property.kind === 276 /* PropertyAssignment */ || property.kind === 277 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -52136,21 +53041,29 @@ var ts; } var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 276 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 277 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 277 /* SpreadAssignment */) { - if (languageVersion < 7 /* ESNext */) { - checkExternalEmitHelpers(property, 4 /* Rest */); + else if (property.kind === 278 /* SpreadAssignment */) { + if (propertyIndex < properties.length - 1) { + error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - var nonRestNames = []; - if (allProperties) { - for (var i = 0; i < allProperties.length - 1; i++) { - nonRestNames.push(allProperties[i].name); + else { + if (languageVersion < 8 /* ESNext */) { + checkExternalEmitHelpers(property, 4 /* Rest */); + } + var nonRestNames = []; + if (allProperties) { + for (var _i = 0, allProperties_1 = allProperties; _i < allProperties_1.length; _i++) { + var otherProperty = allProperties_1[_i]; + if (!ts.isSpreadAssignment(otherProperty)) { + nonRestNames.push(otherProperty.name); + } + } } + var type = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol); + checkGrammarForDisallowedTrailingComma(allProperties, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + return checkDestructuringAssignment(property.expression, type); } - var type = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol); - checkGrammarForDisallowedTrailingComma(allProperties, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - return checkDestructuringAssignment(property.expression, type); } else { error(property, ts.Diagnostics.Property_assignment_expected); @@ -52173,8 +53086,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 210 /* OmittedExpression */) { - if (element.kind !== 208 /* SpreadElement */) { + if (element.kind !== 211 /* OmittedExpression */) { + if (element.kind !== 209 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused @@ -52190,7 +53103,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 204 /* BinaryExpression */ && restExpression.operatorToken.kind === 59 /* EqualsToken */) { + if (restExpression.kind === 205 /* BinaryExpression */ && restExpression.operatorToken.kind === 60 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -52206,7 +53119,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 276 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 277 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -52222,21 +53135,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 204 /* BinaryExpression */ && target.operatorToken.kind === 59 /* EqualsToken */) { + if (target.kind === 205 /* BinaryExpression */ && target.operatorToken.kind === 60 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 188 /* ObjectLiteralExpression */) { + if (target.kind === 189 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 187 /* ArrayLiteralExpression */) { + if (target.kind === 188 /* 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 === 277 /* SpreadAssignment */ ? + var error = target.parent.kind === 278 /* 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; if (checkReferenceExpression(target, error)) { @@ -52255,39 +53168,39 @@ var ts; function isSideEffectFree(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 193 /* TaggedTemplateExpression */: - case 206 /* TemplateExpression */: + case 194 /* TaggedTemplateExpression */: + case 207 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 96 /* NullKeyword */: - case 141 /* UndefinedKeyword */: - case 196 /* FunctionExpression */: - case 209 /* ClassExpression */: - case 197 /* ArrowFunction */: - case 187 /* ArrayLiteralExpression */: - case 188 /* ObjectLiteralExpression */: - case 199 /* TypeOfExpression */: - case 213 /* NonNullExpression */: - case 261 /* JsxSelfClosingElement */: - case 260 /* JsxElement */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 97 /* NullKeyword */: + case 142 /* UndefinedKeyword */: + case 197 /* FunctionExpression */: + case 210 /* ClassExpression */: + case 198 /* ArrowFunction */: + case 188 /* ArrayLiteralExpression */: + case 189 /* ObjectLiteralExpression */: + case 200 /* TypeOfExpression */: + case 214 /* NonNullExpression */: + case 262 /* JsxSelfClosingElement */: + case 261 /* JsxElement */: return true; - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -52299,9 +53212,9 @@ var ts; } return false; // Some forms listed here for clarity - case 200 /* VoidExpression */: // Explicit opt-out - case 194 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 212 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 201 /* VoidExpression */: // Explicit opt-out + case 195 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 213 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -52317,8 +53230,8 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 59 /* EqualsToken */ && (left.kind === 188 /* ObjectLiteralExpression */ || left.kind === 187 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 100 /* ThisKeyword */); + if (operator === 60 /* EqualsToken */ && (left.kind === 189 /* ObjectLiteralExpression */ || left.kind === 188 /* ArrayLiteralExpression */)) { + return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 101 /* ThisKeyword */); } var leftType; if (operator === 54 /* AmpersandAmpersandToken */ || operator === 55 /* BarBarToken */) { @@ -52331,26 +53244,26 @@ var ts; switch (operator) { case 40 /* AsteriskToken */: case 41 /* AsteriskAsteriskToken */: - case 62 /* AsteriskEqualsToken */: - case 63 /* AsteriskAsteriskEqualsToken */: + case 63 /* AsteriskEqualsToken */: + case 64 /* AsteriskAsteriskEqualsToken */: case 42 /* SlashToken */: - case 64 /* SlashEqualsToken */: + case 65 /* SlashEqualsToken */: case 43 /* PercentToken */: - case 65 /* PercentEqualsToken */: + case 66 /* PercentEqualsToken */: case 39 /* MinusToken */: - case 61 /* MinusEqualsToken */: + case 62 /* MinusEqualsToken */: case 46 /* LessThanLessThanToken */: - case 66 /* LessThanLessThanEqualsToken */: + case 67 /* LessThanLessThanEqualsToken */: case 47 /* GreaterThanGreaterThanToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: case 48 /* GreaterThanGreaterThanGreaterThanToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: case 50 /* BarToken */: - case 70 /* BarEqualsToken */: + case 71 /* BarEqualsToken */: case 51 /* CaretToken */: - case 71 /* CaretEqualsToken */: + case 72 /* CaretEqualsToken */: case 49 /* AmpersandToken */: - case 69 /* AmpersandEqualsToken */: + case 70 /* AmpersandEqualsToken */: if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } @@ -52380,7 +53293,7 @@ var ts; else if (isTypeAssignableToKind(leftType, 2112 /* BigIntLike */) && isTypeAssignableToKind(rightType, 2112 /* BigIntLike */)) { switch (operator) { case 48 /* GreaterThanGreaterThanGreaterThanToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: reportOperatorError(); } resultType_1 = bigintType; @@ -52395,7 +53308,7 @@ var ts; return resultType_1; } case 38 /* PlusToken */: - case 60 /* PlusEqualsToken */: + case 61 /* PlusEqualsToken */: if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } @@ -52430,7 +53343,7 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 60 /* PlusEqualsToken */) { + if (operator === 61 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; @@ -52451,19 +53364,13 @@ var ts; case 34 /* ExclamationEqualsToken */: case 35 /* EqualsEqualsEqualsToken */: case 36 /* ExclamationEqualsEqualsToken */: - var leftIsLiteral = isLiteralType(leftType); - var rightIsLiteral = isLiteralType(rightType); - if (!leftIsLiteral || !rightIsLiteral) { - leftType = leftIsLiteral ? getBaseTypeOfLiteralType(leftType) : leftType; - rightType = rightIsLiteral ? getBaseTypeOfLiteralType(rightType) : rightType; - } if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 94 /* InstanceOfKeyword */: + case 95 /* InstanceOfKeyword */: return checkInstanceOfExpression(left, right, leftType, rightType); - case 93 /* InKeyword */: + case 94 /* InKeyword */: return checkInExpression(left, right, leftType, rightType); case 54 /* AmpersandAmpersandToken */: return getTypeFacts(leftType) & 4194304 /* Truthy */ ? @@ -52473,7 +53380,7 @@ var ts; return getTypeFacts(leftType) & 8388608 /* Falsy */ ? getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) : leftType; - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { @@ -52517,7 +53424,7 @@ var ts; } } function isEvalNode(node) { - return node.kind === 72 /* Identifier */ && node.escapedText === "eval"; + return node.kind === 73 /* Identifier */ && node.escapedText === "eval"; } // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { @@ -52533,13 +53440,13 @@ var ts; function getSuggestedBooleanOperator(operator) { switch (operator) { case 50 /* BarToken */: - case 70 /* BarEqualsToken */: + case 71 /* BarEqualsToken */: return 55 /* BarBarToken */; case 51 /* CaretToken */: - case 71 /* CaretEqualsToken */: + case 72 /* CaretEqualsToken */: return 36 /* ExclamationEqualsEqualsToken */; case 49 /* AmpersandToken */: - case 69 /* AmpersandEqualsToken */: + case 70 /* AmpersandEqualsToken */: return 54 /* AmpersandAmpersandToken */; default: return undefined; @@ -52578,8 +53485,7 @@ var ts; } } function reportOperatorError() { - var leftStr = typeToString(leftType); - var rightStr = typeToString(rightType); + var _a = getTypeNamesForErrorDisplay(leftType, rightType), leftStr = _a[0], rightStr = _a[1]; var errNode = errorNode || operatorToken; if (!tryGiveBetterPrimaryError(errNode, leftStr, rightStr)) { error(errNode, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(operatorToken.kind), leftStr, rightStr); @@ -52634,7 +53540,7 @@ var ts; // Async generator functions prior to ESNext require the __await, __asyncDelegator, // and __asyncValues helpers if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && - languageVersion < 7 /* ESNext */) { + languageVersion < 8 /* ESNext */) { checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); } // Generator functions prior to ES2015 require the __values helper @@ -52676,7 +53582,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 268 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 269 /* 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; @@ -52715,7 +53621,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 194 /* TypeAssertionExpression */ || node.kind === 212 /* AsExpression */; + return node.kind === 195 /* TypeAssertionExpression */ || node.kind === 213 /* AsExpression */; } function checkDeclarationInitializer(declaration) { var initializer = ts.getEffectiveInitializer(declaration); @@ -52746,7 +53652,7 @@ var ts; // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. - var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; + var constraint = getBaseConstraintOfType(contextualType) || unknownType; return maybeTypeOfKind(constraint, 4 /* String */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || maybeTypeOfKind(constraint, 8 /* Number */) && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || maybeTypeOfKind(constraint, 64 /* BigInt */) && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || @@ -52779,7 +53685,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 === 149 /* ComputedPropertyName */) { + if (node.name.kind === 150 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -52790,7 +53696,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 === 149 /* ComputedPropertyName */) { + if (node.name.kind === 150 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -52798,16 +53704,18 @@ var ts; } function instantiateTypeWithSingleGenericCallSignature(node, type, checkMode) { if (checkMode && checkMode & (2 /* Inferential */ | 8 /* SkipGenericFunctions */)) { - var signature = getSingleCallSignature(type); + var callSignature = getSingleSignature(type, 0 /* Call */, /*allowMembers*/ true); + var constructSignature = getSingleSignature(type, 1 /* Construct */, /*allowMembers*/ true); + var signature = callSignature || constructSignature; if (signature && signature.typeParameters) { - if (checkMode & 8 /* SkipGenericFunctions */) { - skippedGenericFunction(node, checkMode); - return anyFunctionType; - } var contextualType = getApparentTypeOfContextualType(node); - if (contextualType) { - var contextualSignature = getSingleCallSignature(getNonNullableType(contextualType)); + if (contextualType && !isMixinConstructorType(contextualType)) { + var contextualSignature = getSingleSignature(getNonNullableType(contextualType), callSignature ? 0 /* Call */ : 1 /* Construct */, /*allowMembers*/ false); if (contextualSignature && !contextualSignature.typeParameters) { + if (checkMode & 8 /* SkipGenericFunctions */) { + skippedGenericFunction(node, checkMode); + return anyFunctionType; + } var context = getInferenceContext(node); // We have an expression that is an argument of a generic function for which we are performing // type argument inference. The expression is of a function type with a single generic call @@ -52815,7 +53723,8 @@ var ts; // if the outer function returns a function type with a single non-generic call signature and // if some of the outer function type parameters have no inferences so far. If so, we can // potentially add inferred type parameters to the outer function return type. - var returnSignature = context.signature && getSingleCallSignature(getReturnTypeOfSignature(context.signature)); + var returnType = context.signature && getReturnTypeOfSignature(context.signature); + var returnSignature = returnType && getSingleCallOrConstructSignature(returnType); if (returnSignature && !returnSignature.typeParameters && !ts.every(context.inferences, hasInferenceCandidates)) { // Instantiate the signature with its own type parameters as type arguments, possibly // renaming the type parameters to ensure they have unique names. @@ -52930,7 +53839,7 @@ var ts; var expr = ts.skipParentheses(node); // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (expr.kind === 191 /* CallExpression */ && expr.expression.kind !== 98 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) { + if (expr.kind === 192 /* CallExpression */ && expr.expression.kind !== 99 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) { var funcType = checkNonNullExpression(expr.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -52979,10 +53888,10 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 190 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 72 /* Identifier */ || node.kind === 148 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 167 /* TypeQuery */ && node.parent.exprName === node)); + var ok = (node.parent.kind === 190 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 191 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 73 /* Identifier */ || node.kind === 149 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 168 /* TypeQuery */ && node.parent.exprName === node)); 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); } @@ -53003,13 +53912,13 @@ var ts; } function checkExpressionWorker(node, checkMode, forceTuple) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return checkIdentifier(node); - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return checkThisExpression(node); - case 98 /* SuperKeyword */: + case 99 /* SuperKeyword */: return checkSuperExpression(node); - case 96 /* NullKeyword */: + case 97 /* NullKeyword */: return nullWideningType; case 14 /* NoSubstitutionTemplateLiteral */: case 10 /* StringLiteral */: @@ -53020,82 +53929,82 @@ var ts; case 9 /* BigIntLiteral */: checkGrammarBigIntLiteral(node); return getFreshTypeOfLiteralType(getBigIntLiteralType(node)); - case 102 /* TrueKeyword */: + case 103 /* TrueKeyword */: return trueType; - case 87 /* FalseKeyword */: + case 88 /* FalseKeyword */: return falseType; - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return checkQualifiedName(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 191 /* CallExpression */: - if (node.expression.kind === 92 /* ImportKeyword */) { + case 192 /* CallExpression */: + if (node.expression.kind === 93 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 192 /* NewExpression */: + case 193 /* NewExpression */: return checkCallExpression(node, checkMode); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return checkClassExpression(node); - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 199 /* TypeOfExpression */: + case 200 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: return checkAssertion(node); - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: return checkNonNullAssertion(node); - case 214 /* MetaProperty */: + case 215 /* MetaProperty */: return checkMetaProperty(node); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return checkDeleteExpression(node); - case 200 /* VoidExpression */: + case 201 /* VoidExpression */: return checkVoidExpression(node); - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return checkAwaitExpression(node); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 210 /* OmittedExpression */: + case 211 /* OmittedExpression */: return undefinedWideningType; - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return checkYieldExpression(node); - case 215 /* SyntheticExpression */: + case 216 /* SyntheticExpression */: return node.type; - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 260 /* JsxElement */: + case 261 /* JsxElement */: return checkJsxElement(node, checkMode); - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return checkJsxFragment(node); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 262 /* JsxOpeningElement */: + case 263 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -53117,7 +54026,7 @@ var ts; var constraintType = getConstraintOfTypeParameter(typeParameter); var defaultType = getDefaultFromTypeParameter(typeParameter); if (constraintType && defaultType) { - checkTypeAssignableTo(defaultType, getTypeWithThisArgument(constraintType, defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); @@ -53132,7 +54041,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 157 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 158 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -53143,10 +54052,10 @@ 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 === 157 /* Constructor */ || func.kind === 161 /* ConstructSignature */ || func.kind === 166 /* ConstructorType */) { + if (func.kind === 158 /* Constructor */ || func.kind === 162 /* ConstructSignature */ || func.kind === 167 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 197 /* ArrowFunction */) { + if (func.kind === 198 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } } @@ -53202,13 +54111,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 197 /* ArrowFunction */: - case 160 /* CallSignature */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 165 /* FunctionType */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 198 /* ArrowFunction */: + case 161 /* CallSignature */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 166 /* FunctionType */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -53222,11 +54131,11 @@ var ts; continue; } var name = element.name; - if (name.kind === 72 /* Identifier */ && name.escapedText === predicateVariableName) { + if (name.kind === 73 /* Identifier */ && name.escapedText === predicateVariableName) { error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 185 /* ArrayBindingPattern */ || name.kind === 184 /* ObjectBindingPattern */) { + else if (name.kind === 186 /* ArrayBindingPattern */ || name.kind === 185 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -53235,19 +54144,19 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 162 /* IndexSignature */) { + if (node.kind === 163 /* 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 === 165 /* FunctionType */ || node.kind === 239 /* FunctionDeclaration */ || node.kind === 166 /* ConstructorType */ || - node.kind === 160 /* CallSignature */ || node.kind === 157 /* Constructor */ || - node.kind === 161 /* ConstructSignature */) { + else if (node.kind === 166 /* FunctionType */ || node.kind === 240 /* FunctionDeclaration */ || node.kind === 167 /* ConstructorType */ || + node.kind === 161 /* CallSignature */ || node.kind === 158 /* Constructor */ || + node.kind === 162 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); if (!(functionFlags & 4 /* Invalid */)) { // Async generators prior to ESNext require the __await and __asyncGenerator helpers - if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 7 /* ESNext */) { + if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 8 /* ESNext */) { checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */); } // Async functions prior to ES2017 require the __awaiter helper @@ -53271,10 +54180,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 161 /* ConstructSignature */: + case 162 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 160 /* CallSignature */: + case 161 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -53304,7 +54213,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 162 /* IndexSignature */ && node.kind !== 294 /* JSDocFunctionType */) { + if (node.kind !== 163 /* IndexSignature */ && node.kind !== 295 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -53321,7 +54230,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 157 /* Constructor */) { + if (member.kind === 158 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -53336,16 +54245,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (name && memberName) { switch (member.kind) { - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: addName(names, name, memberName, 1 /* Getter */); break; - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: addName(names, name, memberName, 2 /* Setter */); break; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* Property */); break; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: addName(names, name, memberName, 4 /* Method */); break; } @@ -53408,7 +54317,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* PropertySignature */) { + if (member.kind === 154 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -53416,7 +54325,7 @@ var ts; case 8 /* NumericLiteral */: memberName = name.text; break; - case 72 /* Identifier */: + case 73 /* Identifier */: memberName = ts.idText(name); break; default: @@ -53433,7 +54342,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 241 /* InterfaceDeclaration */) { + if (node.kind === 242 /* 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 @@ -53453,7 +54362,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 138 /* StringKeyword */: + case 139 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -53461,7 +54370,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 135 /* NumberKeyword */: + case 136 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -53488,7 +54397,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.hasModifier(node, 128 /* Abstract */) && node.kind === 156 /* MethodDeclaration */ && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 157 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -53513,7 +54422,7 @@ var ts; return; } function isInstancePropertyWithInitializer(n) { - return n.kind === 154 /* PropertyDeclaration */ && + return n.kind === 155 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -53543,7 +54452,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 221 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 222 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -53568,7 +54477,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 158 /* GetAccessor */) { + if (node.kind === 159 /* GetAccessor */) { if (!(node.flags & 4194304 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -53578,13 +54487,13 @@ 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 === 149 /* ComputedPropertyName */) { + if (node.name.kind === 150 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } 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 === 158 /* GetAccessor */ ? 159 /* SetAccessor */ : 158 /* GetAccessor */; + var otherKind = node.kind === 159 /* GetAccessor */ ? 160 /* SetAccessor */ : 159 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -53602,7 +54511,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 158 /* GetAccessor */) { + if (node.kind === 159 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -53650,7 +54559,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 164 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 165 /* 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); } var type = getTypeFromTypeReference(node); @@ -53698,7 +54607,7 @@ var ts; var seenOptionalElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind === 172 /* RestType */) { + if (e.kind === 173 /* RestType */) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); break; @@ -53707,7 +54616,7 @@ var ts; error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); } } - else if (e.kind === 171 /* OptionalType */) { + else if (e.kind === 172 /* OptionalType */) { seenOptionalElement = true; } else if (seenOptionalElement) { @@ -53728,7 +54637,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 190 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 191 /* 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)); } @@ -53740,7 +54649,7 @@ var ts; return type; } error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType)); - return type; + return errorType; } function checkIndexedAccessType(node) { checkSourceElement(node.objectType); @@ -53768,7 +54677,7 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 175 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 176 /* 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); @@ -53785,9 +54694,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 !== 241 /* InterfaceDeclaration */ && - n.parent.kind !== 240 /* ClassDeclaration */ && - n.parent.kind !== 209 /* ClassExpression */ && + if (n.parent.kind !== 242 /* InterfaceDeclaration */ && + n.parent.kind !== 241 /* ClassDeclaration */ && + n.parent.kind !== 210 /* ClassExpression */ && n.flags & 4194304 /* 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 @@ -53878,7 +54787,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 156 /* MethodDeclaration */ || node.kind === 155 /* MethodSignature */) && + var reportError = (node.kind === 157 /* MethodDeclaration */ || node.kind === 156 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -53917,7 +54826,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 4194304 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 241 /* InterfaceDeclaration */ || node.parent.kind === 168 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 242 /* InterfaceDeclaration */ || node.parent.kind === 169 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -53928,7 +54837,7 @@ 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 === 239 /* FunctionDeclaration */ || node.kind === 156 /* MethodDeclaration */ || node.kind === 155 /* MethodSignature */ || node.kind === 157 /* Constructor */) { + if (node.kind === 240 /* FunctionDeclaration */ || node.kind === 157 /* MethodDeclaration */ || node.kind === 156 /* MethodSignature */ || node.kind === 158 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -54057,22 +54966,22 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: return 2 /* ExportType */; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 240 /* ClassDeclaration */: - case 243 /* EnumDeclaration */: + case 241 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 284 /* SourceFile */: + case 285 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 254 /* ExportAssignment */: + case 255 /* 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 */; @@ -54080,20 +54989,20 @@ var ts; d = d.expression; /* falls through */ // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 248 /* ImportEqualsDeclaration */: - case 251 /* NamespaceImport */: - case 250 /* ImportClause */: - var result_5 = 0 /* None */; + case 249 /* ImportEqualsDeclaration */: + case 252 /* NamespaceImport */: + case 251 /* ImportClause */: + var result_7 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_5 |= getDeclarationSpaces(d); }); - return result_5; - case 237 /* VariableDeclaration */: - case 186 /* BindingElement */: - case 239 /* FunctionDeclaration */: - case 253 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_7 |= getDeclarationSpaces(d); }); + return result_7; + case 238 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 240 /* FunctionDeclaration */: + case 254 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - return ts.Debug.fail(ts.Debug.showSyntaxKind(d)); + return ts.Debug.failBadSyntaxKind(d); } } } @@ -54319,7 +55228,7 @@ var ts; var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67220415 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType; if (promiseConstructorType === errorType) { - if (promiseConstructorName.kind === 72 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { + if (promiseConstructorName.kind === 73 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); } else { @@ -54358,24 +55267,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 151 /* Parameter */: + case 152 /* 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 154 /* PropertyDeclaration */: + case 155 /* 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 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -54396,7 +55305,7 @@ var ts; if (!typeName) return; var rootName = getFirstIdentifier(typeName); - var meaning = (typeName.kind === 72 /* Identifier */ ? 67897832 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; + var meaning = (typeName.kind === 73 /* Identifier */ ? 67897832 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isRefernce*/ true); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */ @@ -54421,29 +55330,29 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 174 /* IntersectionType */: - case 173 /* UnionType */: + case 175 /* IntersectionType */: + case 174 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 177 /* ParenthesizedType */: + case 178 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var typeNode = types_17[_i]; - while (typeNode.kind === 177 /* ParenthesizedType */) { + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var typeNode = types_16[_i]; + while (typeNode.kind === 178 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 132 /* NeverKeyword */) { + if (typeNode.kind === 133 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 96 /* NullKeyword */ || typeNode.kind === 141 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 97 /* NullKeyword */ || typeNode.kind === 142 /* 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); @@ -54485,18 +55394,18 @@ var ts; return; } if (!compilerOptions.experimentalDecorators) { - error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning); + error(node, 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); } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 151 /* Parameter */) { + if (node.kind === 152 /* 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 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -54505,23 +55414,23 @@ var ts; } } break; - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - var otherKind = node.kind === 158 /* GetAccessor */ ? 159 /* SetAccessor */ : 158 /* GetAccessor */; + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + var otherKind = node.kind === 159 /* GetAccessor */ ? 160 /* SetAccessor */ : 159 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 156 /* MethodDeclaration */: + case 157 /* 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 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 151 /* Parameter */: + case 152 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -54584,7 +55493,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 === 148 /* 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 === 149 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -54617,9 +55526,9 @@ var ts; } function getIdentifierFromEntityNameExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return node; - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -54632,7 +55541,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 === 149 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 150 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -54661,7 +55570,7 @@ var ts; } } } - var body = node.kind === 155 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 156 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function var returnOrPromisedType = getReturnOrPromisedType(node, functionFlags); @@ -54706,42 +55615,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 284 /* SourceFile */: - case 244 /* ModuleDeclaration */: - case 218 /* Block */: - case 246 /* CaseBlock */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 285 /* SourceFile */: + case 245 /* ModuleDeclaration */: + case 219 /* Block */: + case 247 /* CaseBlock */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 157 /* Constructor */: - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 158 /* Constructor */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 242 /* TypeAliasDeclaration */: - case 241 /* InterfaceDeclaration */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 243 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 176 /* InferType */: + case 177 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -54761,11 +55670,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 157 /* MethodDeclaration */: + case 155 /* PropertyDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + if (member.kind === 160 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -54774,7 +55683,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 157 /* Constructor */: + case 158 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -54782,8 +55691,8 @@ var ts; } } break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: + case 163 /* IndexSignature */: + case 218 /* SemicolonClassElement */: // Can't be private break; default: @@ -54810,7 +55719,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 177 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (seenParentsWithEveryUnused.tryAdd(parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -54895,7 +55804,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 251 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 252 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -54913,7 +55822,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 === 237 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 238 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 238 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 239 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -54934,7 +55843,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 === 219 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 220 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -54946,24 +55855,24 @@ var ts; } function bindingNameText(name) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.idText(name); - case 185 /* ArrayBindingPattern */: - case 184 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 250 /* ImportClause */ || node.kind === 253 /* ImportSpecifier */ || node.kind === 251 /* NamespaceImport */; + return node.kind === 251 /* ImportClause */ || node.kind === 254 /* ImportSpecifier */ || node.kind === 252 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 250 /* ImportClause */ ? decl : decl.kind === 251 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 251 /* ImportClause */ ? decl : decl.kind === 252 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 218 /* Block */) { + if (node.kind === 219 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -54993,12 +55902,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 154 /* PropertyDeclaration */ || - node.kind === 153 /* PropertySignature */ || - node.kind === 156 /* MethodDeclaration */ || - node.kind === 155 /* MethodSignature */ || - node.kind === 158 /* GetAccessor */ || - node.kind === 159 /* SetAccessor */) { + if (node.kind === 155 /* PropertyDeclaration */ || + node.kind === 154 /* PropertySignature */ || + node.kind === 157 /* MethodDeclaration */ || + node.kind === 156 /* MethodSignature */ || + node.kind === 159 /* GetAccessor */ || + node.kind === 160 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -55007,7 +55916,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 151 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 152 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -55017,7 +55926,7 @@ var ts; function checkIfThisIsCapturedInEnclosingScope(node) { ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration_1 = node.kind !== 72 /* Identifier */; + var isDeclaration_1 = node.kind !== 73 /* Identifier */; if (isDeclaration_1) { error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -55032,7 +55941,7 @@ var ts; function checkIfNewTargetIsCapturedInEnclosingScope(node) { ts.findAncestor(node, function (current) { if (getNodeCheckFlags(current) & 8 /* CaptureNewTarget */) { - var isDeclaration_2 = node.kind !== 72 /* Identifier */; + var isDeclaration_2 = node.kind !== 73 /* Identifier */; if (isDeclaration_2) { error(ts.getNameOfDeclaration(node), ts.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); } @@ -55058,7 +55967,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 === 284 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 285 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -55073,7 +55982,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 === 284 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 285 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(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)); } @@ -55108,7 +56017,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 === 237 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 238 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -55120,17 +56029,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 238 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 219 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 239 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 220 /* 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 === 218 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 245 /* ModuleBlock */ || - container.kind === 244 /* ModuleDeclaration */ || - container.kind === 284 /* SourceFile */); + (container.kind === 219 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 246 /* ModuleBlock */ || + container.kind === 245 /* ModuleDeclaration */ || + container.kind === 285 /* 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 @@ -55143,69 +56052,6 @@ var ts; } } } - // Check that a parameter initializer contains no references to parameters declared to the right of itself - function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 151 /* Parameter */) { - return; - } - var func = ts.getContainingFunction(node); - visit(node.initializer); - function visit(n) { - if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { - // do not dive in types - // skip declaration names (i.e. in object literal expressions) - return; - } - if (n.kind === 189 /* PropertyAccessExpression */) { - // skip property names in property access expression - return visit(n.expression); - } - else if (n.kind === 72 /* Identifier */) { - // check FunctionLikeDeclaration.locals (stores parameters\function local variable) - // if it contains entry with a specified name - var symbol = resolveName(n, n.escapedText, 67220415 /* Value */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); - if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) { - return; - } - if (symbol.valueDeclaration === node) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); - return; - } - // locals map for function contain both parameters and function locals - // so we need to do a bit of extra work to check if reference is legal - var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); - if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 151 /* Parameter */ || - symbol.valueDeclaration.kind === 186 /* BindingElement */) { - // it is ok to reference parameter in initializer if either - // - parameter is located strictly on the left of current parameter declaration - if (symbol.valueDeclaration.pos < node.pos) { - return; - } - // - parameter is wrapped in function-like entity - if (ts.findAncestor(n, function (current) { - if (current === node.initializer) { - return "quit"; - } - return ts.isFunctionLike(current.parent) || - // computed property names/initializers in instance property declaration of class like entities - // are executed in constructor and thus deferred - (current.parent.kind === 154 /* PropertyDeclaration */ && - !(ts.hasModifier(current.parent, 32 /* Static */)) && - ts.isClassLike(current.parent.parent)); - })) { - return; - } - // fall through to report error - } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); - } - } - else { - return ts.forEachChild(n, visit); - } - } - } function convertAutoToAny(type) { return type === autoType ? anyType : type === autoArrayType ? anyArrayType : type; } @@ -55223,18 +56069,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 === 149 /* ComputedPropertyName */) { + if (node.name.kind === 150 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 186 /* BindingElement */) { - if (node.parent.kind === 184 /* ObjectBindingPattern */ && languageVersion < 7 /* ESNext */) { + if (node.kind === 187 /* BindingElement */) { + if (node.parent.kind === 185 /* ObjectBindingPattern */ && languageVersion < 8 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 149 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 150 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -55248,35 +56094,48 @@ var ts; var property = getPropertyOfType(parentType, nameText); if (property) { markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 99 /* SuperKeyword */, parentType, property); } } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 185 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 186 /* 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.getRootDeclaration(node).kind === 151 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 152 /* 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)) { - // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 226 /* ForInStatement */) { - var initializerType = checkExpressionCached(node.initializer); - if (strictNullChecks && node.name.elements.length === 0) { - checkNonNullType(initializerType, node); + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 227 /* ForInStatement */; + var needCheckWidenedType = node.name.elements.length === 0; + if (needCheckInitializer || needCheckWidenedType) { + // Don't validate for-in initializer as it is already an error + var widenedType = getWidenedTypeForVariableLikeDeclaration(node); + if (needCheckInitializer) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && needCheckWidenedType) { + checkNonNullNonVoidType(initializerType, node); + } + else { + checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); + } } - else { - checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); + // check the binding pattern with empty elements + if (needCheckWidenedType) { + if (ts.isArrayBindingPattern(node.name)) { + checkIteratedTypeOrElementType(widenedType, node, /* allowStringInput */ false, /* allowAsyncIterables */ false); + } + else if (strictNullChecks) { + checkNonNullNonVoidType(widenedType, node); + } } - checkParameterInitializer(node); } return; } @@ -55291,9 +56150,8 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && ts.hasEntries(symbol.exports); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 226 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 227 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); - checkParameterInitializer(node); } } if (symbol.declarations.length > 1) { @@ -55309,7 +56167,7 @@ var ts; if (type !== errorType && declarationType !== errorType && !isTypeIdenticalTo(type, declarationType) && !(symbol.flags & 67108864 /* Assignment */)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType); + errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType); } if (node.initializer) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined); @@ -55318,26 +56176,30 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 154 /* PropertyDeclaration */ && node.kind !== 153 /* PropertySignature */) { + if (node.kind !== 155 /* PropertyDeclaration */ && node.kind !== 154 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 237 /* VariableDeclaration */ || node.kind === 186 /* BindingElement */) { + if (node.kind === 238 /* VariableDeclaration */ || node.kind === 187 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } - function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { + function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 154 /* PropertyDeclaration */ || nextDeclaration.kind === 153 /* PropertySignature */ + var message = nextDeclaration.kind === 155 /* PropertyDeclaration */ || nextDeclaration.kind === 154 /* 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; - error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); + var declName = ts.declarationNameToString(nextDeclarationName); + var err = error(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType)); + if (firstDeclaration) { + ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here, declName)); + } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 151 /* Parameter */ && right.kind === 237 /* VariableDeclaration */) || - (left.kind === 237 /* VariableDeclaration */ && right.kind === 151 /* Parameter */)) { + if ((left.kind === 152 /* Parameter */ && right.kind === 238 /* VariableDeclaration */) || + (left.kind === 238 /* VariableDeclaration */ && right.kind === 152 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -55376,7 +56238,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkTruthinessExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 220 /* EmptyStatement */) { + if (node.thenStatement.kind === 221 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -55403,12 +56265,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 238 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 239 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 238 /* VariableDeclarationList */) { + if (node.initializer.kind === 239 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -55428,7 +56290,7 @@ var ts; checkGrammarForInOrForOfStatement(node); if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); - if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 7 /* ESNext */) { + if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 8 /* ESNext */) { // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */); } @@ -55442,14 +56304,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 === 238 /* VariableDeclarationList */) { + if (node.initializer.kind === 239 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 187 /* ArrayLiteralExpression */ || varExpr.kind === 188 /* ObjectLiteralExpression */) { + if (varExpr.kind === 188 /* ArrayLiteralExpression */ || varExpr.kind === 189 /* 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. @@ -55481,7 +56343,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 === 238 /* VariableDeclarationList */) { + if (node.initializer.kind === 239 /* 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); @@ -55495,7 +56357,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 === 187 /* ArrayLiteralExpression */ || varExpr.kind === 188 /* ObjectLiteralExpression */) { + if (varExpr.kind === 188 /* ArrayLiteralExpression */ || varExpr.kind === 189 /* 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)) { @@ -55855,12 +56717,12 @@ var ts; // for generators. return; } - else if (func.kind === 159 /* SetAccessor */) { + else if (func.kind === 160 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 157 /* Constructor */) { + else if (func.kind === 158 /* 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); } @@ -55881,7 +56743,7 @@ var ts; } } } - else if (func.kind !== 157 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + else if (func.kind !== 158 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { // 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); } @@ -55910,7 +56772,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 === 272 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 273 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -55922,7 +56784,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 271 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 272 /* 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. @@ -55951,7 +56813,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 233 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 234 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -56058,8 +56920,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 === 204 /* BinaryExpression */ || - name.kind === 149 /* ComputedPropertyName */ || + (propDeclaration.kind === 205 /* BinaryExpression */ || + name.kind === 150 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -56136,7 +56998,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 164 /* TypeReference */) { + if (node.kind === 165 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -56258,6 +57120,11 @@ var ts; if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */); } + // check both @extends and extends if both are specified. + var extendsNode = ts.getClassExtendsHeritageElement(node); + if (extendsNode && extendsNode !== baseTypeNode) { + checkExpression(extendsNode.expression); + } var baseTypes = getBaseTypes(type); if (baseTypes.length && produceDiagnostics) { var baseType_1 = baseTypes[0]; @@ -56265,10 +57132,6 @@ var ts; var staticBaseType = getApparentType(baseConstructorType); checkBaseTypeAccessibility(staticBaseType, baseTypeNode); checkSourceElement(baseTypeNode.expression); - var extendsNode = ts.getClassExtendsHeritageElement(node); - if (extendsNode && extendsNode !== baseTypeNode) { - checkExpression(extendsNode.expression); - } if (ts.some(baseTypeNode.typeArguments)) { ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { @@ -56339,7 +57202,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_9 = function (member) { + var _loop_12 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -56358,7 +57221,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_9(member); + _loop_12(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -56384,7 +57247,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 240 /* ClassDeclaration */ || d.kind === 241 /* InterfaceDeclaration */; + return d.kind === 241 /* ClassDeclaration */ || d.kind === 242 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -56423,7 +57286,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 209 /* ClassExpression */) { + if (derivedClassDecl.kind === 210 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -56473,8 +57336,8 @@ var ts; for (var _i = 0, baseTypes_2 = baseTypes; _i < baseTypes_2.length; _i++) { var base = baseTypes_2[_i]; var properties = getPropertiesOfType(getTypeWithThisArgument(base, type.thisType)); - for (var _a = 0, properties_7 = properties; _a < properties_7.length; _a++) { - var prop = properties_7[_a]; + for (var _a = 0, properties_4 = properties; _a < properties_4.length; _a++) { + var prop = properties_4[_a]; var existing = seen.get(prop.escapedName); if (!existing) { seen.set(prop.escapedName, { prop: prop, containingType: base }); @@ -56515,7 +57378,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 154 /* PropertyDeclaration */ && + return node.kind === 155 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -56539,7 +57402,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 241 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 242 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -56644,7 +57507,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -56654,7 +57517,7 @@ var ts; } } break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -56682,22 +57545,22 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return evaluate(expr.expression); - case 72 /* Identifier */: + case 73 /* Identifier */: var identifier = expr; if (isInfinityOrNaNString(identifier.escapedText)) { return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 190 /* ElementAccessExpression */: - case 189 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: + case 190 /* 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 === 189 /* PropertyAccessExpression */) { + if (ex.kind === 190 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -56728,9 +57591,9 @@ var ts; } } function isConstantMemberAccess(node) { - return node.kind === 72 /* Identifier */ || - node.kind === 189 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 190 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + return node.kind === 73 /* Identifier */ || + node.kind === 190 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 191 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 10 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -56765,7 +57628,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 !== 243 /* EnumDeclaration */) { + if (declaration.kind !== 244 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -56788,8 +57651,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 === 240 /* ClassDeclaration */ || - (declaration.kind === 239 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 241 /* ClassDeclaration */ || + (declaration.kind === 240 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 4194304 /* Ambient */)) { return declaration; } @@ -56852,7 +57715,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, 240 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 241 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -56902,23 +57765,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 219 /* VariableStatement */: + case 220 /* 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 254 /* ExportAssignment */: - case 255 /* ExportDeclaration */: + case 255 /* ExportAssignment */: + case 256 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 248 /* ImportEqualsDeclaration */: - case 249 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 250 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 186 /* BindingElement */: - case 237 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 238 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -56929,12 +57792,12 @@ var ts; break; } // falls through - case 240 /* ClassDeclaration */: - case 243 /* EnumDeclaration */: - case 239 /* FunctionDeclaration */: - case 241 /* InterfaceDeclaration */: - case 244 /* ModuleDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 241 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: + case 240 /* FunctionDeclaration */: + case 242 /* InterfaceDeclaration */: + case 245 /* ModuleDeclaration */: + case 243 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -56955,17 +57818,17 @@ var ts; } function getFirstIdentifier(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return node; - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: do { node = node.left; - } while (node.kind !== 72 /* Identifier */); + } while (node.kind !== 73 /* Identifier */); return node; - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: do { node = node.expression; - } while (node.kind !== 72 /* Identifier */); + } while (node.kind !== 73 /* Identifier */); return node; } } @@ -56979,9 +57842,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 245 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 284 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 255 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 246 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 285 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 256 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -57014,14 +57877,14 @@ var ts; (symbol.flags & 67897832 /* Type */ ? 67897832 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 257 /* ExportSpecifier */ ? + var message = node.kind === 258 /* 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 === 257 /* ExportSpecifier */ + && node.kind === 258 /* ExportSpecifier */ && !(target.flags & 67220415 /* Value */) && !(node.flags & 4194304 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -57048,7 +57911,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 251 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 252 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -57072,7 +57935,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 259 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 260 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 67220415 /* Value */) { @@ -57108,10 +57971,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 245 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 245 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 246 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 246 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 4194304 /* Ambient */; - if (node.parent.kind !== 284 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 285 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -57128,7 +57991,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 284 /* SourceFile */ || node.parent.kind === 245 /* ModuleBlock */ || node.parent.kind === 244 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 285 /* SourceFile */ || node.parent.kind === 246 /* ModuleBlock */ || node.parent.kind === 245 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -57157,8 +58020,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 === 284 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 244 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 285 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 245 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -57171,7 +58034,7 @@ var ts; if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasModifiers(node)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === 72 /* Identifier */) { + if (node.expression.kind === 73 /* Identifier */) { markExportAsReferenced(node); if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); @@ -57246,7 +58109,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 239 /* FunctionDeclaration */ && declaration.kind !== 156 /* MethodDeclaration */) || + return (declaration.kind !== 240 /* FunctionDeclaration */ && declaration.kind !== 157 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -57269,158 +58132,158 @@ 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 244 /* ModuleDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 239 /* FunctionDeclaration */: + case 245 /* ModuleDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 240 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return checkTypeParameter(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return checkParameter(node); - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return checkPropertyDeclaration(node); - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 162 /* IndexSignature */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 163 /* IndexSignature */: return checkSignatureDeclaration(node); - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: return checkMethodDeclaration(node); - case 157 /* Constructor */: + case 158 /* Constructor */: return checkConstructorDeclaration(node); - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return checkAccessorDeclaration(node); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return checkTypeReferenceNode(node); - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: return checkTypePredicate(node); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return checkTypeQuery(node); - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return checkTypeLiteral(node); - case 169 /* ArrayType */: + case 170 /* ArrayType */: return checkArrayType(node); - case 170 /* TupleType */: + case 171 /* TupleType */: return checkTupleType(node); - case 173 /* UnionType */: - case 174 /* IntersectionType */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 177 /* ParenthesizedType */: - case 171 /* OptionalType */: - case 172 /* RestType */: + case 178 /* ParenthesizedType */: + case 172 /* OptionalType */: + case 173 /* RestType */: return checkSourceElement(node.type); - case 178 /* ThisType */: + case 179 /* ThisType */: return checkThisType(node); - case 179 /* TypeOperator */: + case 180 /* TypeOperator */: return checkTypeOperator(node); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return checkConditionalType(node); - case 176 /* InferType */: + case 177 /* InferType */: return checkInferType(node); - case 183 /* ImportType */: + case 184 /* ImportType */: return checkImportType(node); - case 300 /* JSDocAugmentsTag */: + case 301 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: return checkJSDocTypeAliasTag(node); - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 307 /* JSDocTypeTag */: + case 308 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 304 /* JSDocParameterTag */: + case 305 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 292 /* JSDocNonNullableType */: - case 291 /* JSDocNullableType */: - case 289 /* JSDocAllType */: - case 290 /* JSDocUnknownType */: - case 297 /* JSDocTypeLiteral */: + case 293 /* JSDocNonNullableType */: + case 292 /* JSDocNullableType */: + case 290 /* JSDocAllType */: + case 291 /* JSDocUnknownType */: + case 298 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 295 /* JSDocVariadicType */: + case 296 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 288 /* JSDocTypeExpression */: + case 289 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 181 /* MappedType */: + case 182 /* MappedType */: return checkMappedType(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 218 /* Block */: - case 245 /* ModuleBlock */: + case 219 /* Block */: + case 246 /* ModuleBlock */: return checkBlock(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return checkVariableStatement(node); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return checkExpressionStatement(node); - case 222 /* IfStatement */: + case 223 /* IfStatement */: return checkIfStatement(node); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return checkDoStatement(node); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return checkWhileStatement(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return checkForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return checkForInStatement(node); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return checkForOfStatement(node); - case 228 /* ContinueStatement */: - case 229 /* BreakStatement */: + case 229 /* ContinueStatement */: + case 230 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return checkReturnStatement(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return checkWithStatement(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return checkSwitchStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return checkLabeledStatement(node); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: return checkThrowStatement(node); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return checkTryStatement(node); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return checkBindingElement(node); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return checkClassDeclaration(node); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return checkImportDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return checkExportDeclaration(node); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return checkExportAssignment(node); - case 220 /* EmptyStatement */: - case 236 /* DebuggerStatement */: + case 221 /* EmptyStatement */: + case 237 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 258 /* MissingDeclaration */: + case 259 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -57514,23 +58377,23 @@ var ts; var saveCurrentNode = currentNode; currentNode = node; switch (node.kind) { - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 260 /* JsxElement */: + case 261 /* JsxElement */: checkJsxElementDeferred(node); break; } @@ -57660,17 +58523,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 284 /* SourceFile */: + case 285 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -57678,8 +58541,8 @@ var ts; // falls through // 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 - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* 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. @@ -57688,7 +58551,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67897832 /* Type */); } break; - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -57730,17 +58593,17 @@ var ts; } } function isTypeDeclarationName(name) { - return name.kind === 72 /* Identifier */ && + return name.kind === 73 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 150 /* TypeParameter */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 243 /* EnumDeclaration */: + case 151 /* TypeParameter */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 244 /* EnumDeclaration */: return true; default: return false; @@ -57748,16 +58611,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 148 /* QualifiedName */) { + while (node.parent.kind === 149 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 164 /* TypeReference */; + return node.parent.kind === 165 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 189 /* PropertyAccessExpression */) { + while (node.parent.kind === 190 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 211 /* ExpressionWithTypeArguments */; + return node.parent.kind === 212 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -57785,13 +58648,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 148 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 149 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 248 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 249 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 254 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 255 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -57817,7 +58680,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 183 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 184 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -57827,7 +58690,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJSFile(entityName) && - entityName.parent.kind === 189 /* PropertyAccessExpression */ && + entityName.parent.kind === 190 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -57835,7 +58698,7 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 254 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 255 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(entityName, /*all meanings*/ 67220415 /* Value */ | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -57845,7 +58708,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(entityName) && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 248 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 249 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -57863,7 +58726,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 211 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 212 /* ExpressionWithTypeArguments */) { meaning = 67897832 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -57879,10 +58742,10 @@ var ts; return entityNameSymbol; } } - if (entityName.parent.kind === 304 /* JSDocParameterTag */) { + if (entityName.parent.kind === 305 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 150 /* TypeParameter */ && entityName.parent.parent.kind === 308 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 151 /* TypeParameter */ && entityName.parent.parent.kind === 309 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -57892,19 +58755,19 @@ var ts; // Missing entity name. return undefined; } - if (entityName.kind === 72 /* Identifier */) { + if (entityName.kind === 73 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { var symbol = getIntrinsicTagSymbol(entityName.parent); return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 67220415 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 189 /* PropertyAccessExpression */ || entityName.kind === 148 /* QualifiedName */) { + else if (entityName.kind === 190 /* PropertyAccessExpression */ || entityName.kind === 149 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 189 /* PropertyAccessExpression */) { + if (entityName.kind === 190 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -57914,17 +58777,17 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 164 /* TypeReference */ ? 67897832 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 165 /* TypeReference */ ? 67897832 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - if (entityName.parent.kind === 163 /* TypePredicate */) { + if (entityName.parent.kind === 164 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -57943,12 +58806,12 @@ var ts; else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); } - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (parent.kind === 186 /* BindingElement */ && - grandParent.kind === 184 /* ObjectBindingPattern */ && + else if (parent.kind === 187 /* BindingElement */ && + grandParent.kind === 185 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -57958,11 +58821,11 @@ var ts; } } switch (node.kind) { - case 72 /* Identifier */: - case 189 /* PropertyAccessExpression */: - case 148 /* QualifiedName */: + case 73 /* Identifier */: + case 190 /* PropertyAccessExpression */: + case 149 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); if (ts.isFunctionLike(container)) { var sig = getSignatureFromDeclaration(container); @@ -57974,14 +58837,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 178 /* ThisType */: + case 179 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; - case 98 /* SuperKeyword */: + case 99 /* SuperKeyword */: return checkExpression(node).symbol; - case 124 /* ConstructorKeyword */: + case 125 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 157 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 158 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -57992,7 +58855,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 === 249 /* ImportDeclaration */ || node.parent.kind === 255 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 250 /* ImportDeclaration */ || node.parent.kind === 256 /* 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); @@ -58009,21 +58872,21 @@ var ts; ? getTypeFromTypeNode(grandParent.objectType) : undefined; return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text)); - case 80 /* DefaultKeyword */: - case 90 /* FunctionKeyword */: + case 81 /* DefaultKeyword */: + case 91 /* FunctionKeyword */: case 37 /* EqualsGreaterThanToken */: - case 76 /* ClassKeyword */: + case 77 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 183 /* ImportType */: + case 184 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined; - case 85 /* ExportKeyword */: + case 86 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.assertDefined(node.parent.symbol) : undefined; default: return undefined; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 276 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 277 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 67220415 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -58090,33 +58953,35 @@ var ts; // } // [ a ] from // [a] = [ some array ...] - function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 188 /* ObjectLiteralExpression */ || expr.kind === 187 /* ArrayLiteralExpression */); + function getTypeOfAssignmentPattern(expr) { + ts.Debug.assert(expr.kind === 189 /* ObjectLiteralExpression */ || expr.kind === 188 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 227 /* ForOfStatement */) { + if (expr.parent.kind === 228 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 204 /* BinaryExpression */) { + if (expr.parent.kind === 205 /* 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 === 275 /* PropertyAssignment */) { - var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); - return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || errorType, expr.parent); // TODO: GH#18217 + if (expr.parent.kind === 276 /* PropertyAssignment */) { + var node_3 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); + var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_3) || errorType; + var propertyIndex = ts.indexOfNode(node_3.properties, expr.parent); + return checkObjectLiteralDestructuringPropertyAssignment(node_3, typeOfParentObjectLiteral, propertyIndex); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 187 /* ArrayLiteralExpression */); + var node = ts.cast(expr.parent, ts.isArrayLiteralExpression); // [{ property1: p1, property2 }] = elems; - var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); - var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || errorType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || errorType); // TODO: GH#18217 + var typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType; + var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || errorType; + return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType); } // Gets the property symbol corresponding to the property in destructuring assignment // 'property1' from @@ -58126,7 +58991,7 @@ var ts; // [a] = [ property1, property2 ] function getPropertySymbolOfDestructuringAssignment(location) { // Get the type of the object or array literal and then look for property of given name in the type - var typeOfObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(location.parent.parent); + var typeOfObjectLiteral = getTypeOfAssignmentPattern(ts.cast(location.parent.parent, ts.isAssignmentPattern)); return typeOfObjectLiteral && getPropertyOfType(typeOfObjectLiteral, location.escapedText); } function getRegularTypeOfExpression(expr) { @@ -58148,12 +59013,12 @@ var ts; function getClassElementPropertyKeyType(element) { var name = element.name; switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return getLiteralType(ts.idText(name)); case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -58210,7 +59075,7 @@ var ts; if (!ts.isGeneratedIdentifier(nodeIn)) { var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 190 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -58266,7 +59131,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 284 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 285 /* 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. @@ -58292,12 +59157,16 @@ var ts; } return undefined; } + function isSymbolOfDestructuredElementOfCatchBinding(symbol) { + return ts.isBindingElement(symbol.valueDeclaration) + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 275 /* CatchClause */; + } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isDeclarationWithCollidingName === undefined) { var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); - if (ts.isStatementWithLocals(container)) { + if (ts.isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) { var nodeLinks_1 = getNodeLinks(symbol.valueDeclaration); if (resolveName(container.parent, symbol.escapedName, 67220415 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) { // redeclaration - always should be renamed @@ -58321,7 +59190,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 === 218 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 219 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -58362,18 +59231,18 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 248 /* ImportEqualsDeclaration */: - case 250 /* ImportClause */: - case 251 /* NamespaceImport */: - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: + case 249 /* ImportEqualsDeclaration */: + case 251 /* ImportClause */: + case 252 /* NamespaceImport */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && ts.some(exportClause.elements, isValueAliasDeclaration); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return node.expression - && node.expression.kind === 72 /* Identifier */ + && node.expression.kind === 73 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; } @@ -58381,7 +59250,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 284 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 285 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -58482,15 +59351,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 278 /* EnumMember */: - case 189 /* PropertyAccessExpression */: - case 190 /* ElementAccessExpression */: + case 279 /* EnumMember */: + case 190 /* PropertyAccessExpression */: + case 191 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 278 /* EnumMember */) { + if (node.kind === 279 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -58575,7 +59444,7 @@ var ts; function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) { var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor); if (!declaration) { - return ts.createToken(120 /* AnyKeyword */); + return ts.createToken(121 /* AnyKeyword */); } // Get type of the symbol if this is the valid symbol otherwise get type at location var symbol = getSymbolOfNode(declaration); @@ -58594,7 +59463,7 @@ var ts; function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) { var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike); if (!signatureDeclaration) { - return ts.createToken(120 /* AnyKeyword */); + return ts.createToken(121 /* AnyKeyword */); } var signature = getSignatureFromDeclaration(signatureDeclaration); return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker); @@ -58602,7 +59471,7 @@ var ts; function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) { var expr = ts.getParseTreeNode(exprIn, ts.isExpression); if (!expr) { - return ts.createToken(120 /* AnyKeyword */); + return ts.createToken(121 /* AnyKeyword */); } var type = getWidenedType(getRegularTypeOfExpression(expr)); return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker); @@ -58721,17 +59590,17 @@ var ts; isLateBound: function (nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration); var symbol = node && getSymbolOfNode(node); - return !!(symbol && ts.getCheckFlags(symbol) & 2048 /* Late */); + return !!(symbol && ts.getCheckFlags(symbol) & 4096 /* Late */); }, getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; }, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 159 /* SetAccessor */ ? 158 /* GetAccessor */ : 159 /* SetAccessor */; + var otherKind = accessor.kind === 160 /* SetAccessor */ ? 159 /* GetAccessor */ : 160 /* 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 === 159 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 158 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 160 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 159 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -58747,7 +59616,7 @@ var ts; } }; function isInHeritageClause(node) { - return node.parent && node.parent.kind === 211 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 273 /* HeritageClause */; + return node.parent && node.parent.kind === 212 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 274 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -58759,7 +59628,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 = 67897832 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 72 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 189 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 73 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 190 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 67220415 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -58810,7 +59679,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 284 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 285 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -58838,12 +59707,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 245 /* 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, 284 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 285 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -58860,6 +59729,15 @@ var ts; continue; } if (!ts.isExternalOrCommonJsModule(file)) { + // It is an error for a non-external-module (i.e. script) to declare its own `globalThis`. + // We can't use `builtinGlobals` for this due to synthetic expando-namespace generation in JS files. + var fileGlobalThisSymbol = file.locals.get("globalThis"); + if (fileGlobalThisSymbol) { + for (var _d = 0, _e = fileGlobalThisSymbol.declarations; _d < _e.length; _d++) { + var declaration = _e[_d]; + diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis")); + } + } mergeSymbolTable(globals, file.locals); } if (file.jsGlobalAugmentations) { @@ -58890,10 +59768,10 @@ var ts; if (augmentations) { // merge _global_ module augmentations. // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed - for (var _d = 0, augmentations_1 = augmentations; _d < augmentations_1.length; _d++) { - var list = augmentations_1[_d]; - for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { - var augmentation = list_1[_e]; + for (var _f = 0, augmentations_1 = augmentations; _f < augmentations_1.length; _f++) { + var list = augmentations_1[_f]; + for (var _g = 0, list_1 = list; _g < list_1.length; _g++) { + var augmentation = list_1[_g]; if (!ts.isGlobalScopeAugmentation(augmentation.parent)) continue; mergeModuleAugmentation(augmentation); @@ -58905,6 +59783,7 @@ var ts; getSymbolLinks(undefinedSymbol).type = undefinedWideningType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", /*arity*/ 0, /*reportErrors*/ true); getSymbolLinks(unknownSymbol).type = errorType; + getSymbolLinks(globalThisSymbol).type = createObjectType(16 /* Anonymous */, globalThisSymbol); // Initialize special types globalArrayType = getGlobalType("Array", /*arity*/ 1, /*reportErrors*/ true); globalObjectType = getGlobalType("Object", /*arity*/ 0, /*reportErrors*/ true); @@ -58921,16 +59800,16 @@ var ts; // autoArrayType is used as a marker, so even if global Array type is not defined, it needs to be a unique type autoArrayType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); } - globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); + globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1) || globalArrayType; anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); if (augmentations) { // merge _nonglobal_ module augmentations. // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed - for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { - var list = augmentations_2[_f]; - for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { - var augmentation = list_2[_g]; + for (var _h = 0, augmentations_2 = augmentations; _h < augmentations_2.length; _h++) { + var list = augmentations_2[_h]; + for (var _j = 0, list_2 = list; _j < list_2.length; _j++) { + var augmentation = list_2[_j]; if (ts.isGlobalScopeAugmentation(augmentation.parent)) continue; mergeModuleAugmentation(augmentation); @@ -59021,14 +59900,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 156 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 157 /* 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 === 158 /* GetAccessor */ || node.kind === 159 /* SetAccessor */) { + else if (node.kind === 159 /* GetAccessor */ || node.kind === 160 /* 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); @@ -59045,23 +59924,23 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 133 /* ReadonlyKeyword */) { - if (node.kind === 153 /* PropertySignature */ || node.kind === 155 /* MethodSignature */) { + if (modifier.kind !== 134 /* ReadonlyKeyword */) { + if (node.kind === 154 /* PropertySignature */ || node.kind === 156 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 162 /* IndexSignature */) { + if (node.kind === 163 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { - case 77 /* ConstKeyword */: - if (node.kind !== 243 /* EnumDeclaration */) { - return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(77 /* ConstKeyword */)); + case 78 /* ConstKeyword */: + if (node.kind !== 244 /* EnumDeclaration */) { + return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(78 /* ConstKeyword */)); } break; - case 115 /* PublicKeyword */: - case 114 /* ProtectedKeyword */: - case 113 /* PrivateKeyword */: + case 116 /* PublicKeyword */: + case 115 /* ProtectedKeyword */: + case 114 /* PrivateKeyword */: var text = visibilityToString(ts.modifierToFlag(modifier.kind)); if (flags & 28 /* AccessibilityModifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); @@ -59075,11 +59954,11 @@ 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 === 245 /* ModuleBlock */ || node.parent.kind === 284 /* SourceFile */) { + else if (node.parent.kind === 246 /* ModuleBlock */ || node.parent.kind === 285 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { - if (modifier.kind === 113 /* PrivateKeyword */) { + if (modifier.kind === 114 /* PrivateKeyword */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); } else { @@ -59088,7 +59967,7 @@ var ts; } flags |= ts.modifierToFlag(modifier.kind); break; - case 116 /* StaticKeyword */: + case 117 /* StaticKeyword */: if (flags & 32 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -59098,10 +59977,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 === 245 /* ModuleBlock */ || node.parent.kind === 284 /* SourceFile */) { + else if (node.parent.kind === 246 /* ModuleBlock */ || node.parent.kind === 285 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 151 /* Parameter */) { + else if (node.kind === 152 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -59110,18 +59989,18 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 133 /* ReadonlyKeyword */: + case 134 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 154 /* PropertyDeclaration */ && node.kind !== 153 /* PropertySignature */ && node.kind !== 162 /* IndexSignature */ && node.kind !== 151 /* Parameter */) { + else if (node.kind !== 155 /* PropertyDeclaration */ && node.kind !== 154 /* PropertySignature */ && node.kind !== 163 /* IndexSignature */ && node.kind !== 152 /* 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); } flags |= 64 /* Readonly */; lastReadonly = modifier; break; - case 85 /* ExportKeyword */: + case 86 /* ExportKeyword */: if (flags & 1 /* Export */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -59134,52 +60013,52 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 240 /* ClassDeclaration */) { + else if (node.parent.kind === 241 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 151 /* Parameter */) { + else if (node.kind === 152 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; - case 80 /* DefaultKeyword */: - var container = node.parent.kind === 284 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 244 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + case 81 /* DefaultKeyword */: + var container = node.parent.kind === 285 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 245 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; break; - case 125 /* DeclareKeyword */: + case 126 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 240 /* ClassDeclaration */) { + else if (node.parent.kind === 241 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 151 /* Parameter */) { + else if (node.kind === 152 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 4194304 /* Ambient */) && node.parent.kind === 245 /* ModuleBlock */) { + else if ((node.parent.flags & 4194304 /* Ambient */) && node.parent.kind === 246 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; lastDeclare = modifier; break; - case 118 /* AbstractKeyword */: + case 119 /* AbstractKeyword */: if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 240 /* ClassDeclaration */) { - if (node.kind !== 156 /* MethodDeclaration */ && - node.kind !== 154 /* PropertyDeclaration */ && - node.kind !== 158 /* GetAccessor */ && - node.kind !== 159 /* SetAccessor */) { + if (node.kind !== 241 /* ClassDeclaration */) { + if (node.kind !== 157 /* MethodDeclaration */ && + node.kind !== 155 /* PropertyDeclaration */ && + node.kind !== 159 /* GetAccessor */ && + node.kind !== 160 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 240 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 241 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -59191,14 +60070,14 @@ var ts; } flags |= 128 /* Abstract */; break; - case 121 /* AsyncKeyword */: + case 122 /* AsyncKeyword */: if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "async"); } else if (flags & 2 /* Ambient */ || node.parent.flags & 4194304 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 151 /* Parameter */) { + else if (node.kind === 152 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -59206,7 +60085,7 @@ var ts; break; } } - if (node.kind === 157 /* Constructor */) { + if (node.kind === 158 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -59221,13 +60100,13 @@ var ts; } return false; } - else if ((node.kind === 249 /* ImportDeclaration */ || node.kind === 248 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 250 /* ImportDeclaration */ || node.kind === 249 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 151 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 152 /* 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 === 151 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 152 /* 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 */) { @@ -59248,38 +60127,38 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 157 /* Constructor */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 162 /* IndexSignature */: - case 244 /* ModuleDeclaration */: - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 255 /* ExportDeclaration */: - case 254 /* ExportAssignment */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 151 /* Parameter */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 158 /* Constructor */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 163 /* IndexSignature */: + case 245 /* ModuleDeclaration */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 256 /* ExportDeclaration */: + case 255 /* ExportAssignment */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 152 /* Parameter */: return false; default: - if (node.parent.kind === 245 /* ModuleBlock */ || node.parent.kind === 284 /* SourceFile */) { + if (node.parent.kind === 246 /* ModuleBlock */ || node.parent.kind === 285 /* SourceFile */) { return false; } switch (node.kind) { - case 239 /* FunctionDeclaration */: - return nodeHasAnyModifiersExcept(node, 121 /* AsyncKeyword */); - case 240 /* ClassDeclaration */: - return nodeHasAnyModifiersExcept(node, 118 /* AbstractKeyword */); - case 241 /* InterfaceDeclaration */: - case 219 /* VariableStatement */: - case 242 /* TypeAliasDeclaration */: + case 240 /* FunctionDeclaration */: + return nodeHasAnyModifiersExcept(node, 122 /* AsyncKeyword */); + case 241 /* ClassDeclaration */: + return nodeHasAnyModifiersExcept(node, 119 /* AbstractKeyword */); + case 242 /* InterfaceDeclaration */: + case 220 /* VariableStatement */: + case 243 /* TypeAliasDeclaration */: return true; - case 243 /* EnumDeclaration */: - return nodeHasAnyModifiersExcept(node, 77 /* ConstKeyword */); + case 244 /* EnumDeclaration */: + return nodeHasAnyModifiersExcept(node, 78 /* ConstKeyword */); default: ts.Debug.fail(); return false; @@ -59291,10 +60170,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 156 /* MethodDeclaration */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -59409,10 +60288,10 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 138 /* StringKeyword */ && parameter.type.kind !== 135 /* NumberKeyword */) { + if (parameter.type.kind !== 139 /* StringKeyword */ && parameter.type.kind !== 136 /* 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(getTypeFromTypeNode(node.type))); + 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)); } if (type.flags & 1048576 /* Union */ && allTypesAssignableToKind(type, 128 /* StringLiteral */, /*strict*/ true)) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); @@ -59443,9 +60322,9 @@ var ts; } function checkGrammarForOmittedArgument(args) { if (args) { - for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { - var arg = args_5[_i]; - if (arg.kind === 210 /* OmittedExpression */) { + for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { + var arg = args_4[_i]; + if (arg.kind === 211 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -59475,7 +60354,7 @@ var ts; if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 86 /* ExtendsKeyword */) { + if (heritageClause.token === 87 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -59488,7 +60367,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 109 /* ImplementsKeyword */); + ts.Debug.assert(heritageClause.token === 110 /* ImplementsKeyword */); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -59504,14 +60383,14 @@ var ts; if (node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 86 /* ExtendsKeyword */) { + if (heritageClause.token === 87 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 109 /* ImplementsKeyword */); + ts.Debug.assert(heritageClause.token === 110 /* ImplementsKeyword */); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } // Grammar checking heritageClause inside class declaration @@ -59522,20 +60401,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 149 /* ComputedPropertyName */) { + if (node.kind !== 150 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 204 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 205 /* 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 === 239 /* FunctionDeclaration */ || - node.kind === 196 /* FunctionExpression */ || - node.kind === 156 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 240 /* FunctionDeclaration */ || + node.kind === 197 /* FunctionExpression */ || + node.kind === 157 /* MethodDeclaration */); if (node.flags & 4194304 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -59561,15 +60440,22 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 277 /* SpreadAssignment */) { + if (prop.kind === 278 /* SpreadAssignment */) { + if (inDestructuring) { + // a rest property cannot be destructured any further + var expression = ts.skipParentheses(prop.expression); + if (ts.isArrayLiteralExpression(expression) || ts.isObjectLiteralExpression(expression)) { + return grammarErrorOnNode(prop.expression, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } + } continue; } var name = prop.name; - if (name.kind === 149 /* ComputedPropertyName */) { + if (name.kind === 150 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 276 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 277 /* 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.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -59578,7 +60464,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 121 /* AsyncKeyword */ || prop.kind !== 156 /* MethodDeclaration */) { + if (mod.kind !== 122 /* AsyncKeyword */ || prop.kind !== 157 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -59593,23 +60479,23 @@ 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 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); /* tslint:disable:no-switch-case-fall-through */ - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -59646,7 +60532,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 269 /* JsxSpreadAttribute */) { + if (attr.kind === 270 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -59656,7 +60542,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 270 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 271 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -59665,12 +60551,25 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 227 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 228 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { - return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); + // 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 !== 158 /* 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); + } + diagnostics.add(diagnostic); + return true; + } + return false; } } - if (forInOrOfStatement.initializer.kind === 238 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 239 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -59685,20 +60584,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 226 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 227 /* 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 === 226 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 227 /* 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 === 226 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 227 /* 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); @@ -59725,11 +60624,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 158 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 159 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 159 /* SetAccessor */) { + else if (kind === 160 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -59753,23 +60652,23 @@ 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 === 158 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 159 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 158 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 159 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 142 /* UniqueKeyword */) { - if (node.type.kind !== 139 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(139 /* SymbolKeyword */)); + if (node.operator === 143 /* UniqueKeyword */) { + if (node.type.kind !== 140 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(140 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: var decl = parent; - if (decl.name.kind !== 72 /* Identifier */) { + if (decl.name.kind !== 73 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); } if (!ts.isVariableDeclarationInVariableStatement(decl)) { @@ -59779,13 +60678,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(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 153 /* PropertySignature */: + case 154 /* PropertySignature */: if (!ts.hasModifier(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); } @@ -59794,9 +60693,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 133 /* ReadonlyKeyword */) { - if (node.type.kind !== 169 /* ArrayType */ && node.type.kind !== 170 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(139 /* SymbolKeyword */)); + else if (node.operator === 134 /* ReadonlyKeyword */) { + if (node.type.kind !== 170 /* ArrayType */ && node.type.kind !== 171 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(140 /* SymbolKeyword */)); } } } @@ -59809,10 +60708,10 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 156 /* MethodDeclaration */) { - if (node.parent.kind === 188 /* ObjectLiteralExpression */) { + if (node.kind === 157 /* MethodDeclaration */) { + if (node.parent.kind === 189 /* 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 === 121 /* AsyncKeyword */)) { + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 122 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { @@ -59825,6 +60724,9 @@ var ts; return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } + else if (ts.isClassLike(node.parent) && ts.isStringLiteral(node.name) && node.name.text === "constructor" && (!compilerOptions.target || compilerOptions.target < 1 /* ES5 */)) { + return grammarErrorOnNode(node.name, ts.Diagnostics.Quoted_constructors_have_previously_been_interpreted_as_methods_which_is_incorrect_In_TypeScript_3_6_they_will_be_correctly_parsed_as_constructors_In_the_meantime_consider_using_constructor_to_write_a_constructor_or_constructor_to_write_a_method); + } if (checkGrammarForGenerator(node)) { return true; } @@ -59838,14 +60740,14 @@ var ts; if (node.flags & 4194304 /* 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 === 156 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 157 /* 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 === 241 /* InterfaceDeclaration */) { + else if (node.parent.kind === 242 /* 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 === 168 /* TypeLiteral */) { + else if (node.parent.kind === 169 /* 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); } } @@ -59856,11 +60758,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 233 /* LabeledStatement */: + case 234 /* 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 === 228 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 229 /* 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); @@ -59868,8 +60770,8 @@ var ts; return false; } break; - case 232 /* SwitchStatement */: - if (node.kind === 229 /* BreakStatement */ && !node.label) { + case 233 /* SwitchStatement */: + if (node.kind === 230 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -59884,13 +60786,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 229 /* BreakStatement */ + var message = node.kind === 230 /* 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 === 229 /* BreakStatement */ + var message = node.kind === 230 /* 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); @@ -59914,12 +60816,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 10 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 202 /* PrefixUnaryExpression */ && expr.operator === 39 /* MinusToken */ && + expr.kind === 203 /* PrefixUnaryExpression */ && expr.operator === 39 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 202 /* PrefixUnaryExpression */ && expr.operator === 39 /* MinusToken */ && + expr.kind === 203 /* PrefixUnaryExpression */ && expr.operator === 39 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -59932,7 +60834,7 @@ var ts; if (initializer) { var isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) || isSimpleLiteralEnumReference(initializer) || - initializer.kind === 102 /* TrueKeyword */ || initializer.kind === 87 /* FalseKeyword */ || + initializer.kind === 103 /* TrueKeyword */ || initializer.kind === 88 /* FalseKeyword */ || isBigIntLiteralExpression(initializer)); var isConstOrReadonly = ts.isDeclarationReadonly(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node); if (isConstOrReadonly && !node.type) { @@ -59949,7 +60851,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 226 /* ForInStatement */ && node.parent.parent.kind !== 227 /* ForOfStatement */) { + if (node.parent.parent.kind !== 227 /* ForInStatement */ && node.parent.parent.kind !== 228 /* ForOfStatement */) { if (node.flags & 4194304 /* Ambient */) { checkAmbientInitializer(node); } @@ -59962,8 +60864,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 219 /* VariableStatement */ || !node.type || node.initializer || node.flags & 4194304 /* Ambient */)) { - return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); + if (node.exclamationToken && (node.parent.parent.kind !== 220 /* VariableStatement */ || !node.type || node.initializer || node.flags & 4194304 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && !(node.parent.parent.flags & 4194304 /* Ambient */) && ts.hasModifier(node.parent.parent, 1 /* Export */)) { @@ -59979,7 +60881,7 @@ var ts; return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); } function checkESModuleMarker(name) { - if (name.kind === 72 /* Identifier */) { + if (name.kind === 73 /* Identifier */) { if (ts.idText(name) === "__esModule") { return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); } @@ -59996,8 +60898,8 @@ var ts; return false; } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 72 /* Identifier */) { - if (name.originalKeywordKind === 111 /* LetKeyword */) { + if (name.kind === 73 /* Identifier */) { + if (name.originalKeywordKind === 112 /* LetKeyword */) { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } @@ -60024,15 +60926,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 222 /* IfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 231 /* WithStatement */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 223 /* IfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 232 /* WithStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: return false; - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -60050,12 +60952,12 @@ var ts; function checkGrammarMetaProperty(node) { var escapedText = node.name.escapedText; switch (node.keywordToken) { - case 95 /* NewKeyword */: + case 96 /* NewKeyword */: if (escapedText !== "target") { return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "target"); } break; - case 92 /* ImportKeyword */: + case 93 /* ImportKeyword */: if (escapedText !== "meta") { return grammarErrorOnNode(node.name, ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts.tokenToString(node.keywordToken), "meta"); } @@ -60106,11 +61008,14 @@ var ts; } function checkGrammarProperty(node) { if (ts.isClassLike(node.parent)) { + if (ts.isStringLiteral(node.name) && node.name.text === "constructor") { + return grammarErrorOnNode(node.name, ts.Diagnostics.Classes_may_not_have_a_field_named_constructor); + } if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } } - else if (node.parent.kind === 241 /* InterfaceDeclaration */) { + else if (node.parent.kind === 242 /* 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; } @@ -60118,7 +61023,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 168 /* TypeLiteral */) { + else if (node.parent.kind === 169 /* 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; } @@ -60147,22 +61052,22 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 241 /* InterfaceDeclaration */ || - node.kind === 242 /* TypeAliasDeclaration */ || - node.kind === 249 /* ImportDeclaration */ || - node.kind === 248 /* ImportEqualsDeclaration */ || - node.kind === 255 /* ExportDeclaration */ || - node.kind === 254 /* ExportAssignment */ || - node.kind === 247 /* NamespaceExportDeclaration */ || + if (node.kind === 242 /* InterfaceDeclaration */ || + node.kind === 243 /* TypeAliasDeclaration */ || + node.kind === 250 /* ImportDeclaration */ || + node.kind === 249 /* ImportEqualsDeclaration */ || + node.kind === 256 /* ExportDeclaration */ || + node.kind === 255 /* ExportAssignment */ || + node.kind === 248 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } - return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + return grammarErrorOnFirstToken(node, ts.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 219 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 220 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -60189,7 +61094,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 === 218 /* Block */ || node.parent.kind === 245 /* ModuleBlock */ || node.parent.kind === 284 /* SourceFile */) { + if (node.parent.kind === 219 /* Block */ || node.parent.kind === 246 /* ModuleBlock */ || node.parent.kind === 285 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -60211,10 +61116,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, 182 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 183 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 278 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 279 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -60229,7 +61134,7 @@ var ts; var literalType = ts.isLiteralTypeNode(node.parent) || ts.isPrefixUnaryExpression(node.parent) && ts.isLiteralTypeNode(node.parent.parent); if (!literalType) { - if (languageVersion < 7 /* ESNext */) { + if (languageVersion < 8 /* ESNext */) { if (grammarErrorOnNode(node, ts.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ESNext)) { return true; } @@ -60282,8 +61187,8 @@ var ts; /** 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 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -60291,14 +61196,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 250 /* ImportClause */: // For default import - case 248 /* ImportEqualsDeclaration */: - case 251 /* NamespaceImport */: - case 253 /* ImportSpecifier */: // For rename import `x as y` + case 251 /* ImportClause */: // For default import + case 249 /* ImportEqualsDeclaration */: + case 252 /* NamespaceImport */: + case 254 /* ImportSpecifier */: // For rename import `x as y` return true; - case 72 /* Identifier */: + case 73 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 253 /* ImportSpecifier */; + return decl.parent.kind === 254 /* ImportSpecifier */; default: return false; } @@ -60426,7 +61331,7 @@ var ts; return node; } function createIdentifier(text, typeArguments) { - var node = createSynthesizedNode(72 /* Identifier */); + var node = createSynthesizedNode(73 /* Identifier */); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; node.autoGenerateFlags = 0 /* None */; @@ -60507,23 +61412,23 @@ var ts; ts.createToken = createToken; // Reserved words function createSuper() { - return createSynthesizedNode(98 /* SuperKeyword */); + return createSynthesizedNode(99 /* SuperKeyword */); } ts.createSuper = createSuper; function createThis() { - return createSynthesizedNode(100 /* ThisKeyword */); + return createSynthesizedNode(101 /* ThisKeyword */); } ts.createThis = createThis; function createNull() { - return createSynthesizedNode(96 /* NullKeyword */); + return createSynthesizedNode(97 /* NullKeyword */); } ts.createNull = createNull; function createTrue() { - return createSynthesizedNode(102 /* TrueKeyword */); + return createSynthesizedNode(103 /* TrueKeyword */); } ts.createTrue = createTrue; function createFalse() { - return createSynthesizedNode(87 /* FalseKeyword */); + return createSynthesizedNode(88 /* FalseKeyword */); } ts.createFalse = createFalse; // Modifiers @@ -60534,44 +61439,44 @@ var ts; function createModifiersFromModifierFlags(flags) { var result = []; if (flags & 1 /* Export */) { - result.push(createModifier(85 /* ExportKeyword */)); + result.push(createModifier(86 /* ExportKeyword */)); } if (flags & 2 /* Ambient */) { - result.push(createModifier(125 /* DeclareKeyword */)); + result.push(createModifier(126 /* DeclareKeyword */)); } if (flags & 512 /* Default */) { - result.push(createModifier(80 /* DefaultKeyword */)); + result.push(createModifier(81 /* DefaultKeyword */)); } if (flags & 2048 /* Const */) { - result.push(createModifier(77 /* ConstKeyword */)); + result.push(createModifier(78 /* ConstKeyword */)); } if (flags & 4 /* Public */) { - result.push(createModifier(115 /* PublicKeyword */)); + result.push(createModifier(116 /* PublicKeyword */)); } if (flags & 8 /* Private */) { - result.push(createModifier(113 /* PrivateKeyword */)); + result.push(createModifier(114 /* PrivateKeyword */)); } if (flags & 16 /* Protected */) { - result.push(createModifier(114 /* ProtectedKeyword */)); + result.push(createModifier(115 /* ProtectedKeyword */)); } if (flags & 128 /* Abstract */) { - result.push(createModifier(118 /* AbstractKeyword */)); + result.push(createModifier(119 /* AbstractKeyword */)); } if (flags & 32 /* Static */) { - result.push(createModifier(116 /* StaticKeyword */)); + result.push(createModifier(117 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(133 /* ReadonlyKeyword */)); + result.push(createModifier(134 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { - result.push(createModifier(121 /* AsyncKeyword */)); + result.push(createModifier(122 /* AsyncKeyword */)); } return result; } ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(148 /* QualifiedName */); + var node = createSynthesizedNode(149 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -60590,7 +61495,7 @@ var ts; : expression; } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(149 /* ComputedPropertyName */); + var node = createSynthesizedNode(150 /* ComputedPropertyName */); node.expression = parenthesizeForComputedName(expression); return node; } @@ -60603,7 +61508,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(150 /* TypeParameter */); + var node = createSynthesizedNode(151 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -60619,7 +61524,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(151 /* Parameter */); + var node = createSynthesizedNode(152 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -60643,7 +61548,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(152 /* Decorator */); + var node = createSynthesizedNode(153 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -60656,7 +61561,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(153 /* PropertySignature */); + var node = createSynthesizedNode(154 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -60676,7 +61581,7 @@ var ts; } ts.updatePropertySignature = updatePropertySignature; function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createSynthesizedNode(154 /* PropertyDeclaration */); + var node = createSynthesizedNode(155 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -60700,7 +61605,7 @@ var ts; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(155 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(156 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -60717,7 +61622,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(156 /* MethodDeclaration */); + var node = createSynthesizedNode(157 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -60745,7 +61650,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(157 /* Constructor */); + var node = createSynthesizedNode(158 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -60765,7 +61670,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(158 /* GetAccessor */); + var node = createSynthesizedNode(159 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -60788,7 +61693,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(159 /* SetAccessor */); + var node = createSynthesizedNode(160 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -60809,7 +61714,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(160 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(161 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -60817,7 +61722,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -60825,7 +61730,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(162 /* IndexSignature */); + var node = createSynthesizedNode(163 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -60865,7 +61770,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(163 /* TypePredicate */); + var node = createSynthesizedNode(164 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -60879,7 +61784,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(164 /* TypeReference */); + var node = createSynthesizedNode(165 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -60893,7 +61798,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(165 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(166 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -60901,7 +61806,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(166 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(167 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -60909,7 +61814,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(167 /* TypeQuery */); + var node = createSynthesizedNode(168 /* TypeQuery */); node.exprName = exprName; return node; } @@ -60921,7 +61826,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(168 /* TypeLiteral */); + var node = createSynthesizedNode(169 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -60933,7 +61838,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(169 /* ArrayType */); + var node = createSynthesizedNode(170 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -60945,7 +61850,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(170 /* TupleType */); + var node = createSynthesizedNode(171 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -60957,7 +61862,7 @@ var ts; } ts.updateTupleTypeNode = updateTupleTypeNode; function createOptionalTypeNode(type) { - var node = createSynthesizedNode(171 /* OptionalType */); + var node = createSynthesizedNode(172 /* OptionalType */); node.type = ts.parenthesizeArrayTypeMember(type); return node; } @@ -60969,7 +61874,7 @@ var ts; } ts.updateOptionalTypeNode = updateOptionalTypeNode; function createRestTypeNode(type) { - var node = createSynthesizedNode(172 /* RestType */); + var node = createSynthesizedNode(173 /* RestType */); node.type = type; return node; } @@ -60981,7 +61886,7 @@ var ts; } ts.updateRestTypeNode = updateRestTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(173 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(174 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -60989,7 +61894,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(174 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(175 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -61008,7 +61913,7 @@ var ts; : node; } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createSynthesizedNode(175 /* ConditionalType */); + var node = createSynthesizedNode(176 /* ConditionalType */); node.checkType = ts.parenthesizeConditionalTypeMember(checkType); node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); node.trueType = trueType; @@ -61026,7 +61931,7 @@ var ts; } ts.updateConditionalTypeNode = updateConditionalTypeNode; function createInferTypeNode(typeParameter) { - var node = createSynthesizedNode(176 /* InferType */); + var node = createSynthesizedNode(177 /* InferType */); node.typeParameter = typeParameter; return node; } @@ -61038,10 +61943,10 @@ var ts; } ts.updateInferTypeNode = updateInferTypeNode; function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { - var node = createSynthesizedNode(183 /* ImportType */); + var node = createSynthesizedNode(184 /* ImportType */); node.argument = argument; node.qualifier = qualifier; - node.typeArguments = asNodeArray(typeArguments); + node.typeArguments = ts.parenthesizeTypeParameters(typeArguments); node.isTypeOf = isTypeOf; return node; } @@ -61056,7 +61961,7 @@ var ts; } ts.updateImportTypeNode = updateImportTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(177 /* ParenthesizedType */); + var node = createSynthesizedNode(178 /* ParenthesizedType */); node.type = type; return node; } @@ -61068,12 +61973,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(178 /* ThisType */); + return createSynthesizedNode(179 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(179 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 129 /* KeyOfKeyword */; + var node = createSynthesizedNode(180 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 130 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -61083,7 +61988,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(180 /* IndexedAccessType */); + var node = createSynthesizedNode(181 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -61097,7 +62002,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(181 /* MappedType */); + var node = createSynthesizedNode(182 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -61115,7 +62020,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(182 /* LiteralType */); + var node = createSynthesizedNode(183 /* LiteralType */); node.literal = literal; return node; } @@ -61128,7 +62033,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(184 /* ObjectBindingPattern */); + var node = createSynthesizedNode(185 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -61140,7 +62045,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(185 /* ArrayBindingPattern */); + var node = createSynthesizedNode(186 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -61152,7 +62057,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(186 /* BindingElement */); + var node = createSynthesizedNode(187 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -61171,7 +62076,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(187 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(188 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -61185,7 +62090,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(188 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(189 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -61199,9 +62104,9 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(189 /* PropertyAccessExpression */); + var node = createSynthesizedNode(190 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); - node.name = asName(name); // TODO: GH#18217 + node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); return node; } @@ -61216,7 +62121,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(190 /* ElementAccessExpression */); + var node = createSynthesizedNode(191 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -61230,7 +62135,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(191 /* CallExpression */); + var node = createSynthesizedNode(192 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -61246,7 +62151,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(192 /* NewExpression */); + var node = createSynthesizedNode(193 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -61262,7 +62167,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) { - var node = createSynthesizedNode(193 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(194 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); if (template) { node.typeArguments = asNodeArray(typeArgumentsOrTemplate); @@ -61285,7 +62190,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(194 /* TypeAssertionExpression */); + var node = createSynthesizedNode(195 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -61299,7 +62204,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(195 /* ParenthesizedExpression */); + var node = createSynthesizedNode(196 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -61311,7 +62216,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(196 /* FunctionExpression */); + var node = createSynthesizedNode(197 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -61335,7 +62240,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(197 /* ArrowFunction */); + var node = createSynthesizedNode(198 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -61357,7 +62262,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(198 /* DeleteExpression */); + var node = createSynthesizedNode(199 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -61369,7 +62274,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(199 /* TypeOfExpression */); + var node = createSynthesizedNode(200 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -61381,7 +62286,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(200 /* VoidExpression */); + var node = createSynthesizedNode(201 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -61393,7 +62298,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(201 /* AwaitExpression */); + var node = createSynthesizedNode(202 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -61405,7 +62310,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(202 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(203 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -61418,7 +62323,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(203 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(204 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -61431,7 +62336,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(204 /* BinaryExpression */); + var node = createSynthesizedNode(205 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -61448,7 +62353,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(205 /* ConditionalExpression */); + var node = createSynthesizedNode(206 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(56 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -61468,7 +62373,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(206 /* TemplateExpression */); + var node = createSynthesizedNode(207 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -61506,7 +62411,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(207 /* YieldExpression */); + var node = createSynthesizedNode(208 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 40 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 40 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -61520,7 +62425,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(208 /* SpreadElement */); + var node = createSynthesizedNode(209 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -61532,7 +62437,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(209 /* ClassExpression */); + var node = createSynthesizedNode(210 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -61553,11 +62458,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(210 /* OmittedExpression */); + return createSynthesizedNode(211 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(211 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(212 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -61571,7 +62476,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(212 /* AsExpression */); + var node = createSynthesizedNode(213 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -61585,7 +62490,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(213 /* NonNullExpression */); + var node = createSynthesizedNode(214 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -61597,7 +62502,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(214 /* MetaProperty */); + var node = createSynthesizedNode(215 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -61611,7 +62516,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(216 /* TemplateSpan */); + var node = createSynthesizedNode(217 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -61625,12 +62530,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(217 /* SemicolonClassElement */); + return createSynthesizedNode(218 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(218 /* Block */); + var block = createSynthesizedNode(219 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -61644,7 +62549,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(219 /* VariableStatement */); + var node = createSynthesizedNode(220 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -61659,11 +62564,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(220 /* EmptyStatement */); + return createSynthesizedNode(221 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createExpressionStatement(expression) { - var node = createSynthesizedNode(221 /* ExpressionStatement */); + var node = createSynthesizedNode(222 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -61679,7 +62584,7 @@ var ts; /** @deprecated Use `updateExpressionStatement` instead. */ ts.updateStatement = updateExpressionStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(222 /* IfStatement */); + var node = createSynthesizedNode(223 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -61695,7 +62600,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(223 /* DoStatement */); + var node = createSynthesizedNode(224 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -61709,7 +62614,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(224 /* WhileStatement */); + var node = createSynthesizedNode(225 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -61723,7 +62628,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(225 /* ForStatement */); + var node = createSynthesizedNode(226 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -61741,7 +62646,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(226 /* ForInStatement */); + var node = createSynthesizedNode(227 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -61757,7 +62662,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(227 /* ForOfStatement */); + var node = createSynthesizedNode(228 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -61775,7 +62680,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(228 /* ContinueStatement */); + var node = createSynthesizedNode(229 /* ContinueStatement */); node.label = asName(label); return node; } @@ -61787,7 +62692,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(229 /* BreakStatement */); + var node = createSynthesizedNode(230 /* BreakStatement */); node.label = asName(label); return node; } @@ -61799,7 +62704,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(230 /* ReturnStatement */); + var node = createSynthesizedNode(231 /* ReturnStatement */); node.expression = expression; return node; } @@ -61811,7 +62716,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(231 /* WithStatement */); + var node = createSynthesizedNode(232 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -61825,7 +62730,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(232 /* SwitchStatement */); + var node = createSynthesizedNode(233 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -61839,7 +62744,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(233 /* LabeledStatement */); + var node = createSynthesizedNode(234 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -61853,7 +62758,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(234 /* ThrowStatement */); + var node = createSynthesizedNode(235 /* ThrowStatement */); node.expression = expression; return node; } @@ -61865,7 +62770,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(235 /* TryStatement */); + var node = createSynthesizedNode(236 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -61881,11 +62786,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(236 /* DebuggerStatement */); + return createSynthesizedNode(237 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(237 /* VariableDeclaration */); + var node = createSynthesizedNode(238 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -61902,7 +62807,7 @@ var ts; ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(238 /* VariableDeclarationList */); + var node = createSynthesizedNode(239 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -61915,7 +62820,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(239 /* FunctionDeclaration */); + var node = createSynthesizedNode(240 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -61941,7 +62846,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(240 /* ClassDeclaration */); + var node = createSynthesizedNode(241 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -61963,7 +62868,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(241 /* InterfaceDeclaration */); + var node = createSynthesizedNode(242 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -61985,7 +62890,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(242 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(243 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -62005,7 +62910,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(243 /* EnumDeclaration */); + var node = createSynthesizedNode(244 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -62024,7 +62929,7 @@ var ts; ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createSynthesizedNode(244 /* ModuleDeclaration */); + var node = createSynthesizedNode(245 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -62043,7 +62948,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(245 /* ModuleBlock */); + var node = createSynthesizedNode(246 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -62055,7 +62960,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(246 /* CaseBlock */); + var node = createSynthesizedNode(247 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -62067,7 +62972,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(247 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(248 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -62079,7 +62984,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(248 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(249 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -62097,7 +63002,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(249 /* ImportDeclaration */); + var node = createSynthesizedNode(250 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -62115,7 +63020,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(250 /* ImportClause */); + var node = createSynthesizedNode(251 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -62129,7 +63034,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(251 /* NamespaceImport */); + var node = createSynthesizedNode(252 /* NamespaceImport */); node.name = name; return node; } @@ -62141,7 +63046,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(252 /* NamedImports */); + var node = createSynthesizedNode(253 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -62153,7 +63058,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(253 /* ImportSpecifier */); + var node = createSynthesizedNode(254 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -62167,11 +63072,11 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(254 /* ExportAssignment */); + var node = createSynthesizedNode(255 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; - node.expression = isExportEquals ? ts.parenthesizeBinaryOperand(59 /* EqualsToken */, expression, /*isLeftSideOfBinary*/ false, /*leftOperand*/ undefined) : ts.parenthesizeDefaultExpression(expression); + node.expression = isExportEquals ? ts.parenthesizeBinaryOperand(60 /* EqualsToken */, expression, /*isLeftSideOfBinary*/ false, /*leftOperand*/ undefined) : ts.parenthesizeDefaultExpression(expression); return node; } ts.createExportAssignment = createExportAssignment; @@ -62184,7 +63089,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(255 /* ExportDeclaration */); + var node = createSynthesizedNode(256 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -62202,7 +63107,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(256 /* NamedExports */); + var node = createSynthesizedNode(257 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -62214,7 +63119,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(257 /* ExportSpecifier */); + var node = createSynthesizedNode(258 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -62229,7 +63134,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(259 /* ExternalModuleReference */); + var node = createSynthesizedNode(260 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -62243,14 +63148,14 @@ var ts; // JSDoc /* @internal */ function createJSDocTypeExpression(type) { - var node = createSynthesizedNode(288 /* JSDocTypeExpression */); + var node = createSynthesizedNode(289 /* JSDocTypeExpression */); node.type = type; return node; } ts.createJSDocTypeExpression = createJSDocTypeExpression; /* @internal */ function createJSDocTypeTag(typeExpression, comment) { - var tag = createJSDocTag(307 /* JSDocTypeTag */, "type"); + var tag = createJSDocTag(308 /* JSDocTypeTag */, "type"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -62258,7 +63163,7 @@ var ts; ts.createJSDocTypeTag = createJSDocTypeTag; /* @internal */ function createJSDocReturnTag(typeExpression, comment) { - var tag = createJSDocTag(305 /* JSDocReturnTag */, "returns"); + var tag = createJSDocTag(306 /* JSDocReturnTag */, "returns"); tag.typeExpression = typeExpression; tag.comment = comment; return tag; @@ -62266,7 +63171,7 @@ var ts; ts.createJSDocReturnTag = createJSDocReturnTag; /* @internal */ function createJSDocParamTag(name, isBracketed, typeExpression, comment) { - var tag = createJSDocTag(304 /* JSDocParameterTag */, "param"); + var tag = createJSDocTag(305 /* JSDocParameterTag */, "param"); tag.typeExpression = typeExpression; tag.name = name; tag.isBracketed = isBracketed; @@ -62276,7 +63181,7 @@ var ts; ts.createJSDocParamTag = createJSDocParamTag; /* @internal */ function createJSDocComment(comment, tags) { - var node = createSynthesizedNode(296 /* JSDocComment */); + var node = createSynthesizedNode(297 /* JSDocComment */); node.comment = comment; node.tags = tags; return node; @@ -62290,7 +63195,7 @@ var ts; } // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(260 /* JsxElement */); + var node = createSynthesizedNode(261 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -62306,7 +63211,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(261 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(262 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -62322,7 +63227,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createSynthesizedNode(262 /* JsxOpeningElement */); + var node = createSynthesizedNode(263 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -62338,7 +63243,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(263 /* JsxClosingElement */); + var node = createSynthesizedNode(264 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -62350,7 +63255,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(264 /* JsxFragment */); + var node = createSynthesizedNode(265 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -62372,11 +63277,11 @@ var ts; } ts.updateJsxText = updateJsxText; function createJsxOpeningFragment() { - return createSynthesizedNode(265 /* JsxOpeningFragment */); + return createSynthesizedNode(266 /* JsxOpeningFragment */); } ts.createJsxOpeningFragment = createJsxOpeningFragment; function createJsxJsxClosingFragment() { - return createSynthesizedNode(266 /* JsxClosingFragment */); + return createSynthesizedNode(267 /* JsxClosingFragment */); } ts.createJsxJsxClosingFragment = createJsxJsxClosingFragment; function updateJsxFragment(node, openingFragment, children, closingFragment) { @@ -62388,7 +63293,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(267 /* JsxAttribute */); + var node = createSynthesizedNode(268 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -62402,7 +63307,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(268 /* JsxAttributes */); + var node = createSynthesizedNode(269 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -62414,7 +63319,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(269 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(270 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -62426,7 +63331,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(270 /* JsxExpression */); + var node = createSynthesizedNode(271 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -62440,7 +63345,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(271 /* CaseClause */); + var node = createSynthesizedNode(272 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -62454,7 +63359,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(272 /* DefaultClause */); + var node = createSynthesizedNode(273 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -62466,7 +63371,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(273 /* HeritageClause */); + var node = createSynthesizedNode(274 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -62479,7 +63384,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(274 /* CatchClause */); + var node = createSynthesizedNode(275 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -62494,7 +63399,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(275 /* PropertyAssignment */); + var node = createSynthesizedNode(276 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = ts.parenthesizeExpressionForList(initializer); @@ -62509,7 +63414,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(276 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(277 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -62523,8 +63428,8 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(277 /* SpreadAssignment */); - node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; // TODO: GH#18217 + var node = createSynthesizedNode(278 /* SpreadAssignment */); + node.expression = ts.parenthesizeExpressionForList(expression); return node; } ts.createSpreadAssignment = createSpreadAssignment; @@ -62536,7 +63441,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(278 /* EnumMember */); + var node = createSynthesizedNode(279 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -62557,7 +63462,7 @@ var ts; (typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) || (libReferences !== undefined && node.libReferenceDirectives !== libReferences) || (hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) { - var updated = createSynthesizedNode(284 /* SourceFile */); + var updated = createSynthesizedNode(285 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -62641,7 +63546,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(312 /* NotEmittedStatement */); + var node = createSynthesizedNode(313 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -62653,7 +63558,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(316 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(317 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -62665,7 +63570,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(315 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(316 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -62680,7 +63585,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(313 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(314 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -62696,7 +63601,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 314 /* CommaListExpression */) { + if (node.kind === 315 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { @@ -62706,7 +63611,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(314 /* CommaListExpression */); + var node = createSynthesizedNode(315 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -62719,7 +63624,7 @@ var ts; ts.updateCommaList = updateCommaList; function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = ts.createNode(285 /* Bundle */); + var node = ts.createNode(286 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -62749,7 +63654,7 @@ var ts; ], function (helper) { return helper.name; })); } function createUnparsedSource() { - var node = ts.createNode(286 /* UnparsedSource */); + var node = ts.createNode(287 /* UnparsedSource */); node.prologues = ts.emptyArray; node.referencedFiles = ts.emptyArray; node.libReferenceDirectives = ts.emptyArray; @@ -62881,10 +63786,10 @@ var ts; } function mapBundleFileSectionKindToSyntaxKind(kind) { switch (kind) { - case "prologue" /* Prologue */: return 279 /* UnparsedPrologue */; - case "prepend" /* Prepend */: return 280 /* UnparsedPrepend */; - case "internal" /* Internal */: return 282 /* UnparsedInternalText */; - case "text" /* Text */: return 281 /* UnparsedText */; + case "prologue" /* Prologue */: return 280 /* UnparsedPrologue */; + case "prepend" /* Prepend */: return 281 /* UnparsedPrepend */; + case "internal" /* Internal */: return 283 /* UnparsedInternalText */; + case "text" /* Text */: return 282 /* UnparsedText */; case "emitHelpers" /* EmitHelpers */: case "no-default-lib" /* NoDefaultLib */: case "reference" /* Reference */: @@ -62902,14 +63807,14 @@ var ts; return node; } function createUnparsedSyntheticReference(section, parent) { - var node = ts.createNode(283 /* UnparsedSyntheticReference */, section.pos, section.end); + var node = ts.createNode(284 /* UnparsedSyntheticReference */, section.pos, section.end); node.parent = parent; node.data = section.data; node.section = section; return node; } function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { - var node = ts.createNode(287 /* InputFiles */); + var node = ts.createNode(288 /* InputFiles */); if (!ts.isString(javascriptTextOrReadFileText)) { var cache_1 = ts.createMap(); var textGetter_1 = function (path) { @@ -63003,7 +63908,7 @@ var ts; } ts.createLessThan = createLessThan; function createAssignment(left, right) { - return createBinary(left, 59 /* EqualsToken */, right); + return createBinary(left, 60 /* EqualsToken */, right); } ts.createAssignment = createAssignment; function createStrictEquality(left, right) { @@ -63096,7 +64001,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 === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node))); @@ -63607,7 +64512,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 233 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 234 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -63619,20 +64524,20 @@ var ts; function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { var target = ts.skipParentheses(node); switch (target.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return cacheIdentifiers; - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -63647,7 +64552,7 @@ var ts; thisArg = ts.createThis(); target = callee; } - else if (callee.kind === 98 /* SuperKeyword */) { + else if (callee.kind === 99 /* SuperKeyword */) { thisArg = ts.createThis(); target = languageVersion < 2 /* ES2015 */ ? ts.setTextRange(ts.createIdentifier("_super"), callee) @@ -63659,7 +64564,7 @@ var ts; } else { switch (callee.kind) { - case 189 /* PropertyAccessExpression */: { + case 190 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -63672,7 +64577,7 @@ var ts; } break; } - case 190 /* ElementAccessExpression */: { + case 191 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -63729,14 +64634,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine); - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -63744,7 +64649,7 @@ var ts; function createExpressionForAccessorDeclaration(properties, property, receiver, multiLine) { var _a = ts.getAllAccessorDeclarations(properties, property), firstAccessor = _a.firstAccessor, getAccessor = _a.getAccessor, setAccessor = _a.setAccessor; if (property === firstAccessor) { - var properties_8 = []; + var properties_5 = []; if (getAccessor) { var getterFunction = ts.createFunctionExpression(getAccessor.modifiers, /*asteriskToken*/ undefined, @@ -63755,7 +64660,7 @@ var ts; ts.setTextRange(getterFunction, getAccessor); ts.setOriginalNode(getterFunction, getAccessor); var getter = ts.createPropertyAssignment("get", getterFunction); - properties_8.push(getter); + properties_5.push(getter); } if (setAccessor) { var setterFunction = ts.createFunctionExpression(setAccessor.modifiers, @@ -63767,15 +64672,15 @@ var ts; ts.setTextRange(setterFunction, setAccessor); ts.setOriginalNode(setterFunction, setAccessor); var setter = ts.createPropertyAssignment("set", setterFunction); - properties_8.push(setter); + properties_5.push(setter); } - properties_8.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); - properties_8.push(ts.createPropertyAssignment("configurable", ts.createTrue())); + properties_5.push(ts.createPropertyAssignment("enumerable", ts.createTrue())); + properties_5.push(ts.createPropertyAssignment("configurable", ts.createTrue())); var expression = ts.setTextRange(ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Object"), "defineProperty"), /*typeArguments*/ undefined, [ receiver, createExpressionForPropertyName(property.name), - ts.createObjectLiteral(properties_8, multiLine) + ts.createObjectLiteral(properties_5, multiLine) ]), /*location*/ firstAccessor); return ts.aggregateTransformFlags(expression); @@ -64062,7 +64967,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 === 195 /* ParenthesizedExpression */) { + if (skipped.kind === 196 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -64096,10 +65001,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(204 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(204 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(205 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(205 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 197 /* ArrowFunction */ && binaryOperatorPrecedence > 4) { + if (!isLeftSideOfBinary && operand.kind === 198 /* ArrowFunction */ && binaryOperatorPrecedence > 4) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -64111,7 +65016,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 207 /* YieldExpression */) { + && operand.kind === 208 /* YieldExpression */) { return false; } return true; @@ -64199,7 +65104,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 204 /* BinaryExpression */ && node.operatorToken.kind === 38 /* PlusToken */) { + if (node.kind === 205 /* BinaryExpression */ && node.operatorToken.kind === 38 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -64214,7 +65119,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(205 /* ConditionalExpression */, 56 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(206 /* ConditionalExpression */, 56 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -64249,8 +65154,8 @@ var ts; var needsParens = isCommaSequence(check); if (!needsParens) { switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 209 /* ClassExpression */: - case 196 /* FunctionExpression */: + case 210 /* ClassExpression */: + case 197 /* FunctionExpression */: needsParens = true; } } @@ -64266,9 +65171,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 191 /* CallExpression */: + case 192 /* CallExpression */: return ts.createParen(expression); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -64291,7 +65196,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 192 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 193 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -64329,7 +65234,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(204 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(205 /* BinaryExpression */, 27 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -64340,29 +65245,29 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 196 /* FunctionExpression */ || kind === 197 /* ArrowFunction */) { + if (kind === 197 /* FunctionExpression */ || kind === 198 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 188 /* ObjectLiteralExpression */ || leftmostExpressionKind === 196 /* FunctionExpression */) { + if (leftmostExpressionKind === 189 /* ObjectLiteralExpression */ || leftmostExpressionKind === 197 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; function parenthesizeConditionalTypeMember(member) { - return member.kind === 175 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + return member.kind === 176 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; } ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 173 /* UnionType */: - case 174 /* IntersectionType */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: return ts.createParenthesizedType(member); } return parenthesizeConditionalTypeMember(member); @@ -64370,9 +65275,9 @@ var ts; ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 167 /* TypeQuery */: - case 179 /* TypeOperator */: - case 176 /* InferType */: + case 168 /* TypeQuery */: + case 180 /* TypeOperator */: + case 177 /* InferType */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -64398,28 +65303,28 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: node = node.operand; continue; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: node = node.left; continue; - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: node = node.condition; continue; - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: node = node.tag; continue; - case 191 /* CallExpression */: + case 192 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 212 /* AsExpression */: - case 190 /* ElementAccessExpression */: - case 189 /* PropertyAccessExpression */: - case 213 /* NonNullExpression */: - case 313 /* PartiallyEmittedExpression */: + case 213 /* AsExpression */: + case 191 /* ElementAccessExpression */: + case 190 /* PropertyAccessExpression */: + case 214 /* NonNullExpression */: + case 314 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -64427,15 +65332,15 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 188 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 189 /* ObjectLiteralExpression */)) { return ts.setTextRange(ts.createParen(body), body); } return body; } ts.parenthesizeConciseBody = parenthesizeConciseBody; function isCommaSequence(node) { - return node.kind === 204 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 314 /* CommaListExpression */; + return node.kind === 205 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 315 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; var OuterExpressionKinds; @@ -64448,13 +65353,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: - case 213 /* NonNullExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: + case 214 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 313 /* PartiallyEmittedExpression */: + case 314 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -64479,7 +65384,7 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 213 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 214 /* NonNullExpression */) { node = node.expression; } return node; @@ -64487,11 +65392,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 195 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 194 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 212 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 213 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 313 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 196 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 195 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 213 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 214 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 314 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -64509,7 +65414,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 195 /* ParenthesizedExpression */ + return node.kind === 196 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -64574,10 +65479,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 249 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 250 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 255 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 256 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -64696,7 +65601,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -64708,11 +65613,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -64744,12 +65649,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 151 /* Parameter */: - case 186 /* BindingElement */: + case 152 /* Parameter */: + case 187 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 208 /* SpreadElement */: - case 277 /* SpreadAssignment */: + case 209 /* SpreadElement */: + case 278 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -64761,7 +65666,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 186 /* BindingElement */: + case 187 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -64773,7 +65678,7 @@ var ts; : propertyName; } break; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -64785,7 +65690,7 @@ var ts; : propertyName; } break; - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -64808,13 +65713,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: - case 187 /* ArrayLiteralExpression */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: + case 188 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -64854,11 +65759,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 185 /* ArrayBindingPattern */: - case 187 /* ArrayLiteralExpression */: + case 186 /* ArrayBindingPattern */: + case 188 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 184 /* ObjectBindingPattern */: - case 188 /* ObjectLiteralExpression */: + case 185 /* ObjectBindingPattern */: + case 189 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -65019,276 +65924,278 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 147 /* LastToken */) || kind === 178 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 148 /* LastToken */) || kind === 179 /* ThisType */) { return node; } switch (kind) { // Names - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 151 /* Parameter */: + case 152 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 152 /* Decorator */: + case 153 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 153 /* PropertySignature */: + case 154 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 154 /* PropertyDeclaration */: - return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 155 /* MethodSignature */: + case 155 /* PropertyDeclaration */: + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), + // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too + visitNode(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + case 156 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 157 /* Constructor */: + case 158 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 160 /* CallSignature */: + case 161 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 161 /* ConstructSignature */: + case 162 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 165 /* FunctionType */: + case 166 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 166 /* ConstructorType */: + case 167 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 169 /* ArrayType */: + case 170 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 170 /* TupleType */: + case 171 /* TupleType */: return ts.updateTupleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 171 /* OptionalType */: + case 172 /* OptionalType */: return ts.updateOptionalTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* RestType */: + case 173 /* RestType */: return ts.updateRestTypeNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 173 /* UnionType */: + case 174 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 174 /* IntersectionType */: + case 175 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); - case 176 /* InferType */: + case 177 /* InferType */: return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 183 /* ImportType */: + case 184 /* ImportType */: return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 177 /* ParenthesizedType */: + case 178 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 179 /* TypeOperator */: + case 180 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 181 /* MappedType */: + case 182 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 182 /* LiteralType */: + case 183 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 184 /* ObjectBindingPattern */: + case 185 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 185 /* ArrayBindingPattern */: + case 186 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* TypeOfExpression */: + case 200 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* VoidExpression */: + case 201 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* AsExpression */: + case 213 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* MetaProperty */: + case 215 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 218 /* Block */: + case 219 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return ts.updateExpressionStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 222 /* IfStatement */: + case 223 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 228 /* ContinueStatement */: + case 229 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 229 /* BreakStatement */: + case 230 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 250 /* ImportClause */: + case 251 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 252 /* NamedImports */: + case 253 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 256 /* NamedExports */: + case 257 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 257 /* ExportSpecifier */: + case 258 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 259 /* ExternalModuleReference */: + case 260 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 260 /* JsxElement */: + case 261 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 262 /* JsxOpeningElement */: + case 263 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 263 /* JsxClosingElement */: + case 264 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 269 /* JsxSpreadAttribute */: + case 270 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 271 /* CaseClause */: + case 272 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 272 /* DefaultClause */: + case 273 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 278 /* EnumMember */: + case 279 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 284 /* SourceFile */: + case 285 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 313 /* PartiallyEmittedExpression */: + case 314 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 314 /* CommaListExpression */: + case 315 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -65330,58 +66237,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 147 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 148 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 163 /* TypePredicate */ && kind <= 182 /* LiteralType */)) { + if ((kind >= 164 /* TypePredicate */ && kind <= 183 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 217 /* SemicolonClassElement */: - case 220 /* EmptyStatement */: - case 210 /* OmittedExpression */: - case 236 /* DebuggerStatement */: - case 312 /* NotEmittedStatement */: + case 218 /* SemicolonClassElement */: + case 221 /* EmptyStatement */: + case 211 /* OmittedExpression */: + case 237 /* DebuggerStatement */: + case 313 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 151 /* Parameter */: + case 152 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* Decorator */: + case 153 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 153 /* PropertySignature */: + case 154 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -65390,12 +66297,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 157 /* Constructor */: + case 158 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -65403,7 +66310,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -65411,50 +66318,50 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 186 /* BindingElement */: + case 187 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 191 /* CallExpression */: + case 192 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 192 /* NewExpression */: + case 193 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNode(node.template, cbNode, result); break; - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -65462,123 +66369,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 195 /* ParenthesizedExpression */: - case 198 /* DeleteExpression */: - case 199 /* TypeOfExpression */: - case 200 /* VoidExpression */: - case 201 /* AwaitExpression */: - case 207 /* YieldExpression */: - case 208 /* SpreadElement */: - case 213 /* NonNullExpression */: + case 196 /* ParenthesizedExpression */: + case 199 /* DeleteExpression */: + case 200 /* TypeOfExpression */: + case 201 /* VoidExpression */: + case 202 /* AwaitExpression */: + case 208 /* YieldExpression */: + case 209 /* SpreadElement */: + case 214 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 212 /* AsExpression */: + case 213 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 218 /* Block */: + case 219 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* IfStatement */: + case 223 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 223 /* DoStatement */: + case 224 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 224 /* WhileStatement */: - case 231 /* WithStatement */: + case 225 /* WhileStatement */: + case 232 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* ForStatement */: + case 226 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 230 /* ReturnStatement */: - case 234 /* ThrowStatement */: + case 231 /* ReturnStatement */: + case 235 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 235 /* TryStatement */: + case 236 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -65587,7 +66494,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -65595,140 +66502,140 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 250 /* ImportClause */: + case 251 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 252 /* NamedImports */: - case 256 /* NamedExports */: + case 253 /* NamedImports */: + case 257 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 259 /* ExternalModuleReference */: + case 260 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 260 /* JsxElement */: + case 261 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 261 /* JsxSelfClosingElement */: - case 262 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNodes(node.typeArguments, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 263 /* JsxClosingElement */: + case 264 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 269 /* JsxSpreadAttribute */: + case 270 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 271 /* CaseClause */: + case 272 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 272 /* DefaultClause */: + case 273 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 274 /* CatchClause */: + case 275 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 278 /* EnumMember */: + case 279 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 284 /* SourceFile */: + case 285 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 313 /* PartiallyEmittedExpression */: + case 314 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 314 /* CommaListExpression */: + case 315 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -65752,7 +66659,7 @@ var ts; * @param nodes The NodeArray. */ function liftToBlock(nodes) { - Debug.assert(ts.every(nodes, ts.isStatement), "Cannot lift nodes to a Block."); + ts.Debug.assert(ts.every(nodes, ts.isStatement), "Cannot lift nodes to a Block."); return ts.singleOrUndefined(nodes) || ts.createBlock(nodes); } ts.liftToBlock = liftToBlock; @@ -65801,7 +66708,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 211 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 212 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -65817,73 +66724,6 @@ var ts; function aggregateTransformFlagsForChildNodes(transformFlags, nodes) { return transformFlags | aggregateTransformFlagsForNodeArray(nodes); } - var Debug; - (function (Debug) { - var isDebugInfoEnabled = false; - function failBadSyntaxKind(node, message) { - return Debug.fail((message || "Unexpected node.") + "\r\nNode " + ts.formatSyntaxKind(node.kind) + " was unexpected.", failBadSyntaxKind); - } - Debug.failBadSyntaxKind = failBadSyntaxKind; - Debug.assertEachNode = Debug.shouldAssert(1 /* Normal */) - ? function (nodes, test, message) { return Debug.assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + Debug.getFunctionName(test) + "'."; }, Debug.assertEachNode); } - : ts.noop; - Debug.assertNode = Debug.shouldAssert(1 /* Normal */) - ? function (node, test, message) { return Debug.assert(test === undefined || test(node), message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " did not pass test '" + Debug.getFunctionName(test) + "'."; }, Debug.assertNode); } - : ts.noop; - Debug.assertOptionalNode = Debug.shouldAssert(1 /* Normal */) - ? function (node, test, message) { return Debug.assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " did not pass test '" + Debug.getFunctionName(test) + "'."; }, Debug.assertOptionalNode); } - : ts.noop; - Debug.assertOptionalToken = Debug.shouldAssert(1 /* Normal */) - ? function (node, kind, message) { return Debug.assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was not a '" + ts.formatSyntaxKind(kind) + "' token."; }, Debug.assertOptionalToken); } - : ts.noop; - Debug.assertMissingNode = Debug.shouldAssert(1 /* Normal */) - ? function (node, message) { return Debug.assert(node === undefined, message || "Unexpected node.", function () { return "Node " + ts.formatSyntaxKind(node.kind) + " was unexpected'."; }, Debug.assertMissingNode); } - : ts.noop; - /** - * Injects debug information into frequently used types. - */ - function enableDebugInfo() { - if (isDebugInfoEnabled) - return; - // Add additional properties in debug mode to assist with debugging. - Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - __debugFlags: { get: function () { return ts.formatSymbolFlags(this.flags); } } - }); - Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - __debugFlags: { get: function () { return ts.formatTypeFlags(this.flags); } }, - __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? ts.formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, - }); - var nodeConstructors = [ - ts.objectAllocator.getNodeConstructor(), - ts.objectAllocator.getIdentifierConstructor(), - ts.objectAllocator.getTokenConstructor(), - ts.objectAllocator.getSourceFileConstructor() - ]; - for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) { - var ctor = nodeConstructors_1[_i]; - if (!ctor.prototype.hasOwnProperty("__debugKind")) { - Object.defineProperties(ctor.prototype, { - __debugKind: { get: function () { return ts.formatSyntaxKind(this.kind); } }, - __debugModifierFlags: { get: function () { return ts.formatModifierFlags(ts.getModifierFlagsNoCache(this)); } }, - __debugTransformFlags: { get: function () { return ts.formatTransformFlags(this.transformFlags); } }, - __debugEmitFlags: { get: function () { return ts.formatEmitFlags(ts.getEmitFlags(this)); } }, - __debugGetText: { - value: function (includeTrivia) { - if (ts.nodeIsSynthesized(this)) - return ""; - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - } - } - }); - } - } - isDebugInfoEnabled = true; - } - Debug.enableDebugInfo = enableDebugInfo; - })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); /* @internal */ var ts; @@ -66541,7 +67381,7 @@ var ts; function chainBundle(transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 284 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 285 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -66587,7 +67427,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -66595,13 +67435,13 @@ var ts; externalImports.push(node); hasImportStarOrImportDefault = hasImportStarOrImportDefault || getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 248 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 259 /* ExternalModuleReference */) { + case 249 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 260 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -66631,13 +67471,13 @@ var ts; } } break; - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -66645,7 +67485,7 @@ var ts; } } break; - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -66665,7 +67505,7 @@ var ts; } } break; - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -67205,7 +68045,7 @@ var ts; ts.restHelper = { name: "typescript:rest", scoped: false, - text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\n t[p[i]] = s[p[i]];\n return t;\n };" + text: "\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };" }; /** Given value: o, propName: p, pattern: { a, b, ...p } from the original statement * `{ a, b, ...p } = o`, create `p = __rest(o, ["a", "b"]);` @@ -67281,8 +68121,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(189 /* PropertyAccessExpression */); - context.enableSubstitution(190 /* ElementAccessExpression */); + context.enableSubstitution(190 /* PropertyAccessExpression */); + context.enableSubstitution(191 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -67312,14 +68152,14 @@ var ts; var pendingExpressions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 285 /* Bundle */) { + if (node.kind === 286 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return ts.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 287 /* InputFiles */) { + if (prepend.kind === 288 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -67368,16 +68208,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 284 /* SourceFile */: - case 246 /* CaseBlock */: - case 245 /* ModuleBlock */: - case 218 /* Block */: + case 285 /* SourceFile */: + case 247 /* CaseBlock */: + case 246 /* ModuleBlock */: + case 219 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 240 /* ClassDeclaration */: - case 239 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 240 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -67389,7 +68229,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 === 240 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 241 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -67432,10 +68272,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 254 /* ExportAssignment */: - case 255 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 255 /* ExportAssignment */: + case 256 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -67456,13 +68296,13 @@ var ts; return node; } switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return visitImportDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return visitExportAssignment(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -67482,11 +68322,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 255 /* ExportDeclaration */ || - node.kind === 249 /* ImportDeclaration */ || - node.kind === 250 /* ImportClause */ || - (node.kind === 248 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 259 /* ExternalModuleReference */)) { + if (node.kind === 256 /* ExportDeclaration */ || + node.kind === 250 /* ImportDeclaration */ || + node.kind === 251 /* ImportClause */ || + (node.kind === 249 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 260 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -67510,19 +68350,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 157 /* Constructor */: + case 158 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 154 /* PropertyDeclaration */: - case 162 /* IndexSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 156 /* MethodDeclaration */: + case 155 /* PropertyDeclaration */: + case 163 /* IndexSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 157 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 217 /* SemicolonClassElement */: + case 218 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -67532,7 +68372,7 @@ var ts; if (ts.modifierToFlag(node.kind) & 2270 /* TypeScriptModifier */) { return undefined; } - else if (currentNamespace && node.kind === 85 /* ExportKeyword */) { + else if (currentNamespace && node.kind === 86 /* ExportKeyword */) { return undefined; } return node; @@ -67549,67 +68389,67 @@ var ts; return ts.createNotEmittedStatement(node); } switch (node.kind) { - case 85 /* ExportKeyword */: - case 80 /* DefaultKeyword */: + case 86 /* ExportKeyword */: + case 81 /* DefaultKeyword */: // ES6 export and default modifiers are elided when inside a namespace. return currentNamespace ? undefined : node; - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 118 /* AbstractKeyword */: - case 77 /* ConstKeyword */: - case 125 /* DeclareKeyword */: - case 133 /* ReadonlyKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 119 /* AbstractKeyword */: + case 78 /* ConstKeyword */: + case 126 /* DeclareKeyword */: + case 134 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 169 /* ArrayType */: - case 170 /* TupleType */: - case 171 /* OptionalType */: - case 172 /* RestType */: - case 168 /* TypeLiteral */: - case 163 /* TypePredicate */: - case 150 /* TypeParameter */: - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 123 /* BooleanKeyword */: - case 138 /* StringKeyword */: - case 135 /* NumberKeyword */: - case 132 /* NeverKeyword */: - case 106 /* VoidKeyword */: - case 139 /* SymbolKeyword */: - case 166 /* ConstructorType */: - case 165 /* FunctionType */: - case 167 /* TypeQuery */: - case 164 /* TypeReference */: - case 173 /* UnionType */: - case 174 /* IntersectionType */: - case 175 /* ConditionalType */: - case 177 /* ParenthesizedType */: - case 178 /* ThisType */: - case 179 /* TypeOperator */: - case 180 /* IndexedAccessType */: - case 181 /* MappedType */: - case 182 /* LiteralType */: + case 170 /* ArrayType */: + case 171 /* TupleType */: + case 172 /* OptionalType */: + case 173 /* RestType */: + case 169 /* TypeLiteral */: + case 164 /* TypePredicate */: + case 151 /* TypeParameter */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 124 /* BooleanKeyword */: + case 139 /* StringKeyword */: + case 136 /* NumberKeyword */: + case 133 /* NeverKeyword */: + case 107 /* VoidKeyword */: + case 140 /* SymbolKeyword */: + case 167 /* ConstructorType */: + case 166 /* FunctionType */: + case 168 /* TypeQuery */: + case 165 /* TypeReference */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: + case 176 /* ConditionalType */: + case 178 /* ParenthesizedType */: + case 179 /* ThisType */: + case 180 /* TypeOperator */: + case 181 /* IndexedAccessType */: + case 182 /* MappedType */: + case 183 /* LiteralType */: // TypeScript type nodes are elided. - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: // TypeScript index signatures are elided. - case 152 /* Decorator */: + case 153 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 154 /* PropertyDeclaration */: + case 155 /* 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 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 157 /* Constructor */: + case 158 /* Constructor */: return visitConstructor(node); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -67620,7 +68460,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -67631,35 +68471,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 151 /* Parameter */: + case 152 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -67669,35 +68509,35 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 194 /* TypeAssertionExpression */: - case 212 /* AsExpression */: + case 195 /* TypeAssertionExpression */: + case 213 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return visitCallExpression(node); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return visitNewExpression(node); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -67735,7 +68575,7 @@ var ts; if (ts.some(staticProperties)) facts |= 1 /* HasStaticInitializedProperties */; var extendsClauseElement = ts.getEffectiveBaseTypeNode(node); - if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 96 /* NullKeyword */) + if (extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 97 /* NullKeyword */) facts |= 64 /* IsDerivedClass */; if (shouldEmitDecorateCallForClass(node)) facts |= 2 /* HasConstructorDecorators */; @@ -68001,7 +68841,7 @@ var ts; pendingExpressions = undefined; var staticProperties = getInitializedProperties(node, /*isStatic*/ true); var heritageClauses = ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause); - var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 86 /* ExtendsKeyword */; })); + var members = transformClassMembers(node, ts.some(heritageClauses, function (c) { return c.token === 87 /* ExtendsKeyword */; })); var classExpression = ts.createClassExpression( /*modifiers*/ undefined, node.name, /*typeParameters*/ undefined, heritageClauses, members); @@ -68177,7 +69017,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 221 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 222 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -68248,7 +69088,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 154 /* PropertyDeclaration */ + return member.kind === 155 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -68259,8 +69099,8 @@ var ts; * @param receiver The receiver on which each property should be assigned. */ function addInitializedPropertyStatements(statements, properties, receiver) { - for (var _i = 0, properties_9 = properties; _i < properties_9.length; _i++) { - var property = properties_9[_i]; + for (var _i = 0, properties_6 = properties; _i < properties_6.length; _i++) { + var property = properties_6[_i]; var statement = ts.createExpressionStatement(transformInitializedProperty(property, receiver)); ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property)); ts.setCommentRange(statement, property); @@ -68276,8 +69116,8 @@ var ts; */ function generateInitializedPropertyExpressions(properties, receiver) { var expressions = []; - for (var _i = 0, properties_10 = properties; _i < properties_10.length; _i++) { - var property = properties_10[_i]; + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var property = properties_7[_i]; var expression = transformInitializedProperty(property, receiver); ts.startOnNewLine(expression); ts.setSourceMapRange(expression, ts.moveRangePastModifiers(property)); @@ -68391,12 +69231,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -68549,7 +69389,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 154 /* PropertyDeclaration */ + ? member.kind === 155 /* 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`. ? ts.createVoidZero() @@ -68672,10 +69512,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */ - || kind === 154 /* PropertyDeclaration */; + return kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */ + || kind === 155 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -68685,7 +69525,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 156 /* MethodDeclaration */; + return node.kind === 157 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -68696,12 +69536,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return true; } return false; @@ -68718,15 +69558,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 154 /* PropertyDeclaration */: - case 151 /* Parameter */: + case 155 /* PropertyDeclaration */: + case 152 /* Parameter */: return serializeTypeNode(node.type); - case 159 /* SetAccessor */: - case 158 /* GetAccessor */: + case 160 /* SetAccessor */: + case 159 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 156 /* MethodDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 157 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -68763,7 +69603,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 158 /* GetAccessor */) { + if (container && node.kind === 159 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -68808,69 +69648,69 @@ var ts; return ts.createIdentifier("Object"); } switch (node.kind) { - case 106 /* VoidKeyword */: - case 141 /* UndefinedKeyword */: - case 96 /* NullKeyword */: - case 132 /* NeverKeyword */: + case 107 /* VoidKeyword */: + case 142 /* UndefinedKeyword */: + case 97 /* NullKeyword */: + case 133 /* NeverKeyword */: return ts.createVoidZero(); - case 177 /* ParenthesizedType */: + case 178 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 165 /* FunctionType */: - case 166 /* ConstructorType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: return ts.createIdentifier("Function"); - case 169 /* ArrayType */: - case 170 /* TupleType */: + case 170 /* ArrayType */: + case 171 /* TupleType */: return ts.createIdentifier("Array"); - case 163 /* TypePredicate */: - case 123 /* BooleanKeyword */: + case 164 /* TypePredicate */: + case 124 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 138 /* StringKeyword */: + case 139 /* StringKeyword */: return ts.createIdentifier("String"); - case 136 /* ObjectKeyword */: + case 137 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 182 /* LiteralType */: + case 183 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: return ts.createIdentifier("String"); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return ts.createIdentifier("Number"); case 9 /* BigIntLiteral */: return getGlobalBigIntNameWithFallback(); - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: return ts.createIdentifier("Boolean"); default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 135 /* NumberKeyword */: + case 136 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 146 /* BigIntKeyword */: + case 147 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 139 /* SymbolKeyword */: + case 140 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return serializeTypeReferenceNode(node); - case 174 /* IntersectionType */: - case 173 /* UnionType */: + case 175 /* IntersectionType */: + case 174 /* UnionType */: return serializeTypeList(node.types); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 179 /* TypeOperator */: - if (node.operator === 133 /* ReadonlyKeyword */) { + case 180 /* TypeOperator */: + if (node.operator === 134 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 167 /* TypeQuery */: - case 180 /* IndexedAccessType */: - case 181 /* MappedType */: - case 168 /* TypeLiteral */: - case 120 /* AnyKeyword */: - case 143 /* UnknownKeyword */: - case 178 /* ThisType */: - case 183 /* ImportType */: + case 168 /* TypeQuery */: + case 181 /* IndexedAccessType */: + case 182 /* MappedType */: + case 169 /* TypeLiteral */: + case 121 /* AnyKeyword */: + case 144 /* UnknownKeyword */: + case 179 /* ThisType */: + case 184 /* ImportType */: break; default: return ts.Debug.failBadSyntaxKind(node); @@ -68881,15 +69721,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_18 = types; _i < types_18.length; _i++) { - var typeNode = types_18[_i]; - while (typeNode.kind === 177 /* ParenthesizedType */) { + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var typeNode = types_17[_i]; + while (typeNode.kind === 178 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 132 /* NeverKeyword */) { + if (typeNode.kind === 133 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 96 /* NullKeyword */ || typeNode.kind === 141 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 97 /* NullKeyword */ || typeNode.kind === 142 /* 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); @@ -68969,12 +69809,12 @@ var ts; * @param node The entity name to serialize. */ function serializeEntityNameAsExpressionFallback(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { // A -> typeof A !== undefined && A var copied = serializeEntityNameAsExpression(node); return createCheckedValue(copied, copied); } - if (node.left.kind === 72 /* Identifier */) { + if (node.left.kind === 73 /* Identifier */) { // A.B -> typeof A !== undefined && A.B return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node)); } @@ -68990,7 +69830,7 @@ var ts; */ function serializeEntityNameAsExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: // Create a clone of the name with a new parent, and treat it as if it were // a source tree node for the purposes of the checker. var name = ts.getMutableClone(node); @@ -68998,7 +69838,7 @@ var ts; name.original = undefined; name.parent = ts.getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. return name; - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -69024,7 +69864,7 @@ var ts; * available. */ function getGlobalBigIntNameWithFallback() { - return languageVersion < 7 /* ESNext */ + return languageVersion < 8 /* ESNext */ ? ts.createConditional(ts.createTypeCheck(ts.createIdentifier("BigInt"), "function"), ts.createIdentifier("BigInt"), ts.createIdentifier("Object")) : ts.createIdentifier("BigInt"); } @@ -69108,7 +69948,7 @@ var ts; * @param node The HeritageClause to transform. */ function visitHeritageClause(node) { - if (node.token === 109 /* ImplementsKeyword */) { + if (node.token === 110 /* ImplementsKeyword */) { // implements clauses are elided return undefined; } @@ -69347,7 +70187,7 @@ var ts; */ function visitEnumDeclaration(node) { if (!shouldEmitEnumDeclaration(node)) { - return undefined; + return ts.createNotEmittedStatement(node); } var statements = []; // We request to be advised when the printer is about to print this node. This allows @@ -69515,12 +70355,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 284 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 285 /* 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 === 243 /* EnumDeclaration */) { + if (node.kind === 244 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -69645,7 +70485,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 245 /* ModuleBlock */) { + if (body.kind === 246 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -69691,13 +70531,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 (body.kind !== 245 /* ModuleBlock */) { + if (body.kind !== 246 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 244 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 245 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -69738,7 +70578,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 251 /* NamespaceImport */) { + if (node.kind === 252 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -69951,7 +70791,7 @@ var ts; function enableSubstitutionForNonQualifiedEnumMembers() { if ((enabledSubstitutions & 8 /* NonQualifiedEnumMembers */) === 0) { enabledSubstitutions |= 8 /* NonQualifiedEnumMembers */; - context.enableSubstitution(72 /* Identifier */); + context.enableSubstitution(73 /* Identifier */); } } function enableSubstitutionForClassAliases() { @@ -69959,7 +70799,7 @@ var ts; enabledSubstitutions |= 1 /* ClassAliases */; // We need to enable substitutions for identifiers. This allows us to // substitute class names inside of a class declaration. - context.enableSubstitution(72 /* Identifier */); + context.enableSubstitution(73 /* Identifier */); // Keep track of class aliases. classAliases = []; } @@ -69969,17 +70809,17 @@ var ts; enabledSubstitutions |= 2 /* NamespaceExports */; // 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(72 /* Identifier */); - context.enableSubstitution(276 /* ShorthandPropertyAssignment */); + context.enableSubstitution(73 /* Identifier */); + context.enableSubstitution(277 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(244 /* ModuleDeclaration */); + context.enableEmitNotification(245 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 244 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 245 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 243 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 244 /* EnumDeclaration */; } /** * Hook for node emit. @@ -70038,11 +70878,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return substituteExpressionIdentifier(node); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -70080,9 +70920,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 !== 284 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 244 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 243 /* EnumDeclaration */); + if (container && container.kind !== 285 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 245 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 244 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -70222,26 +71062,26 @@ var ts; return node; } switch (node.kind) { - case 121 /* AsyncKeyword */: + case 122 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return visitAwaitExpression(node); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return visitFunctionExpression(node); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return visitArrowFunction(node); - case 189 /* PropertyAccessExpression */: - if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 98 /* SuperKeyword */) { + case 190 /* PropertyAccessExpression */: + if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 99 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 190 /* ElementAccessExpression */: - if (capturedSuperProperties && node.expression.kind === 98 /* SuperKeyword */) { + case 191 /* ElementAccessExpression */: + if (capturedSuperProperties && node.expression.kind === 99 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); @@ -70252,27 +71092,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 218 /* Block */: - case 232 /* SwitchStatement */: - case 246 /* CaseBlock */: - case 271 /* CaseClause */: - case 272 /* DefaultClause */: - case 235 /* TryStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 222 /* IfStatement */: - case 231 /* WithStatement */: - case 233 /* LabeledStatement */: + case 219 /* Block */: + case 233 /* SwitchStatement */: + case 247 /* CaseBlock */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: + case 236 /* TryStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 223 /* IfStatement */: + case 232 /* WithStatement */: + case 234 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -70473,7 +71313,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 === 197 /* ArrowFunction */; + var isArrowFunction = node.kind === 198 /* 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 @@ -70564,17 +71404,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(191 /* CallExpression */); - context.enableSubstitution(189 /* PropertyAccessExpression */); - context.enableSubstitution(190 /* ElementAccessExpression */); + context.enableSubstitution(192 /* CallExpression */); + context.enableSubstitution(190 /* PropertyAccessExpression */); + context.enableSubstitution(191 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(240 /* ClassDeclaration */); - context.enableEmitNotification(156 /* MethodDeclaration */); - context.enableEmitNotification(158 /* GetAccessor */); - context.enableEmitNotification(159 /* SetAccessor */); - context.enableEmitNotification(157 /* Constructor */); + context.enableEmitNotification(241 /* ClassDeclaration */); + context.enableEmitNotification(157 /* MethodDeclaration */); + context.enableEmitNotification(159 /* GetAccessor */); + context.enableEmitNotification(160 /* SetAccessor */); + context.enableEmitNotification(158 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(219 /* VariableStatement */); + context.enableEmitNotification(220 /* VariableStatement */); } } /** @@ -70622,23 +71462,23 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return substituteCallExpression(node); } return node; } function substitutePropertyAccessExpression(node) { - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { return ts.setTextRange(ts.createPropertyAccess(ts.createFileLevelUniqueName("_super"), node.name), node); } return node; } function substituteElementAccessExpression(node) { - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { return createSuperElementAccessInAsyncMethod(node.argumentExpression, node); } return node; @@ -70658,11 +71498,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 240 /* ClassDeclaration */ - || kind === 157 /* Constructor */ - || kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */; + return kind === 241 /* ClassDeclaration */ + || kind === 158 /* Constructor */ + || kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -70797,7 +71637,7 @@ var ts; return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { - if (node.kind === 121 /* AsyncKeyword */) { + if (node.kind === 122 /* AsyncKeyword */) { return undefined; } return node; @@ -70807,53 +71647,55 @@ var ts; return node; } switch (node.kind) { - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return visitAwaitExpression(node); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return visitYieldExpression(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return visitReturnStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return visitLabeledStatement(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 237 /* VariableDeclaration */: + case 275 /* CatchClause */: + return visitCatchClause(node); + case 238 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatement(node); - case 200 /* VoidExpression */: + case 201 /* VoidExpression */: return visitVoidExpression(node); - case 157 /* Constructor */: + case 158 /* Constructor */: return visitConstructorDeclaration(node); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return visitFunctionExpression(node); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return visitArrowFunction(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return visitParameter(node); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return visitExpressionStatement(node); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 189 /* PropertyAccessExpression */: - if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 98 /* SuperKeyword */) { + case 190 /* PropertyAccessExpression */: + if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 99 /* SuperKeyword */) { capturedSuperProperties.set(node.name.escapedText, true); } return ts.visitEachChild(node, visitor, context); - case 190 /* ElementAccessExpression */: - if (capturedSuperProperties && node.expression.kind === 98 /* SuperKeyword */) { + case 191 /* ElementAccessExpression */: + if (capturedSuperProperties && node.expression.kind === 99 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); @@ -70889,7 +71731,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 227 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 228 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -70901,7 +71743,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 === 277 /* SpreadAssignment */) { + if (e.kind === 278 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -70910,7 +71752,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 275 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 276 /* PropertyAssignment */ ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -70928,7 +71770,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 188 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 189 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -70955,6 +71797,23 @@ var ts; } return ts.visitEachChild(node, visitor, context); } + function visitCatchClause(node) { + if (node.variableDeclaration && + ts.isBindingPattern(node.variableDeclaration.name) && + node.variableDeclaration.name.transformFlags & 8192 /* ContainsObjectRestOrSpread */) { + var name = ts.getGeneratedNameForNode(node.variableDeclaration.name); + var updatedDecl = ts.updateVariableDeclaration(node.variableDeclaration, node.variableDeclaration.name, /*type*/ undefined, name); + var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* ObjectRest */); + var block = ts.visitNode(node.block, visitor, ts.isBlock); + if (ts.some(visitedBindings)) { + block = ts.updateBlock(block, [ + ts.createVariableStatement(/*modifiers*/ undefined, visitedBindings) + ].concat(block.statements)); + } + return ts.updateCatchClause(node, ts.updateVariableDeclaration(node.variableDeclaration, name, /*type*/ undefined, /*initializer*/ undefined), block); + } + return ts.visitEachChild(node, visitor, context); + } /** * Visits a VariableDeclaration node with a binding pattern. * @@ -71247,17 +72106,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(191 /* CallExpression */); - context.enableSubstitution(189 /* PropertyAccessExpression */); - context.enableSubstitution(190 /* ElementAccessExpression */); + context.enableSubstitution(192 /* CallExpression */); + context.enableSubstitution(190 /* PropertyAccessExpression */); + context.enableSubstitution(191 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(240 /* ClassDeclaration */); - context.enableEmitNotification(156 /* MethodDeclaration */); - context.enableEmitNotification(158 /* GetAccessor */); - context.enableEmitNotification(159 /* SetAccessor */); - context.enableEmitNotification(157 /* Constructor */); + context.enableEmitNotification(241 /* ClassDeclaration */); + context.enableEmitNotification(157 /* MethodDeclaration */); + context.enableEmitNotification(159 /* GetAccessor */); + context.enableEmitNotification(160 /* SetAccessor */); + context.enableEmitNotification(158 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(219 /* VariableStatement */); + context.enableEmitNotification(220 /* VariableStatement */); } } /** @@ -71305,23 +72164,23 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return substituteCallExpression(node); } return node; } function substitutePropertyAccessExpression(node) { - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { return ts.setTextRange(ts.createPropertyAccess(ts.createFileLevelUniqueName("_super"), node.name), node); } return node; } function substituteElementAccessExpression(node) { - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { return createSuperElementAccessInAsyncMethod(node.argumentExpression, node); } return node; @@ -71341,11 +72200,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 240 /* ClassDeclaration */ - || kind === 157 /* Constructor */ - || kind === 156 /* MethodDeclaration */ - || kind === 158 /* GetAccessor */ - || kind === 159 /* SetAccessor */; + return kind === 241 /* ClassDeclaration */ + || kind === 158 /* Constructor */ + || kind === 157 /* MethodDeclaration */ + || kind === 159 /* GetAccessor */ + || kind === 160 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -71439,7 +72298,7 @@ var ts; return node; } switch (node.kind) { - case 274 /* CatchClause */: + case 275 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -71508,13 +72367,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 260 /* JsxElement */: + case 261 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -71524,13 +72383,13 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return visitJsxExpression(node); - case 260 /* JsxElement */: + case 261 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); @@ -71605,7 +72464,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 270 /* JsxExpression */) { + else if (node.kind === 271 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -71699,7 +72558,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 260 /* JsxElement */) { + if (node.kind === 261 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -72005,7 +72864,7 @@ var ts; return node; } switch (node.kind) { - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -72013,7 +72872,7 @@ var ts; } function visitBinaryExpression(node) { switch (node.operatorToken.kind) { - case 63 /* AsteriskAsteriskEqualsToken */: + case 64 /* AsteriskAsteriskEqualsToken */: return visitExponentiationAssignmentExpression(node); case 41 /* AsteriskAsteriskToken */: return visitExponentiationExpression(node); @@ -72098,62 +72957,63 @@ var ts; HierarchyFacts[HierarchyFacts["Block"] = 128] = "Block"; HierarchyFacts[HierarchyFacts["IterationStatement"] = 256] = "IterationStatement"; HierarchyFacts[HierarchyFacts["IterationStatementBlock"] = 512] = "IterationStatementBlock"; - HierarchyFacts[HierarchyFacts["ForStatement"] = 1024] = "ForStatement"; - HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 2048] = "ForInOrForOfStatement"; - HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 4096] = "ConstructorWithCapturedSuper"; + HierarchyFacts[HierarchyFacts["IterationContainer"] = 1024] = "IterationContainer"; + HierarchyFacts[HierarchyFacts["ForStatement"] = 2048] = "ForStatement"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatement"] = 4096] = "ForInOrForOfStatement"; + HierarchyFacts[HierarchyFacts["ConstructorWithCapturedSuper"] = 8192] = "ConstructorWithCapturedSuper"; // NOTE: do not add more ancestor flags without also updating AncestorFactsMask below. // NOTE: when adding a new ancestor flag, be sure to update the subtree flags below. // // Ancestor masks // - HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 8191] = "AncestorFactsMask"; + HierarchyFacts[HierarchyFacts["AncestorFactsMask"] = 16383] = "AncestorFactsMask"; // We are always in *some* kind of block scope, but only specific block-scope containers are // top-level or Blocks. HierarchyFacts[HierarchyFacts["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; - HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 4032] = "BlockScopeExcludes"; + HierarchyFacts[HierarchyFacts["BlockScopeExcludes"] = 7104] = "BlockScopeExcludes"; // A source file is a top-level block scope. HierarchyFacts[HierarchyFacts["SourceFileIncludes"] = 64] = "SourceFileIncludes"; - HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 3968] = "SourceFileExcludes"; + HierarchyFacts[HierarchyFacts["SourceFileExcludes"] = 8064] = "SourceFileExcludes"; // Functions, methods, and accessors are both new lexical scopes and new block scopes. HierarchyFacts[HierarchyFacts["FunctionIncludes"] = 65] = "FunctionIncludes"; - HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 8094] = "FunctionExcludes"; + HierarchyFacts[HierarchyFacts["FunctionExcludes"] = 16286] = "FunctionExcludes"; HierarchyFacts[HierarchyFacts["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; - HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 8086] = "AsyncFunctionBodyExcludes"; + HierarchyFacts[HierarchyFacts["AsyncFunctionBodyExcludes"] = 16278] = "AsyncFunctionBodyExcludes"; // Arrow functions are lexically scoped to their container, but are new block scopes. HierarchyFacts[HierarchyFacts["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; - HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 8064] = "ArrowFunctionExcludes"; + HierarchyFacts[HierarchyFacts["ArrowFunctionExcludes"] = 15232] = "ArrowFunctionExcludes"; // Constructors are both new lexical scopes and new block scopes. Constructors are also // always considered non-static members of a class. HierarchyFacts[HierarchyFacts["ConstructorIncludes"] = 73] = "ConstructorIncludes"; - HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 8086] = "ConstructorExcludes"; + HierarchyFacts[HierarchyFacts["ConstructorExcludes"] = 16278] = "ConstructorExcludes"; // 'do' and 'while' statements are not block scopes. We track that the subtree is contained // within an IterationStatement to indicate whether the embedded statement is an // IterationStatementBlock. - HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 256] = "DoOrWhileStatementIncludes"; + HierarchyFacts[HierarchyFacts["DoOrWhileStatementIncludes"] = 1280] = "DoOrWhileStatementIncludes"; HierarchyFacts[HierarchyFacts["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; // 'for' statements are new block scopes and have special handling for 'let' declarations. - HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 1280] = "ForStatementIncludes"; - HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 3008] = "ForStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForStatementIncludes"] = 3328] = "ForStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForStatementExcludes"] = 5056] = "ForStatementExcludes"; // 'for-in' and 'for-of' statements are new block scopes and have special handling for // 'let' declarations. - HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 2304] = "ForInOrForOfStatementIncludes"; - HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 1984] = "ForInOrForOfStatementExcludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementIncludes"] = 5376] = "ForInOrForOfStatementIncludes"; + HierarchyFacts[HierarchyFacts["ForInOrForOfStatementExcludes"] = 3008] = "ForInOrForOfStatementExcludes"; // Blocks (other than function bodies) are new block scopes. HierarchyFacts[HierarchyFacts["BlockIncludes"] = 128] = "BlockIncludes"; - HierarchyFacts[HierarchyFacts["BlockExcludes"] = 3904] = "BlockExcludes"; + HierarchyFacts[HierarchyFacts["BlockExcludes"] = 6976] = "BlockExcludes"; HierarchyFacts[HierarchyFacts["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; - HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 4032] = "IterationStatementBlockExcludes"; + HierarchyFacts[HierarchyFacts["IterationStatementBlockExcludes"] = 7104] = "IterationStatementBlockExcludes"; // // Subtree facts // - HierarchyFacts[HierarchyFacts["NewTarget"] = 8192] = "NewTarget"; - HierarchyFacts[HierarchyFacts["CapturedLexicalThis"] = 16384] = "CapturedLexicalThis"; + HierarchyFacts[HierarchyFacts["NewTarget"] = 16384] = "NewTarget"; + HierarchyFacts[HierarchyFacts["CapturedLexicalThis"] = 32768] = "CapturedLexicalThis"; // // Subtree masks // - HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -8192] = "SubtreeFactsMask"; + HierarchyFacts[HierarchyFacts["SubtreeFactsMask"] = -16384] = "SubtreeFactsMask"; HierarchyFacts[HierarchyFacts["ArrowFunctionSubtreeExcludes"] = 0] = "ArrowFunctionSubtreeExcludes"; - HierarchyFacts[HierarchyFacts["FunctionSubtreeExcludes"] = 24576] = "FunctionSubtreeExcludes"; + HierarchyFacts[HierarchyFacts["FunctionSubtreeExcludes"] = 49152] = "FunctionSubtreeExcludes"; })(HierarchyFacts || (HierarchyFacts = {})); function transformES2015(context) { var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; @@ -72202,7 +73062,7 @@ var ts; */ function enterSubtree(excludeFacts, includeFacts) { var ancestorFacts = hierarchyFacts; - hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 8191 /* AncestorFactsMask */; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 16383 /* AncestorFactsMask */; return ancestorFacts; } /** @@ -72213,17 +73073,17 @@ var ts; * @param includeFacts The new `HierarchyFacts` of the subtree that should be propagated. */ function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { - hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -8192 /* SubtreeFactsMask */ | ancestorFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 /* SubtreeFactsMask */ | ancestorFacts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { - return (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 230 /* ReturnStatement */ + return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 + && node.kind === 231 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 218 /* Block */))) + || (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 219 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -72236,72 +73096,72 @@ var ts; } } function callExpressionVisitor(node) { - if (node.kind === 98 /* SuperKeyword */) { + if (node.kind === 99 /* SuperKeyword */) { return visitSuperKeyword(/*isExpressionOfCall*/ true); } return visitor(node); } function visitJavaScript(node) { switch (node.kind) { - case 116 /* StaticKeyword */: + case 117 /* StaticKeyword */: return undefined; // elide static keyword - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return visitClassDeclaration(node); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return visitClassExpression(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return visitParameter(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return visitArrowFunction(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return visitFunctionExpression(node); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 72 /* Identifier */: + case 73 /* Identifier */: return visitIdentifier(node); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return visitSwitchStatement(node); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return visitCaseBlock(node); - case 218 /* Block */: + case 219 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: + case 230 /* BreakStatement */: + case 229 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return visitLabeledStatement(node); - case 223 /* DoStatement */: - case 224 /* WhileStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return visitExpressionStatement(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return visitCatchClause(node); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return visitCallExpression(node); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return visitNewExpression(node); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: @@ -72312,35 +73172,35 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: return visitTemplateExpression(node); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return visitYieldExpression(node); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return visitSpreadElement(node); - case 98 /* SuperKeyword */: + case 99 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return visitThisKeyword(node); - case 214 /* MetaProperty */: + case 215 /* MetaProperty */: return visitMetaProperty(node); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return visitAccessorDeclaration(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitVariableStatement(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); } } function visitSourceFile(node) { - var ancestorFacts = enterSubtree(3968 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); + var ancestorFacts = enterSubtree(8064 /* SourceFileExcludes */, 64 /* SourceFileIncludes */); var prologue = []; var statements = []; startLexicalEnvironment(); @@ -72367,7 +73227,7 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitCaseBlock(node) { - var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); var updated = ts.visitEachChild(node, visitor, context); exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); return updated; @@ -72394,7 +73254,7 @@ var ts; } function visitThisKeyword(node) { if (hierarchyFacts & 2 /* ArrowFunction */) { - hierarchyFacts |= 16384 /* CapturedLexicalThis */; + hierarchyFacts |= 32768 /* CapturedLexicalThis */; } if (convertedLoopState) { if (hierarchyFacts & 2 /* ArrowFunction */) { @@ -72424,14 +73284,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 === 229 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 230 /* 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 === 229 /* BreakStatement */) { + if (node.kind === 230 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -72442,7 +73302,7 @@ var ts; } } else { - if (node.kind === 229 /* BreakStatement */) { + if (node.kind === 230 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -72637,7 +73497,7 @@ var ts; function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; - var ancestorFacts = enterSubtree(8086 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); + var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); var constructorFunction = ts.createFunctionDeclaration( @@ -72651,7 +73511,7 @@ var ts; ts.setEmitFlags(constructorFunction, 8 /* CapturesThis */); } statements.push(constructorFunction); - exitSubtree(ancestorFacts, 24576 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; } /** @@ -72700,7 +73560,7 @@ var ts; function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) { // determine whether the class is known syntactically to be a derived class (e.g. a // class that extends a value that is not syntactically known to be `null`). - var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 96 /* NullKeyword */; + var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 97 /* NullKeyword */; // When the subclass does not have a constructor, we synthesize a *default* constructor using the following // representation: // @@ -72744,7 +73604,7 @@ var ts; } } if (superCallExpression) { - hierarchyFacts |= 4096 /* ConstructorWithCapturedSuper */; + hierarchyFacts |= 8192 /* ConstructorWithCapturedSuper */; statementOffset++; // skip this statement, we will add it after visiting the rest of the body. } // visit the remaining statements @@ -72838,11 +73698,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 230 /* ReturnStatement */) { + if (statement.kind === 231 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 222 /* IfStatement */) { + else if (statement.kind === 223 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -72850,7 +73710,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 218 /* Block */) { + else if (statement.kind === 219 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -73005,10 +73865,10 @@ var ts; return false; } // `declarationName` is the name of the local declaration for the parameter. - var declarationName = parameter.name.kind === 72 /* Identifier */ ? ts.getMutableClone(parameter.name) : ts.createTempVariable(/*recordTempVariable*/ undefined); + var declarationName = parameter.name.kind === 73 /* Identifier */ ? ts.getMutableClone(parameter.name) : ts.createTempVariable(/*recordTempVariable*/ undefined); ts.setEmitFlags(declarationName, 48 /* NoSourceMap */); // `expressionName` is the name of the parameter used in expressions. - var expressionName = parameter.name.kind === 72 /* Identifier */ ? ts.getSynthesizedClone(parameter.name) : declarationName; + var expressionName = parameter.name.kind === 73 /* Identifier */ ? ts.getSynthesizedClone(parameter.name) : declarationName; var restIndex = node.parameters.length - 1; var temp = ts.createLoopVariable(); // var param = []; @@ -73032,7 +73892,7 @@ var ts; ts.setEmitFlags(forStatement, 1048576 /* CustomPrologue */); ts.startOnNewLine(forStatement); prologueStatements.push(forStatement); - if (parameter.name.kind !== 72 /* Identifier */) { + if (parameter.name.kind !== 73 /* Identifier */) { // do the actual destructuring of the rest parameter if necessary prologueStatements.push(ts.setEmitFlags(ts.setTextRange(ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(ts.flattenDestructuringBinding(parameter, visitor, context, 0 /* All */, expressionName))), parameter), 1048576 /* CustomPrologue */)); @@ -73048,7 +73908,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 16384 /* CapturedLexicalThis */ && node.kind !== 197 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 198 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, ts.createThis()); return true; } @@ -73066,28 +73926,28 @@ var ts; ts.insertStatementAfterCustomPrologue(statements, captureThisStatement); } function insertCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { - if (hierarchyFacts & 8192 /* NewTarget */) { + if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return statements; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 157 /* Constructor */: + case 158 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 197 /* 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 = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 94 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); + newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 95 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); break; default: return ts.Debug.failBadSyntaxKind(node); @@ -73116,20 +73976,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 217 /* SemicolonClassElement */: + case 218 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 157 /* Constructor */: + case 158 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -73196,7 +74056,7 @@ var ts; // arguments are both mapped contiguously to the accessor name. var target = ts.getMutableClone(receiver); ts.setEmitFlags(target, 1536 /* NoComments */ | 32 /* NoTrailingSourceMap */); - ts.setSourceMapRange(target, firstAccessor.name); // TODO: GH#18217 + ts.setSourceMapRange(target, firstAccessor.name); var propertyName = ts.createExpressionForPropertyName(ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName)); ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 16 /* NoLeadingSourceMap */); ts.setSourceMapRange(propertyName, firstAccessor.name); @@ -73236,11 +74096,11 @@ var ts; */ function visitArrowFunction(node) { if (node.transformFlags & 2048 /* ContainsLexicalThis */) { - hierarchyFacts |= 16384 /* CapturedLexicalThis */; + hierarchyFacts |= 32768 /* CapturedLexicalThis */; } var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; - var ancestorFacts = enterSubtree(8064 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); + var ancestorFacts = enterSubtree(15232 /* ArrowFunctionExcludes */, 66 /* ArrowFunctionIncludes */); var func = ts.createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, @@ -73250,7 +74110,7 @@ var ts; ts.setTextRange(func, node); ts.setOriginalNode(func, node); ts.setEmitFlags(func, 8 /* CapturesThis */); - if (hierarchyFacts & 16384 /* CapturedLexicalThis */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */) { enableSubstitutionsForCapturedThis(); } // If an arrow function contains @@ -73265,16 +74125,16 @@ var ts; */ function visitFunctionExpression(node) { var ancestorFacts = ts.getEmitFlags(node) & 262144 /* AsyncFunctionBody */ - ? enterSubtree(8086 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) - : enterSubtree(8094 /* FunctionExcludes */, 65 /* FunctionIncludes */); + ? enterSubtree(16278 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - var name = hierarchyFacts & 8192 /* NewTarget */ + var name = hierarchyFacts & 16384 /* NewTarget */ ? ts.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 24576 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return ts.updateFunctionExpression(node, /*modifiers*/ undefined, node.asteriskToken, name, @@ -73289,13 +74149,13 @@ var ts; function visitFunctionDeclaration(node) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; - var ancestorFacts = enterSubtree(8094 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - var name = hierarchyFacts & 8192 /* NewTarget */ + var name = hierarchyFacts & 16384 /* NewTarget */ ? ts.getLocalName(node) : node.name; - exitSubtree(ancestorFacts, 24576 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return ts.updateFunctionDeclaration(node, /*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, name, @@ -73313,14 +74173,14 @@ var ts; var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = container && ts.isClassLike(container) && !ts.hasModifier(node, 32 /* Static */) - ? enterSubtree(8094 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) - : enterSubtree(8094 /* FunctionExcludes */, 65 /* FunctionIncludes */); + ? enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */ | 8 /* NonStaticClassElement */) + : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 8192 /* NewTarget */ && !name && (node.kind === 239 /* FunctionDeclaration */ || node.kind === 196 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 240 /* FunctionDeclaration */ || node.kind === 197 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } - exitSubtree(ancestorFacts, 24576 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return ts.setOriginalNode(ts.setTextRange(ts.createFunctionExpression( /*modifiers*/ undefined, node.asteriskToken, name, @@ -73361,7 +74221,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 197 /* ArrowFunction */); + ts.Debug.assert(node.kind === 198 /* 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 @@ -73415,8 +74275,8 @@ var ts; return ts.visitEachChild(node, visitor, context); } var ancestorFacts = hierarchyFacts & 256 /* IterationStatement */ - ? enterSubtree(4032 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) - : enterSubtree(3904 /* BlockExcludes */, 128 /* BlockIncludes */); + ? enterSubtree(7104 /* IterationStatementBlockExcludes */, 512 /* IterationStatementBlockIncludes */) + : enterSubtree(6976 /* BlockExcludes */, 128 /* BlockIncludes */); var updated = ts.visitEachChild(node, visitor, context); exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); return updated; @@ -73429,9 +74289,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return ts.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return ts.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -73450,9 +74310,9 @@ var ts; // 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 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -73487,7 +74347,7 @@ var ts; assignment = ts.flattenDestructuringAssignment(decl, visitor, context, 0 /* All */); } else { - assignment = ts.createBinary(decl.name, 59 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); + assignment = ts.createBinary(decl.name, 60 /* EqualsToken */, ts.visitNode(decl.initializer, visitor, ts.isExpression)); ts.setTextRange(assignment, decl); } assignments = ts.append(assignments, assignment); @@ -73599,11 +74459,11 @@ var ts; && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0); var emitExplicitInitializer = !emittedAsTopLevel - && (hierarchyFacts & 2048 /* ForInOrForOfStatement */) === 0 + && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || (isDeclaredInLoop && !isCapturedInFunction - && (hierarchyFacts & (1024 /* ForStatement */ | 2048 /* ForInOrForOfStatement */)) === 0)); + && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0)); return emitExplicitInitializer; } /** @@ -73661,34 +74521,34 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 223 /* DoStatement */: - case 224 /* WhileStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { var ancestorFacts = enterSubtree(excludeFacts, includeFacts); - var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert); exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */); return updated; } function visitDoOrWhileStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 256 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement); + return visitIterationStatementWithFacts(0 /* DoOrWhileStatementExcludes */, 1280 /* DoOrWhileStatementIncludes */, node, outermostLabeledStatement); } function visitForStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts(3008 /* ForStatementExcludes */, 1280 /* ForStatementIncludes */, node, outermostLabeledStatement); + return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } function visitForInStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); + return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } function visitForOfStatement(node, outermostLabeledStatement) { - return visitIterationStatementWithFacts(1984 /* ForInOrForOfStatementExcludes */, 2304 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); } function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { var statements = []; @@ -73796,7 +74656,7 @@ var ts; ts.setTextRange(forStatement, node); return ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); } - function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements) { + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { var expression = ts.visitNode(node.expression, visitor, ts.isExpression); var iterator = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(expression) : ts.createTempVariable(/*recordTempVariable*/ undefined); var result = ts.isIdentifier(expression) ? ts.getGeneratedNameForNode(iterator) : ts.createTempVariable(/*recordTempVariable*/ undefined); @@ -73807,9 +74667,13 @@ var ts; var next = ts.createCall(ts.createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); hoistVariableDeclaration(errorRecord); hoistVariableDeclaration(returnMethod); + // if we are enclosed in an outer loop ensure we reset 'errorRecord' per each iteration + var initializer = ancestorFacts & 1024 /* IterationContainer */ + ? ts.inlineExpressions([ts.createAssignment(errorRecord, ts.createVoidZero()), values]) + : values; var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor( /*initializer*/ ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([ - ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression), + ts.setTextRange(ts.createVariableDeclaration(iterator, /*type*/ undefined, initializer), node.expression), ts.createVariableDeclaration(result, /*type*/ undefined, next) ]), node.expression), 2097152 /* NoHoisting */), /*condition*/ ts.createLogicalNot(ts.createPropertyAccess(result, "done")), @@ -73852,7 +74716,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 149 /* ComputedPropertyName */) { + if (property.name.kind === 150 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -73907,7 +74771,7 @@ var ts; } visit(node.name); function visit(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { state.hoistedLocalVariables.push(node); } else { @@ -73920,7 +74784,7 @@ var ts; } } } - function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, convert) { + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert) { if (!shouldConvertIterationStatement(node)) { var saveAllowedNonLabeledJumps = void 0; if (convertedLoopState) { @@ -73930,7 +74794,7 @@ var ts; convertedLoopState.allowedNonLabeledJumps = 2 /* Break */ | 4 /* Continue */; } var result = convert - ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined) + ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) : ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; @@ -73955,7 +74819,7 @@ var ts; var loop; if (bodyFunction) { if (convert) { - loop = convert(node, outermostLabeledStatement, bodyFunction.part); + loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts); } else { var clone_3 = convertIterationStatementCore(node, initializerFunction, ts.createBlock(bodyFunction.part, /*multiLine*/ true)); @@ -73973,11 +74837,11 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 225 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 226 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 227 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 223 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 224 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 226 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 227 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 228 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 224 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 225 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } @@ -74002,11 +74866,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 238 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 239 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -74268,7 +75132,7 @@ var ts; function copyOutParameter(outParam, copyDirection) { var source = copyDirection === 0 /* ToOriginal */ ? outParam.outParamName : outParam.originalName; var target = copyDirection === 0 /* ToOriginal */ ? outParam.originalName : outParam.outParamName; - return ts.createBinary(target, 59 /* EqualsToken */, source); + return ts.createBinary(target, 60 /* EqualsToken */, source); } function copyOutParameters(outParams, partFlags, copyDirection, statements) { for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) { @@ -74405,20 +75269,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -74473,7 +75337,7 @@ var ts; return expression; } function visitCatchClause(node) { - var ancestorFacts = enterSubtree(4032 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); + var ancestorFacts = enterSubtree(7104 /* BlockScopeExcludes */, 0 /* BlockScopeIncludes */); var updated; ts.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); if (ts.isBindingPattern(node.variableDeclaration.name)) { @@ -74521,17 +75385,17 @@ var ts; ts.Debug.assert(!ts.isComputedPropertyName(node.name)); var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; - var ancestorFacts = enterSubtree(8094 /* FunctionExcludes */, 65 /* FunctionIncludes */); + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 158 /* GetAccessor */) { + if (node.kind === 159 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { updated = ts.updateSetAccessor(node, node.decorators, node.modifiers, node.name, parameters, body); } - exitSubtree(ancestorFacts, 24576 /* FunctionSubtreeExcludes */, 0 /* None */); + exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); convertedLoopState = savedConvertedLoopState; return updated; } @@ -74578,7 +75442,7 @@ var ts; return visitTypeScriptClassWrapper(node); } var expression = ts.skipOuterExpressions(node.expression); - if (expression.kind === 98 /* SuperKeyword */ || + if (expression.kind === 99 /* SuperKeyword */ || ts.isSuperProperty(expression) || ts.some(node.arguments, ts.isSpreadElement)) { return visitCallExpressionWithPotentialCapturedThisAssignment(node, /*assignToCapturedThis*/ true); @@ -74702,10 +75566,10 @@ var ts; // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. if (node.transformFlags & 4096 /* ContainsRestOrSpread */ || - node.expression.kind === 98 /* SuperKeyword */ || + node.expression.kind === 99 /* SuperKeyword */ || ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); } var resultingCall = void 0; @@ -74723,7 +75587,7 @@ var ts; // _super.apply(this, a.concat([b])) // _super.m.apply(this, a.concat([b])) // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 98 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 99 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); } else { // [source] @@ -74735,10 +75599,10 @@ var ts; // _super.call(this, a) // _super.m.call(this, a) // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 98 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), node.expression.kind === 99 /* SuperKeyword */ ? thisArg : ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), /*location*/ node); } - if (node.expression.kind === 98 /* SuperKeyword */) { + if (node.expression.kind === 99 /* SuperKeyword */) { var initializer = ts.createLogicalOr(resultingCall, createActualThis()); resultingCall = assignToCapturedThis ? ts.createAssignment(ts.createFileLevelUniqueName("_this"), initializer) @@ -74801,7 +75665,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 187 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 188 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -75016,8 +75880,8 @@ var ts; : ts.createFileLevelUniqueName("_super"); } function visitMetaProperty(node) { - if (node.keywordToken === 95 /* NewKeyword */ && node.name.escapedText === "target") { - hierarchyFacts |= 8192 /* NewTarget */; + if (node.keywordToken === 96 /* NewKeyword */ && node.name.escapedText === "target") { + hierarchyFacts |= 16384 /* NewTarget */; return ts.createFileLevelUniqueName("_newTarget"); } return node; @@ -75032,7 +75896,7 @@ var ts; function onEmitNode(hint, node, emitCallback) { if (enabledSubstitutions & 1 /* CapturedThis */ && ts.isFunctionLike(node)) { // If we are tracking a captured `this`, keep track of the enclosing function. - var ancestorFacts = enterSubtree(8094 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */ + var ancestorFacts = enterSubtree(16286 /* FunctionExcludes */, ts.getEmitFlags(node) & 8 /* CapturesThis */ ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ : 65 /* FunctionIncludes */); previousOnEmitNode(hint, node, emitCallback); @@ -75048,7 +75912,7 @@ var ts; function enableSubstitutionsForBlockScopedBindings() { if ((enabledSubstitutions & 2 /* BlockScopedBindings */) === 0) { enabledSubstitutions |= 2 /* BlockScopedBindings */; - context.enableSubstitution(72 /* Identifier */); + context.enableSubstitution(73 /* Identifier */); } } /** @@ -75058,14 +75922,14 @@ var ts; function enableSubstitutionsForCapturedThis() { if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; - context.enableSubstitution(100 /* ThisKeyword */); - context.enableEmitNotification(157 /* Constructor */); - context.enableEmitNotification(156 /* MethodDeclaration */); - context.enableEmitNotification(158 /* GetAccessor */); - context.enableEmitNotification(159 /* SetAccessor */); - context.enableEmitNotification(197 /* ArrowFunction */); - context.enableEmitNotification(196 /* FunctionExpression */); - context.enableEmitNotification(239 /* FunctionDeclaration */); + context.enableSubstitution(101 /* ThisKeyword */); + context.enableEmitNotification(158 /* Constructor */); + context.enableEmitNotification(157 /* MethodDeclaration */); + context.enableEmitNotification(159 /* GetAccessor */); + context.enableEmitNotification(160 /* SetAccessor */); + context.enableEmitNotification(198 /* ArrowFunction */); + context.enableEmitNotification(197 /* FunctionExpression */); + context.enableEmitNotification(240 /* FunctionDeclaration */); } } /** @@ -75106,10 +75970,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 186 /* BindingElement */: - case 240 /* ClassDeclaration */: - case 243 /* EnumDeclaration */: - case 237 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 241 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: + case 238 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -75122,9 +75986,9 @@ var ts; */ function substituteExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return substituteExpressionIdentifier(node); - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return substituteThisKeyword(node); } return node; @@ -75191,19 +76055,19 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 221 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 222 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 191 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 192 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; - if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 98 /* SuperKeyword */) { + if (!ts.nodeIsSynthesized(callTarget) || callTarget.kind !== 99 /* SuperKeyword */) { return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 208 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 209 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -75256,15 +76120,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(262 /* JsxOpeningElement */); - context.enableEmitNotification(263 /* JsxClosingElement */); - context.enableEmitNotification(261 /* JsxSelfClosingElement */); + context.enableEmitNotification(263 /* JsxOpeningElement */); + context.enableEmitNotification(264 /* JsxClosingElement */); + context.enableEmitNotification(262 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(189 /* PropertyAccessExpression */); - context.enableSubstitution(275 /* PropertyAssignment */); + context.enableSubstitution(190 /* PropertyAccessExpression */); + context.enableSubstitution(276 /* PropertyAssignment */); return ts.chainBundle(transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -75283,9 +76147,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 262 /* JsxOpeningElement */: - case 263 /* JsxClosingElement */: - case 261 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: + case 264 /* JsxClosingElement */: + case 262 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -75342,7 +76206,7 @@ var ts; */ function trySubstituteReservedName(name) { var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined); - if (token !== undefined && token >= 73 /* FirstReservedWord */ && token <= 108 /* LastReservedWord */) { + if (token !== undefined && token >= 74 /* FirstReservedWord */ && token <= 109 /* LastReservedWord */) { return ts.setTextRange(ts.createLiteral(name), name); } return undefined; @@ -75617,13 +76481,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 223 /* DoStatement */: + case 224 /* DoStatement */: return visitDoStatement(node); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return visitWhileStatement(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return visitSwitchStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -75636,24 +76500,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return visitFunctionExpression(node); - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return visitAccessorDeclaration(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitVariableStatement(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitForInStatement(node); - case 229 /* BreakStatement */: + case 230 /* BreakStatement */: return visitBreakStatement(node); - case 228 /* ContinueStatement */: + case 229 /* ContinueStatement */: return visitContinueStatement(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 131072 /* ContainsYield */) { @@ -75674,21 +76538,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return visitBinaryExpression(node); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return visitConditionalExpression(node); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return visitYieldExpression(node); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return visitCallExpression(node); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -75701,9 +76565,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -75902,23 +76766,23 @@ var ts; } } function isCompoundAssignment(kind) { - return kind >= 60 /* FirstCompoundAssignment */ - && kind <= 71 /* LastCompoundAssignment */; + return kind >= 61 /* FirstCompoundAssignment */ + && kind <= 72 /* LastCompoundAssignment */; } function getOperatorForCompoundAssignment(kind) { switch (kind) { - case 60 /* PlusEqualsToken */: return 38 /* PlusToken */; - case 61 /* MinusEqualsToken */: return 39 /* MinusToken */; - case 62 /* AsteriskEqualsToken */: return 40 /* AsteriskToken */; - case 63 /* AsteriskAsteriskEqualsToken */: return 41 /* AsteriskAsteriskToken */; - case 64 /* SlashEqualsToken */: return 42 /* SlashToken */; - case 65 /* PercentEqualsToken */: return 43 /* PercentToken */; - case 66 /* LessThanLessThanEqualsToken */: return 46 /* LessThanLessThanToken */; - case 67 /* GreaterThanGreaterThanEqualsToken */: return 47 /* GreaterThanGreaterThanToken */; - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 48 /* GreaterThanGreaterThanGreaterThanToken */; - case 69 /* AmpersandEqualsToken */: return 49 /* AmpersandToken */; - case 70 /* BarEqualsToken */: return 50 /* BarToken */; - case 71 /* CaretEqualsToken */: return 51 /* CaretToken */; + case 61 /* PlusEqualsToken */: return 38 /* PlusToken */; + case 62 /* MinusEqualsToken */: return 39 /* MinusToken */; + case 63 /* AsteriskEqualsToken */: return 40 /* AsteriskToken */; + case 64 /* AsteriskAsteriskEqualsToken */: return 41 /* AsteriskAsteriskToken */; + case 65 /* SlashEqualsToken */: return 42 /* SlashToken */; + case 66 /* PercentEqualsToken */: return 43 /* PercentToken */; + case 67 /* LessThanLessThanEqualsToken */: return 46 /* LessThanLessThanToken */; + case 68 /* GreaterThanGreaterThanEqualsToken */: return 47 /* GreaterThanGreaterThanToken */; + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 48 /* GreaterThanGreaterThanGreaterThanToken */; + case 70 /* AmpersandEqualsToken */: return 49 /* AmpersandToken */; + case 71 /* BarEqualsToken */: return 50 /* BarToken */; + case 72 /* CaretEqualsToken */: return 51 /* CaretToken */; } } /** @@ -75931,7 +76795,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -75943,7 +76807,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -76319,35 +77183,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 218 /* Block */: + case 219 /* Block */: return transformAndEmitBlock(node); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 222 /* IfStatement */: + case 223 /* IfStatement */: return transformAndEmitIfStatement(node); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return transformAndEmitDoStatement(node); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return transformAndEmitForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 228 /* ContinueStatement */: + case 229 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 229 /* BreakStatement */: + case 230 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return transformAndEmitWithStatement(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -76777,7 +77641,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 272 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 273 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -76790,7 +77654,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 271 /* CaseClause */) { + if (clause.kind === 272 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -77102,7 +77966,7 @@ var ts; if (!renamedCatchVariables) { renamedCatchVariables = ts.createMap(); renamedCatchVariableDeclarations = []; - context.enableSubstitution(72 /* Identifier */); + context.enableSubstitution(73 /* Identifier */); } renamedCatchVariables.set(text, true); renamedCatchVariableDeclarations[ts.getOriginalNodeId(variable)] = name; @@ -78018,12 +78882,12 @@ var ts; var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(72 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(204 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(202 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(203 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(276 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(284 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(73 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. + context.enableSubstitution(205 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(203 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(204 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(277 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(285 /* 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. @@ -78351,23 +79215,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return visitImportDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return visitExportDeclaration(node); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return visitExportAssignment(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitVariableStatement(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return visitClassDeclaration(node); - case 315 /* MergeDeclarationMarker */: + case 316 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 316 /* EndOfDeclarationMarker */: + case 317 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -78394,24 +79258,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -78889,7 +79753,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 219 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 220 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -78944,10 +79808,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 252 /* NamedImports */: + case 253 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -79129,8 +79993,8 @@ var ts; function modifierVisitor(node) { // Elide module-specific modifiers. switch (node.kind) { - case 85 /* ExportKeyword */: - case 80 /* DefaultKeyword */: + case 86 /* ExportKeyword */: + case 81 /* DefaultKeyword */: return undefined; } return node; @@ -79146,7 +80010,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -79208,12 +80072,12 @@ var ts; */ function substituteExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return substituteExpressionIdentifier(node); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return substituteBinaryExpression(node); - case 203 /* PostfixUnaryExpression */: - case 202 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -79234,7 +80098,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 284 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 285 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -79309,8 +80173,8 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 203 /* PostfixUnaryExpression */ - ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 44 /* PlusPlusToken */ ? 60 /* PlusEqualsToken */ : 61 /* MinusEqualsToken */), ts.createLiteral(1)), + var expression = node.kind === 204 /* PostfixUnaryExpression */ + ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 44 /* PlusPlusToken */ ? 61 /* PlusEqualsToken */ : 62 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { @@ -79384,12 +80248,12 @@ var ts; var previousOnEmitNode = context.onEmitNode; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; - context.enableSubstitution(72 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(276 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(204 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(202 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(203 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(284 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(73 /* Identifier */); // Substitutes expression identifiers for imported symbols. + context.enableSubstitution(277 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(205 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(203 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(204 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(285 /* 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. @@ -79610,7 +80474,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 255 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 256 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -79635,7 +80499,7 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 255 /* ExportDeclaration */) { + if (externalImport.kind !== 256 /* ExportDeclaration */) { continue; } if (!externalImport.exportClause) { @@ -79713,19 +80577,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createExpressionStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -79775,15 +80639,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return visitImportDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -79959,7 +80823,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 === 284 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 285 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -80023,7 +80887,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 === 219 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 220 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -80085,10 +80949,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 252 /* NamedImports */: + case 253 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -80268,43 +81132,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return visitVariableStatement(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return visitClassDeclaration(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return visitForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return visitForInStatement(node); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return visitForOfStatement(node); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return visitDoStatement(node); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return visitWhileStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return visitLabeledStatement(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return visitWithStatement(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return visitSwitchStatement(node); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return visitCaseBlock(node); - case 271 /* CaseClause */: + case 272 /* CaseClause */: return visitCaseClause(node); - case 272 /* DefaultClause */: + case 273 /* DefaultClause */: return visitDefaultClause(node); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return visitTryStatement(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return visitCatchClause(node); - case 218 /* Block */: + case 219 /* Block */: return visitBlock(node); - case 315 /* MergeDeclarationMarker */: + case 316 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 316 /* EndOfDeclarationMarker */: + case 317 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -80551,7 +81415,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 284 /* SourceFile */; + return container !== undefined && container.kind === 285 /* SourceFile */; } else { return false; @@ -80567,8 +81431,8 @@ var ts; */ function modifierVisitor(node) { switch (node.kind) { - case 85 /* ExportKeyword */: - case 80 /* DefaultKeyword */: + case 86 /* ExportKeyword */: + case 81 /* DefaultKeyword */: return undefined; } return node; @@ -80584,7 +81448,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -80632,7 +81496,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -80666,12 +81530,12 @@ var ts; */ function substituteExpression(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return substituteExpressionIdentifier(node); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return substituteBinaryExpression(node); - case 202 /* PrefixUnaryExpression */: - case 203 /* PostfixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -80764,14 +81628,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 203 /* PostfixUnaryExpression */ + var expression = node.kind === 204 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(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 === 203 /* PostfixUnaryExpression */) { + if (node.kind === 204 /* PostfixUnaryExpression */) { expression = node.operator === 44 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -80793,7 +81657,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 284 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 285 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -80832,8 +81696,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(284 /* SourceFile */); - context.enableSubstitution(72 /* Identifier */); + context.enableEmitNotification(285 /* SourceFile */); + context.enableSubstitution(73 /* Identifier */); var currentSourceFile; return ts.chainBundle(transformSourceFile); function transformSourceFile(node) { @@ -80861,10 +81725,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -80972,7 +81836,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 === 240 /* ClassDeclaration */) { + else if (node.parent.kind === 241 /* 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 : @@ -81001,7 +81865,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 === 240 /* ClassDeclaration */) { + else if (node.parent.kind === 241 /* 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 : @@ -81048,7 +81912,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 === 237 /* VariableDeclaration */ || node.kind === 186 /* BindingElement */) { + if (node.kind === 238 /* VariableDeclaration */ || node.kind === 187 /* 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 : @@ -81057,8 +81921,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 === 154 /* PropertyDeclaration */ || node.kind === 189 /* PropertyAccessExpression */ || node.kind === 153 /* PropertySignature */ || - (node.kind === 151 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 155 /* PropertyDeclaration */ || node.kind === 190 /* PropertyAccessExpression */ || node.kind === 154 /* PropertySignature */ || + (node.kind === 152 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -81067,7 +81931,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 === 240 /* ClassDeclaration */ || node.kind === 151 /* Parameter */) { + else if (node.parent.kind === 241 /* ClassDeclaration */ || node.kind === 152 /* 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 : @@ -81092,7 +81956,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 159 /* SetAccessor */) { + if (node.kind === 160 /* 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.hasModifier(node, 32 /* Static */)) { @@ -81131,26 +81995,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 161 /* ConstructSignature */: + case 162 /* 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 160 /* CallSignature */: + case 161 /* 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 162 /* IndexSignature */: + case 163 /* 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 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -81158,7 +82022,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 === 240 /* ClassDeclaration */) { + else if (node.parent.kind === 241 /* 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 : @@ -81172,7 +82036,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 239 /* FunctionDeclaration */: + case 240 /* 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 : @@ -81197,30 +82061,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 157 /* Constructor */: + case 158 /* 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 161 /* ConstructSignature */: - case 166 /* ConstructorType */: + case 162 /* ConstructSignature */: + case 167 /* 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 160 /* CallSignature */: + case 161 /* 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 162 /* IndexSignature */: + case 163 /* 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 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -81228,7 +82092,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 === 240 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 241 /* 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 : @@ -81241,8 +82105,8 @@ 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 239 /* FunctionDeclaration */: - case 165 /* FunctionType */: + case 240 /* FunctionDeclaration */: + case 166 /* 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 : @@ -81256,39 +82120,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 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 181 /* MappedType */: + case 182 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 166 /* ConstructorType */: - case 161 /* ConstructSignature */: + case 167 /* ConstructorType */: + case 162 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 160 /* CallSignature */: + case 161 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: if (ts.hasModifier(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 === 240 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 241 /* 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 165 /* FunctionType */: - case 239 /* FunctionDeclaration */: + case 166 /* FunctionType */: + case 240 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -81303,9 +82167,9 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 240 /* ClassDeclaration */) { + if (node.parent.parent.kind === 241 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible - diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 109 /* ImplementsKeyword */ ? + diagnosticMessage = ts.isHeritageClause(node.parent) && node.parent.token === 110 /* ImplementsKeyword */ ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } @@ -81354,7 +82218,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 151 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 152 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -81501,10 +82365,10 @@ var ts; } } function transformRoot(node) { - if (node.kind === 284 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { + if (node.kind === 285 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; } - if (node.kind === 285 /* Bundle */) { + if (node.kind === 286 /* Bundle */) { isBundledEmit = true; refs = ts.createMap(); libs = ts.createMap(); @@ -81527,14 +82391,14 @@ var ts; resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules) needsDeclare = false; var statements_4 = ts.visitNodes(sourceFile.statements, visitDeclarationStatements); - var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(125 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements_4)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); + var newFile = ts.updateSourceFileNode(sourceFile, [ts.createModuleDeclaration([], [ts.createModifier(126 /* DeclareKeyword */)], ts.createLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), ts.createModuleBlock(ts.setTextRange(ts.createNodeArray(transformAndReplaceLatePaintedStatements(statements_4)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); return newFile; } needsDeclare = true; var updated = ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 287 /* InputFiles */) { + if (prepend.kind === 288 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -81654,11 +82518,11 @@ var ts; return ret; } function filterBindingPatternInitializers(name) { - if (name.kind === 72 /* Identifier */) { + if (name.kind === 73 /* Identifier */) { return name; } else { - if (name.kind === 185 /* ArrayBindingPattern */) { + if (name.kind === 186 /* ArrayBindingPattern */) { return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -81666,7 +82530,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 210 /* OmittedExpression */) { + if (elem.kind === 211 /* OmittedExpression */) { return elem; } return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -81704,19 +82568,19 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 151 /* Parameter */ && + var shouldUseResolverType = node.kind === 152 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { return ts.visitNode(type, visitDeclarationSubtree); } if (!ts.getParseTreeNode(node)) { - return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(121 /* AnyKeyword */); } - if (node.kind === 159 /* SetAccessor */) { + if (node.kind === 160 /* 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 ts.createKeywordTypeNode(120 /* AnyKeyword */); + return ts.createKeywordTypeNode(121 /* AnyKeyword */); } errorNameNode = node.name; var oldDiag; @@ -81724,12 +82588,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 237 /* VariableDeclaration */ || node.kind === 186 /* BindingElement */) { + if (node.kind === 238 /* VariableDeclaration */ || node.kind === 187 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 151 /* Parameter */ - || node.kind === 154 /* PropertyDeclaration */ - || node.kind === 153 /* PropertySignature */) { + if (node.kind === 152 /* Parameter */ + || node.kind === 155 /* PropertyDeclaration */ + || node.kind === 154 /* 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)); @@ -81740,26 +82604,26 @@ var ts; if (!suppressNewDiagnosticContexts) { getSymbolAccessibilityDiagnostic = oldDiag; } - return returnValue || ts.createKeywordTypeNode(120 /* AnyKeyword */); + return returnValue || ts.createKeywordTypeNode(121 /* AnyKeyword */); } } function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 244 /* ModuleDeclaration */: - case 241 /* InterfaceDeclaration */: - case 240 /* ClassDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 243 /* EnumDeclaration */: + case 240 /* FunctionDeclaration */: + case 245 /* ModuleDeclaration */: + case 242 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 244 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 248 /* ImportEqualsDeclaration */: - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: - case 254 /* ExportAssignment */: + case 249 /* ImportEqualsDeclaration */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: + case 255 /* ExportAssignment */: return false; } return false; @@ -81813,7 +82677,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 244 /* ModuleDeclaration */ && parent.kind !== 183 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 245 /* ModuleDeclaration */ && parent.kind !== 184 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -81833,7 +82697,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 259 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 260 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return ts.updateImportEqualsDeclaration(decl, @@ -81860,7 +82724,7 @@ var ts; return visibleDefaultBinding && ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 251 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 252 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? ts.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -81968,68 +82832,68 @@ var ts; checkEntityNameVisibility(input.exprName, enclosingDeclaration); } var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 168 /* TypeLiteral */ || input.kind === 181 /* MappedType */) && input.parent.kind !== 242 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 169 /* TypeLiteral */ || input.kind === 182 /* MappedType */) && input.parent.kind !== 243 /* TypeAliasDeclaration */); if (shouldEnterSuppressNewDiagnosticsContextContext) { // We stop making new diagnostic contexts within object literal types. Unless it's an object type on the RHS of a type alias declaration. Then we do. suppressNewDiagnosticContexts = true; } if (isProcessedComponent(input)) { switch (input.kind) { - case 211 /* ExpressionWithTypeArguments */: { + case 212 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateExpressionWithTypeArguments(node, ts.parenthesizeTypeParameters(node.typeArguments), node.expression)); } - case 164 /* TypeReference */: { + case 165 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments))); } - case 161 /* ConstructSignature */: + case 162 /* ConstructSignature */: return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 157 /* Constructor */: { + case 158 /* Constructor */: { var isPrivate = ts.hasModifier(input, 8 /* Private */); // A constructor declaration may not have a type annotation - var ctor = ts.createSignatureDeclaration(157 /* Constructor */, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), + var ctor = ts.createSignatureDeclaration(158 /* Constructor */, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), // TODO: GH#18217 isPrivate ? undefined : updateParamsList(input, input.parameters, 0 /* None */), /*type*/ undefined); ctor.modifiers = ts.createNodeArray(ensureModifiers(input)); return cleanup(ctor); } - case 156 /* MethodDeclaration */: { - var sig = ts.createSignatureDeclaration(155 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); + case 157 /* MethodDeclaration */: { + var sig = ts.createSignatureDeclaration(156 /* MethodSignature */, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)); sig.name = input.name; sig.modifiers = ts.createNodeArray(ensureModifiers(input)); sig.questionToken = input.questionToken; return cleanup(sig); } - case 158 /* GetAccessor */: { + case 159 /* GetAccessor */: { var newNode = ensureAccessor(input); return cleanup(newNode); } - case 159 /* SetAccessor */: { + case 160 /* SetAccessor */: { var newNode = ensureAccessor(input); return cleanup(newNode); } - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return cleanup(ts.updateProperty(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8 /* Private */) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input))); - case 153 /* PropertySignature */: + case 154 /* PropertySignature */: return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8 /* Private */) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input))); - case 155 /* MethodSignature */: { + case 156 /* MethodSignature */: { return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken)); } - case 160 /* CallSignature */: { + case 161 /* CallSignature */: { return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 162 /* IndexSignature */: { + case 163 /* IndexSignature */: { return cleanup(ts.updateIndexSignature(input, - /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(120 /* AnyKeyword */))); + /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(121 /* AnyKeyword */))); } - case 237 /* VariableDeclaration */: { + case 238 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -82037,13 +82901,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(ts.updateVariableDeclaration(input, input.name, ensureType(input, input.type), ensureNoInitializer(input))); } - case 150 /* TypeParameter */: { + case 151 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(ts.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 175 /* ConditionalType */: { + case 176 /* 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); @@ -82055,13 +82919,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 165 /* FunctionType */: { + case 166 /* FunctionType */: { return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 166 /* ConstructorType */: { + case 167 /* ConstructorType */: { return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 183 /* ImportType */: { + case 184 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(ts.updateImportTypeNode(input, ts.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -82090,7 +82954,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 156 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 157 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -82100,7 +82964,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 255 /* ExportDeclaration */: { + case 256 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; resultHasScopeMarker = true; @@ -82109,13 +82973,13 @@ var ts; // Rewrite external module names if necessary return ts.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 254 /* ExportAssignment */: { + case 255 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; resultHasScopeMarker = true; } - if (input.expression.kind === 72 /* Identifier */) { + if (input.expression.kind === 73 /* Identifier */) { return input; } else { @@ -82125,7 +82989,7 @@ var ts; errorNode: input }); }; var varDecl = ts.createVariableDeclaration(newId, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(125 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(126 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); return [statement, ts.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } @@ -82139,10 +83003,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 248 /* ImportEqualsDeclaration */: { + case 249 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 249 /* ImportDeclaration */: { + case 250 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -82163,41 +83027,63 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 242 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 243 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(ts.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input, isPrivate), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 241 /* InterfaceDeclaration */: { + case 242 /* InterfaceDeclaration */: { return cleanup(ts.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input, isPrivate), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 239 /* FunctionDeclaration */: { + case 240 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(ts.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input, isPrivate), /*asteriskToken*/ undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), /*body*/ undefined)); if (clean && resolver.isExpandoFunctionDeclaration(input)) { - var declarations = ts.mapDefined(resolver.getPropertiesOfContainerFunction(input), function (p) { + var props = resolver.getPropertiesOfContainerFunction(input); + var fakespace_1 = ts.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, clean.name || ts.createIdentifier("_default"), ts.createModuleBlock([]), 16 /* Namespace */); + fakespace_1.flags ^= 8 /* Synthesized */; // unset synthesized so it is usable as an enclosing declaration + fakespace_1.parent = enclosingDeclaration; + fakespace_1.locals = ts.createSymbolTable(props); + fakespace_1.symbol = props[0].parent; + var declarations = ts.mapDefined(props, function (p) { if (!ts.isPropertyAccessExpression(p.valueDeclaration)) { return undefined; } getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration); - var type = resolver.createTypeOfDeclaration(p.valueDeclaration, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker); + var type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace_1, declarationEmitNodeBuilderFlags, symbolTracker); getSymbolAccessibilityDiagnostic = oldDiag; var varDecl = ts.createVariableDeclaration(ts.unescapeLeadingUnderscores(p.escapedName), type, /*initializer*/ undefined); return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([varDecl])); }); var namespaceDecl = ts.createModuleDeclaration(/*decorators*/ undefined, ensureModifiers(input, isPrivate), input.name, ts.createModuleBlock(declarations), 16 /* Namespace */); - return [clean, namespaceDecl]; + if (!ts.hasModifier(clean, 512 /* Default */)) { + return [clean, namespaceDecl]; + } + var modifiers = ts.createModifiersFromModifierFlags((ts.getModifierFlags(clean) & ~513 /* ExportDefault */) | 2 /* Ambient */); + var cleanDeclaration = ts.updateFunctionDeclaration(clean, + /*decorators*/ undefined, modifiers, + /*asteriskToken*/ undefined, clean.name, clean.typeParameters, clean.parameters, clean.type, + /*body*/ undefined); + var namespaceDeclaration = ts.updateModuleDeclaration(namespaceDecl, + /*decorators*/ undefined, modifiers, namespaceDecl.name, namespaceDecl.body); + var exportDefaultDeclaration = ts.createExportAssignment( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*isExportEquals*/ false, namespaceDecl.name); + resultHasExternalModuleIndicator = true; + resultHasScopeMarker = true; + return [cleanDeclaration, namespaceDeclaration, exportDefaultDeclaration]; } else { return clean; } } - case 244 /* ModuleDeclaration */: { + case 245 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 245 /* ModuleBlock */) { + if (inner && inner.kind === 246 /* ModuleBlock */) { var statements = ts.visitNodes(inner.statements, visitDeclarationStatements); var body = ts.updateModuleBlock(inner, transformAndReplaceLatePaintedStatements(statements)); needsDeclare = previousNeedsDeclare; @@ -82218,7 +83104,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 240 /* ClassDeclaration */: { + case 241 /* ClassDeclaration */: { var modifiers = ts.createNodeArray(ensureModifiers(input, isPrivate)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -82229,7 +83115,7 @@ var ts; if (!ts.hasModifier(param, 92 /* ParameterPropertyModifier */) || shouldStripInternal(param)) return; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(param); - if (param.name.kind === 72 /* Identifier */) { + if (param.name.kind === 73 /* Identifier */) { return preserveJsDoc(ts.createProperty( /*decorators*/ undefined, ensureModifiers(param), param.name, param.questionToken, ensureType(param, param.type), ensureNoInitializer(param)), param); } @@ -82259,7 +83145,7 @@ var ts; } var members = ts.createNodeArray(ts.concatenate(parameterProperties, ts.visitNodes(input.members, visitDeclarationSubtree))); var extendsClause_1 = ts.getEffectiveBaseTypeNode(input); - if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 96 /* NullKeyword */) { + if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 97 /* NullKeyword */) { // We must add a temporary declaration for the extends clause expression var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default"; var newId_1 = ts.createOptimisticUniqueName(oldId + "_base"); @@ -82269,16 +83155,16 @@ var ts; typeName: input.name }); }; var varDecl = ts.createVariableDeclaration(newId_1, resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); - var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(125 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); + var statement = ts.createVariableStatement(needsDeclare ? [ts.createModifier(126 /* DeclareKeyword */)] : [], ts.createVariableDeclarationList([varDecl], 2 /* Const */)); var heritageClauses = ts.createNodeArray(ts.map(input.heritageClauses, function (clause) { - if (clause.token === 86 /* ExtendsKeyword */) { + if (clause.token === 87 /* ExtendsKeyword */) { var oldDiag_2 = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); var newClause = ts.updateHeritageClause(clause, ts.map(clause.types, function (t) { return ts.updateExpressionWithTypeArguments(t, ts.visitNodes(t.typeArguments, visitDeclarationSubtree), newId_1); })); getSymbolAccessibilityDiagnostic = oldDiag_2; return newClause; } - return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 96 /* NullKeyword */; })), visitDeclarationSubtree)); + return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 97 /* NullKeyword */; })), visitDeclarationSubtree)); })); return [statement, cleanup(ts.updateClassDeclaration(input, /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217 @@ -82289,10 +83175,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 219 /* VariableStatement */: { + case 220 /* VariableStatement */: { return cleanup(transformVariableStatement(input, isPrivate)); } - case 243 /* EnumDeclaration */: { + case 244 /* EnumDeclaration */: { return cleanup(ts.updateEnumDeclaration(input, /*decorators*/ undefined, ts.createNodeArray(ensureModifiers(input, isPrivate)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -82311,7 +83197,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 244 /* ModuleDeclaration */) { + if (input.kind === 245 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -82332,7 +83218,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 210 /* OmittedExpression */) { + if (e.kind === 211 /* OmittedExpression */) { return; } if (e.name) { @@ -82385,7 +83271,7 @@ var ts; function ensureModifierFlags(node, privateDeclaration) { var mask = 3071 /* 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 === 284 /* SourceFile */; + var parentIsFile = node.parent.kind === 285 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */); additions = 0 /* None */; @@ -82406,7 +83292,7 @@ var ts; var prop = ts.createProperty(/*decorators*/ undefined, maskModifiers(node, /*mask*/ undefined, (!accessors.setAccessor) ? 64 /* Readonly */ : 0 /* None */), node.name, node.questionToken, ensureType(node, accessorType), /*initializer*/ undefined); var leadingsSyntheticCommentRanges = accessors.secondAccessor && ts.getLeadingCommentRangesOfNode(accessors.secondAccessor, currentSourceFile); if (leadingsSyntheticCommentRanges) { - var _loop_10 = function (range) { + var _loop_13 = function (range) { if (range.kind === 3 /* MultiLineCommentTrivia */) { var text = currentSourceFile.text.slice(range.pos + 2, range.end - 2); var lines = text.split(/\r\n?|\n/g); @@ -82420,20 +83306,20 @@ var ts; }; for (var _i = 0, leadingsSyntheticCommentRanges_1 = leadingsSyntheticCommentRanges; _i < leadingsSyntheticCommentRanges_1.length; _i++) { var range = leadingsSyntheticCommentRanges_1[_i]; - _loop_10(range); + _loop_13(range); } } return prop; } function transformHeritageClauses(nodes) { return ts.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return ts.updateHeritageClause(clause, ts.visitNodes(ts.createNodeArray(ts.filter(clause.types, function (t) { - return ts.isEntityNameExpression(t.expression) || (clause.token === 86 /* ExtendsKeyword */ && t.expression.kind === 96 /* NullKeyword */); + return ts.isEntityNameExpression(t.expression) || (clause.token === 87 /* ExtendsKeyword */ && t.expression.kind === 97 /* NullKeyword */); })), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; })); } } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 241 /* InterfaceDeclaration */) { + if (node.kind === 242 /* InterfaceDeclaration */) { return true; } return false; @@ -82458,7 +83344,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 158 /* GetAccessor */ + return accessor.kind === 159 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -82467,52 +83353,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return !ts.hasModifier(node, 8 /* Private */); - case 151 /* Parameter */: - case 237 /* VariableDeclaration */: + case 152 /* Parameter */: + case 238 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 244 /* ModuleDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 241 /* InterfaceDeclaration */: - case 240 /* ClassDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 243 /* EnumDeclaration */: - case 219 /* VariableStatement */: - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: - case 254 /* ExportAssignment */: + case 240 /* FunctionDeclaration */: + case 245 /* ModuleDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 242 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 244 /* EnumDeclaration */: + case 220 /* VariableStatement */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: + case 255 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 161 /* ConstructSignature */: - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 162 /* IndexSignature */: - case 237 /* VariableDeclaration */: - case 150 /* TypeParameter */: - case 211 /* ExpressionWithTypeArguments */: - case 164 /* TypeReference */: - case 175 /* ConditionalType */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 183 /* ImportType */: + case 162 /* ConstructSignature */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 163 /* IndexSignature */: + case 238 /* VariableDeclaration */: + case 151 /* TypeParameter */: + case 212 /* ExpressionWithTypeArguments */: + case 165 /* TypeReference */: + case 176 /* ConditionalType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 184 /* ImportType */: return true; } return false; @@ -82544,17 +83430,27 @@ var ts; SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["Substitution"] = 1] = "Substitution"; SyntaxKindFeatureFlags[SyntaxKindFeatureFlags["EmitNotifications"] = 2] = "EmitNotifications"; })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); - function getTransformers(compilerOptions, customTransformers) { + ts.noTransformers = { scriptTransformers: ts.emptyArray, declarationTransformers: ts.emptyArray }; + function getTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { + return { + scriptTransformers: getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles), + declarationTransformers: getDeclarationTransformers(customTransformers), + }; + } + ts.getTransformers = getTransformers; + 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 && customTransformers.before); + ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } - if (languageVersion < 7 /* ESNext */) { + if (languageVersion < 8 /* ESNext */) { transformers.push(ts.transformESNext); } if (languageVersion < 6 /* ES2019 */) { @@ -82579,10 +83475,38 @@ var ts; if (languageVersion < 1 /* ES5 */) { transformers.push(ts.transformES5); } - ts.addRange(transformers, customTransformers && customTransformers.after); + ts.addRange(transformers, customTransformers && ts.map(customTransformers.after, wrapScriptTransformerFactory)); return transformers; } - ts.getTransformers = getTransformers; + function getDeclarationTransformers(customTransformers) { + var transformers = []; + transformers.push(ts.transformDeclarations); + ts.addRange(transformers, customTransformers && ts.map(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory)); + return transformers; + } + /** + * Wrap a custom script or declaration transformer object in a `Transformer` callback with fallback support for transforming bundles. + */ + function wrapCustomTransformer(transformer) { + return function (node) { return ts.isBundle(node) ? transformer.transformBundle(node) : transformer.transformSourceFile(node); }; + } + /** + * Wrap a transformer factory that may return a custom script or declaration transformer object. + */ + function wrapCustomTransformerFactory(transformer, handleDefault) { + return function (context) { + var customTransformer = transformer(context); + return typeof customTransformer === "function" + ? handleDefault(customTransformer) + : wrapCustomTransformer(customTransformer); + }; + } + function wrapScriptTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, ts.chainBundle); + } + function wrapDeclarationTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, ts.identity); + } function noEmitSubstitution(_hint, node) { return node; } @@ -82602,7 +83526,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(317 /* Count */); + var enabledSyntaxKindFeatures = new Array(318 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -82655,7 +83579,14 @@ var ts; } ts.performance.mark("beforeTransform"); // Chain together and initialize each transformer. - var transformation = ts.chain.apply(void 0, transformers)(context); + var transformersWithContext = transformers.map(function (t) { return t(context); }); + var transformation = function (node) { + for (var _i = 0, transformersWithContext_1 = transformersWithContext; _i < transformersWithContext_1.length; _i++) { + var transform = transformersWithContext_1[_i]; + node = transform(node); + } + return node; + }; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. @@ -82807,6 +83738,7 @@ var ts; if (lexicalEnvironmentVariableDeclarations) { var statement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations)); + ts.setEmitFlags(statement, 1048576 /* CustomPrologue */); if (!statements) { statements = [statement]; } @@ -82914,7 +83846,7 @@ var ts; /*@internal*/ function getOutputPathForBuildInfo(options) { var configFile = options.configFilePath; - if (!configFile || !ts.isIncrementalCompilation(options)) + if (!ts.isIncrementalCompilation(options)) return undefined; if (options.tsBuildInfoFile) return options.tsBuildInfoFile; @@ -82924,6 +83856,8 @@ var ts; buildInfoExtensionLess = ts.removeFileExtension(outPath); } else { + if (!configFile) + return undefined; var configFileExtensionLess = ts.removeFileExtension(configFile); buildInfoExtensionLess = options.outDir ? options.rootDir ? @@ -82948,7 +83882,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 285 /* Bundle */) { + if (sourceFile.kind === 286 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -83075,14 +84009,15 @@ var ts; ts.getFirstProjectOutput = getFirstProjectOutput; /*@internal*/ // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature - function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles, transformers, declarationTransformers, onlyBuildInfo) { + function emitFiles(resolver, host, targetSourceFile, _a, emitOnlyDtsFiles, onlyBuildInfo) { + var scriptTransformers = _a.scriptTransformers, declarationTransformers = _a.declarationTransformers; var compilerOptions = host.getCompilerOptions(); var sourceMapDataList = (compilerOptions.sourceMap || compilerOptions.inlineSourceMap || ts.getAreDeclarationMapsEnabled(compilerOptions)) ? [] : undefined; var emittedFilesList = compilerOptions.listEmittedFiles ? [] : undefined; var emitterDiagnostics = ts.createDiagnosticCollection(); var newLine = ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); }); var writer = ts.createTextWriter(newLine); - var _a = ts.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _a.enter, exit = _a.exit; + var _b = ts.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _b.enter, exit = _b.exit; var bundleBuildInfo; var emitSkipped = false; var exportedModulesFromDeclarationEmit; @@ -83151,7 +84086,7 @@ var ts; return; } // Transform the source files - var transform = ts.transformNodes(resolver, host, compilerOptions, [sourceFileOrBundle], transformers, /*allowDtsFiles*/ false); + var transform = ts.transformNodes(resolver, host, compilerOptions, [sourceFileOrBundle], scriptTransformers, /*allowDtsFiles*/ false); var printerOptions = { removeComments: compilerOptions.removeComments, newLine: compilerOptions.newLine, @@ -83192,7 +84127,7 @@ var ts; // Do that here when emitting only dts files nonJsFiles.forEach(collectLinkedAliases); } - var declarationTransform = ts.transformNodes(resolver, host, compilerOptions, inputListOrBundle, ts.concatenate([ts.transformDeclarations], declarationTransformers), /*allowDtsFiles*/ false); + var declarationTransform = ts.transformNodes(resolver, host, compilerOptions, inputListOrBundle, declarationTransformers, /*allowDtsFiles*/ false); if (ts.length(declarationTransform.diagnostics)) { for (var _a = 0, _b = declarationTransform.diagnostics; _a < _b.length; _a++) { var diagnostic = _b[_a]; @@ -83229,7 +84164,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === 284 /* SourceFile */) { + if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === 285 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -83240,7 +84175,7 @@ var ts; } function collectLinkedAliases(node) { if (ts.isExportAssignment(node)) { - if (node.expression.kind === 72 /* Identifier */) { + if (node.expression.kind === 73 /* Identifier */) { resolver.collectLinkedAliases(node.expression, /*setVisibility*/ true); } return; @@ -83252,8 +84187,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 285 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 284 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 286 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 285 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -83294,7 +84229,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 284 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 285 /* 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 @@ -83404,7 +84339,7 @@ var ts; }; function createSourceFilesFromBundleBuildInfo(bundle) { var sourceFiles = bundle.sourceFiles.map(function (fileName) { - var sourceFile = ts.createNode(284 /* SourceFile */, 0, 0); + var sourceFile = ts.createNode(285 /* SourceFile */, 0, 0); sourceFile.fileName = fileName; sourceFile.text = ""; sourceFile.statements = ts.createNodeArray(); @@ -83416,7 +84351,7 @@ var ts; sourceFile.text = prologueInfo.text; sourceFile.end = prologueInfo.text.length; sourceFile.statements = ts.createNodeArray(prologueInfo.directives.map(function (directive) { - var statement = ts.createNode(221 /* ExpressionStatement */, directive.pos, directive.end); + var statement = ts.createNode(222 /* ExpressionStatement */, directive.pos, directive.end); statement.expression = ts.createNode(10 /* StringLiteral */, directive.expression.pos, directive.expression.end); statement.expression.text = directive.expression.text; return statement; @@ -83508,7 +84443,7 @@ var ts; useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, getProgramBuildInfo: ts.returnUndefined }; - emitFiles(ts.notImplementedResolver, emitHost, /*targetSourceFile*/ undefined, /*emitOnlyDtsFiles*/ false, ts.getTransformers(config.options)); + emitFiles(ts.notImplementedResolver, emitHost, /*targetSourceFile*/ undefined, ts.getTransformers(config.options), /*emitOnlyDtsFiles*/ false); return outputFiles; } ts.emitUsingBuildInfo = emitUsingBuildInfo; @@ -83585,9 +84520,9 @@ var ts; break; } switch (node.kind) { - case 284 /* SourceFile */: return printFile(node); - case 285 /* Bundle */: return printBundle(node); - case 286 /* UnparsedSource */: return printUnparsedSource(node); + case 285 /* SourceFile */: return printFile(node); + case 286 /* Bundle */: return printBundle(node); + case 287 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -83817,12 +84752,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 284 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 285 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 284 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 285 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -83859,272 +84794,272 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node); - case 286 /* UnparsedSource */: - case 280 /* UnparsedPrepend */: + case 287 /* UnparsedSource */: + case 281 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 279 /* UnparsedPrologue */: + case 280 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 281 /* UnparsedText */: - case 282 /* UnparsedInternalText */: + case 282 /* UnparsedText */: + case 283 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 283 /* UnparsedSyntheticReference */: + case 284 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers - case 72 /* Identifier */: + case 73 /* Identifier */: return emitIdentifier(node); // Parse tree nodes // Names - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: return emitQualifiedName(node); - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: return emitTypeParameter(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return emitParameter(node); - case 152 /* Decorator */: + case 153 /* Decorator */: return emitDecorator(node); // Type members - case 153 /* PropertySignature */: + case 154 /* PropertySignature */: return emitPropertySignature(node); - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 155 /* MethodSignature */: + case 156 /* MethodSignature */: return emitMethodSignature(node); - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 157 /* Constructor */: + case 158 /* Constructor */: return emitConstructor(node); - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return emitAccessorDeclaration(node); - case 160 /* CallSignature */: + case 161 /* CallSignature */: return emitCallSignature(node); - case 161 /* ConstructSignature */: + case 162 /* ConstructSignature */: return emitConstructSignature(node); - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: return emitIndexSignature(node); // Types - case 163 /* TypePredicate */: + case 164 /* TypePredicate */: return emitTypePredicate(node); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return emitTypeReference(node); - case 165 /* FunctionType */: + case 166 /* FunctionType */: return emitFunctionType(node); - case 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 166 /* ConstructorType */: + case 167 /* ConstructorType */: return emitConstructorType(node); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return emitTypeQuery(node); - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return emitTypeLiteral(node); - case 169 /* ArrayType */: + case 170 /* ArrayType */: return emitArrayType(node); - case 170 /* TupleType */: + case 171 /* TupleType */: return emitTupleType(node); - case 171 /* OptionalType */: + case 172 /* OptionalType */: return emitOptionalType(node); - case 173 /* UnionType */: + case 174 /* UnionType */: return emitUnionType(node); - case 174 /* IntersectionType */: + case 175 /* IntersectionType */: return emitIntersectionType(node); - case 175 /* ConditionalType */: + case 176 /* ConditionalType */: return emitConditionalType(node); - case 176 /* InferType */: + case 177 /* InferType */: return emitInferType(node); - case 177 /* ParenthesizedType */: + case 178 /* ParenthesizedType */: return emitParenthesizedType(node); - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 178 /* ThisType */: + case 179 /* ThisType */: return emitThisType(); - case 179 /* TypeOperator */: + case 180 /* TypeOperator */: return emitTypeOperator(node); - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 181 /* MappedType */: + case 182 /* MappedType */: return emitMappedType(node); - case 182 /* LiteralType */: + case 183 /* LiteralType */: return emitLiteralType(node); - case 183 /* ImportType */: + case 184 /* ImportType */: return emitImportTypeNode(node); - case 289 /* JSDocAllType */: + case 290 /* JSDocAllType */: writePunctuation("*"); return; - case 290 /* JSDocUnknownType */: + case 291 /* JSDocUnknownType */: writePunctuation("?"); return; - case 291 /* JSDocNullableType */: + case 292 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 292 /* JSDocNonNullableType */: + case 293 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 293 /* JSDocOptionalType */: + case 294 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 172 /* RestType */: - case 295 /* JSDocVariadicType */: + case 173 /* RestType */: + case 296 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); // Binding patterns - case 184 /* ObjectBindingPattern */: + case 185 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 185 /* ArrayBindingPattern */: + case 186 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return emitBindingElement(node); // Misc - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: return emitTemplateSpan(node); - case 217 /* SemicolonClassElement */: + case 218 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 218 /* Block */: + case 219 /* Block */: return emitBlock(node); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return emitVariableStatement(node); - case 220 /* EmptyStatement */: + case 221 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return emitExpressionStatement(node); - case 222 /* IfStatement */: + case 223 /* IfStatement */: return emitIfStatement(node); - case 223 /* DoStatement */: + case 224 /* DoStatement */: return emitDoStatement(node); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: return emitWhileStatement(node); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return emitForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: return emitForInStatement(node); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: return emitForOfStatement(node); - case 228 /* ContinueStatement */: + case 229 /* ContinueStatement */: return emitContinueStatement(node); - case 229 /* BreakStatement */: + case 230 /* BreakStatement */: return emitBreakStatement(node); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: return emitReturnStatement(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: return emitWithStatement(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return emitSwitchStatement(node); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: return emitLabeledStatement(node); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: return emitThrowStatement(node); - case 235 /* TryStatement */: + case 236 /* TryStatement */: return emitTryStatement(node); - case 236 /* DebuggerStatement */: + case 237 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return emitClassDeclaration(node); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return emitModuleBlock(node); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return emitCaseBlock(node); - case 247 /* NamespaceExportDeclaration */: + case 248 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return emitImportDeclaration(node); - case 250 /* ImportClause */: + case 251 /* ImportClause */: return emitImportClause(node); - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: return emitNamespaceImport(node); - case 252 /* NamedImports */: + case 253 /* NamedImports */: return emitNamedImports(node); - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: return emitImportSpecifier(node); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: return emitExportAssignment(node); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: return emitExportDeclaration(node); - case 256 /* NamedExports */: + case 257 /* NamedExports */: return emitNamedExports(node); - case 257 /* ExportSpecifier */: + case 258 /* ExportSpecifier */: return emitExportSpecifier(node); - case 258 /* MissingDeclaration */: + case 259 /* MissingDeclaration */: return; // Module references - case 259 /* ExternalModuleReference */: + case 260 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 262 /* JsxOpeningElement */: - case 265 /* JsxOpeningFragment */: + case 263 /* JsxOpeningElement */: + case 266 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 263 /* JsxClosingElement */: - case 266 /* JsxClosingFragment */: + case 264 /* JsxClosingElement */: + case 267 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: return emitJsxAttribute(node); - case 268 /* JsxAttributes */: + case 269 /* JsxAttributes */: return emitJsxAttributes(node); - case 269 /* JsxSpreadAttribute */: + case 270 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 270 /* JsxExpression */: + case 271 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 271 /* CaseClause */: + case 272 /* CaseClause */: return emitCaseClause(node); - case 272 /* DefaultClause */: + case 273 /* DefaultClause */: return emitDefaultClause(node); - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: return emitHeritageClause(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 276 /* ShorthandPropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 277 /* SpreadAssignment */: + case 278 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 278 /* EnumMember */: + case 279 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 304 /* JSDocParameterTag */: - case 310 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: + case 311 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 305 /* JSDocReturnTag */: - case 307 /* JSDocTypeTag */: - case 306 /* JSDocThisTag */: - case 303 /* JSDocEnumTag */: + case 306 /* JSDocReturnTag */: + case 308 /* JSDocTypeTag */: + case 307 /* JSDocThisTag */: + case 304 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 300 /* JSDocAugmentsTag */: + case 301 /* JSDocAugmentsTag */: return emitJSDocAugmentsTag(node); - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 309 /* JSDocTypedefTag */: + case 310 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 302 /* JSDocCallbackTag */: + case 303 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 298 /* JSDocSignature */: + case 299 /* JSDocSignature */: return emitJSDocSignature(node); - case 297 /* JSDocTypeLiteral */: + case 298 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 301 /* JSDocClassTag */: - case 299 /* JSDocTag */: + case 302 /* JSDocClassTag */: + case 300 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 296 /* JSDocComment */: + case 297 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -84149,83 +85084,83 @@ var ts; case 14 /* NoSubstitutionTemplateLiteral */: return emitLiteral(node); // Identifiers - case 72 /* Identifier */: + case 73 /* Identifier */: return emitIdentifier(node); // Reserved words - case 87 /* FalseKeyword */: - case 96 /* NullKeyword */: - case 98 /* SuperKeyword */: - case 102 /* TrueKeyword */: - case 100 /* ThisKeyword */: - case 92 /* ImportKeyword */: + case 88 /* FalseKeyword */: + case 97 /* NullKeyword */: + case 99 /* SuperKeyword */: + case 103 /* TrueKeyword */: + case 101 /* ThisKeyword */: + case 93 /* ImportKeyword */: writeTokenNode(node, writeKeyword); return; // Expressions - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 191 /* CallExpression */: + case 192 /* CallExpression */: return emitCallExpression(node); - case 192 /* NewExpression */: + case 193 /* NewExpression */: return emitNewExpression(node); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: return emitFunctionExpression(node); - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return emitArrowFunction(node); - case 198 /* DeleteExpression */: + case 199 /* DeleteExpression */: return emitDeleteExpression(node); - case 199 /* TypeOfExpression */: + case 200 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 200 /* VoidExpression */: + case 201 /* VoidExpression */: return emitVoidExpression(node); - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: return emitAwaitExpression(node); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return emitBinaryExpression(node); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return emitConditionalExpression(node); - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: return emitTemplateExpression(node); - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: return emitYieldExpression(node); - case 208 /* SpreadElement */: + case 209 /* SpreadElement */: return emitSpreadExpression(node); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return emitClassExpression(node); - case 210 /* OmittedExpression */: + case 211 /* OmittedExpression */: return; - case 212 /* AsExpression */: + case 213 /* AsExpression */: return emitAsExpression(node); - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: return emitNonNullExpression(node); - case 214 /* MetaProperty */: + case 215 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 260 /* JsxElement */: + case 261 /* JsxElement */: return emitJsxElement(node); - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 264 /* JsxFragment */: + case 265 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 313 /* PartiallyEmittedExpression */: + case 314 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 314 /* CommaListExpression */: + case 315 /* CommaListExpression */: return emitCommaList(node); } } @@ -84265,7 +85200,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 285 /* Bundle */ ? node : undefined; + var bundle = node.kind === 286 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -84365,7 +85300,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 281 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 282 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -84398,7 +85333,7 @@ var ts; emit(node.right); } function emitEntityName(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { emitExpression(node); } else { @@ -84434,7 +85369,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 294 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 295 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -84496,7 +85431,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 158 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 159 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -84673,7 +85608,7 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 133 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 134 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); @@ -84823,7 +85758,7 @@ var ts; emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */); } function emitNewExpression(node) { - emitTokenWithComment(95 /* NewKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(96 /* NewKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); @@ -84863,22 +85798,22 @@ var ts; emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - emitTokenWithComment(81 /* DeleteKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(82 /* DeleteKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - emitTokenWithComment(104 /* TypeOfKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(105 /* TypeOfKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - emitTokenWithComment(106 /* VoidKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(107 /* VoidKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - emitTokenWithComment(122 /* AwaitKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(123 /* AwaitKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } @@ -84903,7 +85838,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 === 202 /* PrefixUnaryExpression */ + return operand.kind === 203 /* PrefixUnaryExpression */ && ((node.operator === 38 /* PlusToken */ && (operand.operator === 38 /* PlusToken */ || operand.operator === 44 /* PlusPlusToken */)) || (node.operator === 39 /* MinusToken */ && (operand.operator === 39 /* MinusToken */ || operand.operator === 45 /* MinusMinusToken */))); } @@ -84918,7 +85853,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken, node.operatorToken.kind === 93 /* InKeyword */ ? writeKeyword : writeOperator); + writeTokenNode(node.operatorToken, node.operatorToken.kind === 94 /* InKeyword */ ? writeKeyword : writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, /*writeSpaceIfNotIndenting*/ true); emitExpression(node.right); @@ -84946,7 +85881,7 @@ var ts; emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - emitTokenWithComment(117 /* YieldKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(118 /* YieldKeyword */, node.pos, writeKeyword, node); emit(node.asteriskToken); emitExpressionWithLeadingSpace(node.expression); } @@ -85023,7 +85958,7 @@ var ts; } } function emitIfStatement(node) { - var openParenPos = emitTokenWithComment(91 /* IfKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(92 /* IfKeyword */, node.pos, writeKeyword, node); writeSpace(); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); @@ -85031,8 +85966,8 @@ var ts; emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - emitTokenWithComment(83 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 222 /* IfStatement */) { + emitTokenWithComment(84 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 223 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -85042,14 +85977,14 @@ var ts; } } function emitWhileClause(node, startPos) { - var openParenPos = emitTokenWithComment(107 /* WhileKeyword */, startPos, writeKeyword, node); + var openParenPos = emitTokenWithComment(108 /* WhileKeyword */, startPos, writeKeyword, node); writeSpace(); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); } function emitDoStatement(node) { - emitTokenWithComment(82 /* DoKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(83 /* DoKeyword */, node.pos, writeKeyword, node); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { writeSpace(); @@ -85065,7 +86000,7 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = emitTokenWithComment(89 /* ForKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(90 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); var pos = emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); @@ -85077,25 +86012,25 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = emitTokenWithComment(89 /* ForKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(90 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(93 /* InKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(94 /* InKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = emitTokenWithComment(89 /* ForKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(90 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); emitWithTrailingSpace(node.awaitModifier); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(147 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(148 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -85103,7 +86038,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 238 /* VariableDeclarationList */) { + if (node.kind === 239 /* VariableDeclarationList */) { emit(node); } else { @@ -85112,12 +86047,12 @@ var ts; } } function emitContinueStatement(node) { - emitTokenWithComment(78 /* ContinueKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(79 /* ContinueKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeTrailingSemicolon(); } function emitBreakStatement(node) { - emitTokenWithComment(73 /* BreakKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(74 /* BreakKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeTrailingSemicolon(); } @@ -85145,12 +86080,12 @@ var ts; return pos; } function emitReturnStatement(node) { - emitTokenWithComment(97 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node); + emitTokenWithComment(98 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node); emitExpressionWithLeadingSpace(node.expression); writeTrailingSemicolon(); } function emitWithStatement(node) { - var openParenPos = emitTokenWithComment(108 /* WithKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(109 /* WithKeyword */, node.pos, writeKeyword, node); writeSpace(); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); @@ -85158,7 +86093,7 @@ var ts; emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = emitTokenWithComment(99 /* SwitchKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(100 /* SwitchKeyword */, node.pos, writeKeyword, node); writeSpace(); emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); @@ -85173,12 +86108,12 @@ var ts; emit(node.statement); } function emitThrowStatement(node) { - emitTokenWithComment(101 /* ThrowKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(102 /* ThrowKeyword */, node.pos, writeKeyword, node); emitExpressionWithLeadingSpace(node.expression); writeTrailingSemicolon(); } function emitTryStatement(node) { - emitTokenWithComment(103 /* TryKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(104 /* TryKeyword */, node.pos, writeKeyword, node); writeSpace(); emit(node.tryBlock); if (node.catchClause) { @@ -85187,13 +86122,13 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - emitTokenWithComment(88 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); + emitTokenWithComment(89 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(79 /* DebuggerKeyword */, node.pos, writeKeyword); + writeToken(80 /* DebuggerKeyword */, node.pos, writeKeyword); writeTrailingSemicolon(); } // @@ -85398,7 +86333,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 244 /* ModuleDeclaration */) { + while (body.kind === 245 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -85419,17 +86354,17 @@ var ts; } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - emitTokenWithComment(92 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + emitTokenWithComment(93 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); emit(node.name); writeSpace(); - emitTokenWithComment(59 /* EqualsToken */, node.name.end, writePunctuation, node); + emitTokenWithComment(60 /* EqualsToken */, node.name.end, writePunctuation, node); writeSpace(); emitModuleReference(node.moduleReference); writeTrailingSemicolon(); } function emitModuleReference(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { emitExpression(node); } else { @@ -85438,12 +86373,12 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - emitTokenWithComment(92 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + emitTokenWithComment(93 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(144 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(145 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -85460,7 +86395,7 @@ var ts; function emitNamespaceImport(node) { var asPos = emitTokenWithComment(40 /* AsteriskToken */, node.pos, writePunctuation, node); writeSpace(); - emitTokenWithComment(119 /* AsKeyword */, asPos, writeKeyword, node); + emitTokenWithComment(120 /* AsKeyword */, asPos, writeKeyword, node); writeSpace(); emit(node.name); } @@ -85471,20 +86406,20 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - var nextPos = emitTokenWithComment(85 /* ExportKeyword */, node.pos, writeKeyword, node); + var nextPos = emitTokenWithComment(86 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isExportEquals) { - emitTokenWithComment(59 /* EqualsToken */, nextPos, writeOperator, node); + emitTokenWithComment(60 /* EqualsToken */, nextPos, writeOperator, node); } else { - emitTokenWithComment(80 /* DefaultKeyword */, nextPos, writeKeyword, node); + emitTokenWithComment(81 /* DefaultKeyword */, nextPos, writeKeyword, node); } writeSpace(); emitExpression(node.expression); writeTrailingSemicolon(); } function emitExportDeclaration(node) { - var nextPos = emitTokenWithComment(85 /* ExportKeyword */, node.pos, writeKeyword, node); + var nextPos = emitTokenWithComment(86 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.exportClause) { emit(node.exportClause); @@ -85495,18 +86430,18 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(144 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(145 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } writeTrailingSemicolon(); } function emitNamespaceExportDeclaration(node) { - var nextPos = emitTokenWithComment(85 /* ExportKeyword */, node.pos, writeKeyword, node); + var nextPos = emitTokenWithComment(86 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(119 /* AsKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(120 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(131 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(132 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -85526,7 +86461,7 @@ var ts; if (node.propertyName) { emit(node.propertyName); writeSpace(); - emitTokenWithComment(119 /* AsKeyword */, node.propertyName.end, writeKeyword, node); + emitTokenWithComment(120 /* AsKeyword */, node.propertyName.end, writeKeyword, node); writeSpace(); } emit(node.name); @@ -85604,7 +86539,7 @@ var ts; } } function emitJsxTagName(node) { - if (node.kind === 72 /* Identifier */) { + if (node.kind === 73 /* Identifier */) { emitExpression(node); } else { @@ -85615,13 +86550,13 @@ var ts; // Clauses // function emitCaseClause(node) { - emitTokenWithComment(74 /* CaseKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(75 /* CaseKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); } function emitDefaultClause(node) { - var pos = emitTokenWithComment(80 /* DefaultKeyword */, node.pos, writeKeyword, node); + var pos = emitTokenWithComment(81 /* DefaultKeyword */, node.pos, writeKeyword, node); emitCaseOrDefaultClauseRest(node, node.statements, pos); } function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { @@ -85649,7 +86584,7 @@ var ts; emitList(node, node.types, 528 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = emitTokenWithComment(75 /* CatchKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(76 /* CatchKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.variableDeclaration) { emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); @@ -85719,7 +86654,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 307 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 308 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -85753,7 +86688,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 288 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 289 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -85772,7 +86707,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 297 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 298 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -85906,8 +86841,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_19 = types; _d < types_19.length; _d++) { - var directive = types_19[_d]; + for (var _d = 0, types_18 = types; _d < types_18.length; _d++) { + var directive = types_18[_d]; var pos = writer.getTextPos(); writeComment("/// <reference types=\"" + directive.fileName + "\" />"); if (bundleFileInfo) @@ -86087,7 +87022,7 @@ var ts; function emitInitializer(node, equalCommentStartPos, container) { if (node) { writeSpace(); - emitTokenWithComment(59 /* EqualsToken */, equalCommentStartPos, writeOperator, container); + emitTokenWithComment(60 /* EqualsToken */, equalCommentStartPos, writeOperator, container); writeSpace(); emitExpression(node); } @@ -86550,7 +87485,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 195 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 196 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -86615,81 +87550,81 @@ var ts; if (!node) return; switch (node.kind) { - case 218 /* Block */: + case 219 /* Block */: ts.forEach(node.statements, generateNames); break; - case 233 /* LabeledStatement */: - case 231 /* WithStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: + case 234 /* LabeledStatement */: + case 232 /* WithStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: generateNames(node.statement); break; - case 222 /* IfStatement */: + case 223 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 225 /* ForStatement */: - case 227 /* ForOfStatement */: - case 226 /* ForInStatement */: + case 226 /* ForStatement */: + case 228 /* ForOfStatement */: + case 227 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 235 /* TryStatement */: + case 236 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 274 /* CatchClause */: + case 275 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: generateNames(node.declarationList); break; - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 237 /* VariableDeclaration */: - case 151 /* Parameter */: - case 186 /* BindingElement */: - case 240 /* ClassDeclaration */: + case 238 /* VariableDeclaration */: + case 152 /* Parameter */: + case 187 /* BindingElement */: + case 241 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: generateNames(node.importClause); break; - case 250 /* ImportClause */: + case 251 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 252 /* NamedImports */: + case 253 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -86698,12 +87633,12 @@ var ts; if (!node) return; switch (node.kind) { - case 275 /* PropertyAssignment */: - case 276 /* ShorthandPropertyAssignment */: - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 276 /* PropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -86883,24 +87818,26 @@ var ts; */ function generateNameForNode(node, flags) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 254 /* ExportAssignment */: + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 255 /* ExportAssignment */: return generateNameForExportDefault(); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: return generateNameForClassExpression(); - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return generateNameForMethodOrAccessor(node); + case 150 /* ComputedPropertyName */: + return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); } @@ -86946,7 +87883,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 !== 312 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 313 /* 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 */; @@ -86970,7 +87907,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 === 238 /* VariableDeclarationList */) { + if (node.kind === 239 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -87227,7 +88164,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 !== 312 /* NotEmittedStatement */ + if (node.kind !== 313 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -87240,7 +88177,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 312 /* NotEmittedStatement */ + if (node.kind !== 313 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -87855,7 +88792,8 @@ var ts; getDirectories: function (path) { return system.getDirectories(path); }, realpath: realpath, readDirectory: function (path, extensions, include, exclude, depth) { return system.readDirectory(path, extensions, include, exclude, depth); }, - createDirectory: function (d) { return system.createDirectory(d); } + createDirectory: function (d) { return system.createDirectory(d); }, + createHash: ts.maybeBind(system, system.createHash) }; return compilerHost; } @@ -88141,6 +89079,7 @@ var ts; } } ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText; + /* @internal */ function loadWithLocalCache(names, containingFile, redirectedReference, loader) { if (names.length === 0) { return []; @@ -88160,6 +89099,7 @@ var ts; } return resolutions; } + ts.loadWithLocalCache = loadWithLocalCache; /** * Determines if program structure is upto date or needs to be recreated */ @@ -88319,7 +89259,7 @@ var ts; }); }; } else { - moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }); + moduleResolutionCache = ts.createModuleResolutionCache(currentDirectory, function (x) { return host.getCanonicalFileName(x); }, options); var loader_1 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule; }; // TODO: GH#18217 resolveModuleNamesWorker = function (moduleNames, containingFile, _reusedNames, redirectedReference) { return loadWithLocalCache(ts.Debug.assertEachDefined(moduleNames), containingFile, redirectedReference, loader_1); }; } @@ -88465,6 +89405,7 @@ var ts; getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, + getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, getFileProcessingDiagnostics: function () { return fileProcessingDiagnostics; }, getResolvedTypeReferenceDirectives: function () { return resolvedTypeReferenceDirectives; }, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, @@ -88562,13 +89503,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_6 = []; + var result_8 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_6.push(resolvedModule); + result_8.push(resolvedModule); } - return result_6; + return result_8; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -88655,7 +89596,7 @@ var ts; function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) { var resolutionToFile = ts.getResolvedModule(oldSourceFile, moduleName); var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName); - if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { + if (resolutionToFile && resolvedFile) { // In the old program, we resolved to an ambient module that was in the same // place as we expected to find an actual module file. // We actually need to return 'false' here even though this seems like a 'true' case @@ -88918,9 +89859,8 @@ var ts; ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, + /*transformers*/ ts.noTransformers, /*emitOnlyDtsFiles*/ false, - /*transformers*/ undefined, - /*declaraitonTransformers*/ undefined, /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); @@ -89008,8 +89948,7 @@ var ts; // checked is to not pass the file to getEmitResolver. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); - var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers, customTransformers && customTransformers.afterDeclarations); + var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, ts.getTransformers(options, customTransformers, emitOnlyDtsFiles), emitOnlyDtsFiles); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); return emitResult; @@ -89151,22 +90090,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 151 /* Parameter */: - case 154 /* PropertyDeclaration */: + case 152 /* Parameter */: + case 155 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: - case 237 /* VariableDeclaration */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 198 /* ArrowFunction */: + case 238 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -89174,41 +90113,41 @@ var ts; } } switch (node.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 273 /* HeritageClause */: + case 274 /* HeritageClause */: var heritageClause = node; - if (heritageClause.token === 109 /* ImplementsKeyword */) { + if (heritageClause.token === 110 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 213 /* NonNullExpression */: + case 214 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 212 /* AsExpression */: + case 213 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -89218,54 +90157,54 @@ var ts; } function walkArray(nodes) { if (parent.decorators === nodes && !options.experimentalDecorators) { - 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_to_remove_this_warning)); + 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 240 /* ClassDeclaration */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: + case 241 /* ClassDeclaration */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 198 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 219 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 220 /* VariableStatement */); } break; - case 154 /* PropertyDeclaration */: + case 155 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 116 /* StaticKeyword */) { + if (modifier.kind !== 117 /* StaticKeyword */) { diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); } } return; } break; - case 151 /* Parameter */: + case 152 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 211 /* ExpressionWithTypeArguments */: - case 261 /* JsxSelfClosingElement */: - case 262 /* JsxOpeningElement */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 212 /* ExpressionWithTypeArguments */: + case 262 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -89282,24 +90221,24 @@ var ts; for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { var modifier = modifiers_1[_i]; switch (modifier.kind) { - case 77 /* ConstKeyword */: + case 78 /* ConstKeyword */: if (isConstValid) { continue; } // to report error, // falls through - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 133 /* ReadonlyKeyword */: - case 125 /* DeclareKeyword */: - case 118 /* AbstractKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 134 /* ReadonlyKeyword */: + case 126 /* DeclareKeyword */: + case 119 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); break; // These are all legal modifiers. - case 116 /* StaticKeyword */: - case 85 /* ExportKeyword */: - case 80 /* DefaultKeyword */: + case 117 /* StaticKeyword */: + case 86 /* ExportKeyword */: + case 81 /* DefaultKeyword */: } } } @@ -89374,8 +90313,8 @@ var ts; return a.fileName === b.fileName; } function moduleNameIsEqualTo(a, b) { - return a.kind === 72 /* Identifier */ - ? b.kind === 72 /* Identifier */ && a.escapedText === b.escapedText + return a.kind === 73 /* Identifier */ + ? b.kind === 73 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } function collectExternalModuleReferences(file) { @@ -89590,7 +90529,10 @@ var ts; if (isRedirect) { inputName = getProjectReferenceRedirect(fileName) || fileName; } - if (ts.getNormalizedAbsolutePath(checkedName, currentDirectory) !== ts.getNormalizedAbsolutePath(inputName, currentDirectory)) { + // Check if it differs only in drive letters its ok to ignore that error: + var checkedAbsolutePath = ts.getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); + var inputAbsolutePath = ts.getNormalizedAbsolutePathWithoutRoot(inputName, currentDirectory); + if (checkedAbsolutePath !== inputAbsolutePath) { reportFileNamesDifferOnlyInCasingError(inputName, checkedName, refFile, refPos, refEnd); } } @@ -89619,8 +90561,13 @@ var ts; } var redirectedPath; if (refFile) { - var redirect = getProjectReferenceRedirect(fileName); - if (redirect) { + var redirectProject = getProjectReferenceRedirectProject(fileName); + if (redirectProject) { + if (redirectProject.commandLine.options.outFile || redirectProject.commandLine.options.out) { + // Shouldnt create many to 1 mapping file in --out scenario + return undefined; + } + var redirect = getProjectReferenceOutputName(redirectProject, fileName); fileName = redirect; // Once we start redirecting to a file, we can potentially come back to it // via a back-reference from another file in the .d.ts folder. If that happens we'll @@ -89704,16 +90651,19 @@ var ts; } } function getProjectReferenceRedirect(fileName) { + var referencedProject = getProjectReferenceRedirectProject(fileName); + return referencedProject && getProjectReferenceOutputName(referencedProject, fileName); + } + function getProjectReferenceRedirectProject(fileName) { // Ignore dts or any of the non ts files if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) || !ts.fileExtensionIsOneOf(fileName, ts.supportedTSExtensions)) { return undefined; } // If this file is produced by a referenced project, we need to rewrite it to // look in the output folder of the referenced project rather than the input - var referencedProject = getResolvedProjectReferenceToRedirect(fileName); - if (!referencedProject) { - return undefined; - } + return getResolvedProjectReferenceToRedirect(fileName); + } + function getProjectReferenceOutputName(referencedProject, fileName) { var out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out; return out ? ts.changeExtension(out, ".d.ts" /* Dts */) : @@ -89958,18 +90908,33 @@ var ts; if (fromCache !== undefined) { return fromCache || undefined; } - // An absolute path pointing to the containing directory of the config file - var basePath = ts.getNormalizedAbsolutePath(ts.getDirectoryPath(refPath), host.getCurrentDirectory()); - var sourceFile = host.getSourceFile(refPath, 100 /* JSON */); - addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined); - if (sourceFile === undefined) { - projectReferenceRedirects.set(sourceFilePath, false); - return undefined; + var commandLine; + var sourceFile; + if (host.getParsedCommandLine) { + commandLine = host.getParsedCommandLine(refPath); + if (!commandLine) { + addFileToFilesByName(/*sourceFile*/ undefined, sourceFilePath, /*redirectedPath*/ undefined); + projectReferenceRedirects.set(sourceFilePath, false); + return undefined; + } + sourceFile = ts.Debug.assertDefined(commandLine.options.configFile); + ts.Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath); + addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined); + } + else { + // An absolute path pointing to the containing directory of the config file + var basePath = ts.getNormalizedAbsolutePath(ts.getDirectoryPath(refPath), host.getCurrentDirectory()); + sourceFile = host.getSourceFile(refPath, 100 /* JSON */); + addFileToFilesByName(sourceFile, sourceFilePath, /*redirectedPath*/ undefined); + if (sourceFile === undefined) { + projectReferenceRedirects.set(sourceFilePath, false); + return undefined; + } + commandLine = ts.parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath); } sourceFile.path = sourceFilePath; sourceFile.resolvedPath = sourceFilePath; sourceFile.originalFileName = refPath; - var commandLine = ts.parseJsonSourceFileConfigFileContent(sourceFile, configParsingHost, basePath, /*existingOptions*/ undefined, refPath); var resolvedRef = { commandLine: commandLine, sourceFile: sourceFile }; projectReferenceRedirects.set(sourceFilePath, resolvedRef); if (commandLine.projectReferences) { @@ -89985,9 +90950,6 @@ var ts; if (ts.getEmitDeclarations(options)) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, getEmitDeclarationOptionName(options), "isolatedModules"); } - if (options.noEmitOnError) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmitOnError", "isolatedModules"); - } if (options.out) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); } @@ -90019,17 +90981,17 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "tsBuildInfoFile", "incremental", "composite"); } } + else if (options.incremental && !options.outFile && !options.out && !options.configFilePath) { + programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); + } verifyProjectReferences(); // List of collected files is complete; validate exhautiveness if this is a project with a file list if (options.composite) { var rootPaths = rootNames.map(toPath); for (var _i = 0, files_3 = files; _i < files_3.length; _i++) { var file = files_3[_i]; - // Ignore declaration files - if (file.isDeclarationFile) - continue; - // Ignore json file thats from project reference - if (ts.isJsonSourceFile(file) && getResolvedProjectReferenceToRedirect(file.fileName)) + // Ignore file that is not emitted + if (!ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect)) continue; if (rootPaths.indexOf(file.path) === -1) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName)); @@ -90106,10 +91068,10 @@ var ts; if (options.module === ts.ModuleKind.None && languageVersion < 2 /* ES2015 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); } - var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); + 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.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided)); + 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) { @@ -90194,13 +91156,13 @@ var ts; var emitFilePath = toPath(emitFileName); // Report error if the output overwrites input file if (filesByName.has(emitFilePath)) { - var chain_2; + var chain = void 0; if (!options.configFilePath) { // The program is from either an inferred project or an external project - chain_2 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); + chain = ts.chainDiagnosticMessages(chain, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; // Report error if multiple files write into same file @@ -90735,6 +91697,7 @@ var ts; cacheToUpdateSignature.set(sourceFile.path, latestSignature); return !prevSignature || latestSignature !== prevSignature; } + BuilderState.updateShapeSignature = updateShapeSignature; /** * Coverts the declaration emit result into exported modules map */ @@ -91012,15 +91975,9 @@ var ts; } } }); - if (oldCompilerOptions && - (oldCompilerOptions.outDir !== compilerOptions.outDir || - oldCompilerOptions.declarationDir !== compilerOptions.declarationDir || - (oldCompilerOptions.outFile || oldCompilerOptions.out) !== (compilerOptions.outFile || compilerOptions.out))) { + if (oldCompilerOptions && ts.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { // Add all files to affectedFilesPendingEmit since emit changed - state.affectedFilesPendingEmit = ts.concatenate(state.affectedFilesPendingEmit, newProgram.getSourceFiles().map(function (f) { return f.path; })); - if (state.affectedFilesPendingEmitIndex === undefined) { - state.affectedFilesPendingEmitIndex = 0; - } + addToAffectedFilesPendingEmit(state, newProgram.getSourceFiles().map(function (f) { return f.path; })); ts.Debug.assert(state.seenAffectedFiles === undefined); state.seenAffectedFiles = ts.createMap(); } @@ -91104,7 +92061,7 @@ var ts; if (!seenAffectedFiles.has(affectedFile.path)) { // Set the next affected file as seen and remove the cached semantic diagnostics state.affectedFilesIndex = affectedFilesIndex; - cleanSemanticDiagnosticsOfAffectedFile(state, affectedFile); + handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash); return affectedFile; } seenAffectedFiles.set(affectedFile.path, true); @@ -91165,28 +92122,68 @@ var ts; return undefined; } /** - * Remove the semantic diagnostics cached from old state for affected File and the files that are referencing modules that export entities from affected file + * Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file + * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change */ - function cleanSemanticDiagnosticsOfAffectedFile(state, affectedFile) { - if (removeSemanticDiagnosticsOf(state, affectedFile.path)) { - // If there are no more diagnostics from old cache, done + function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash) { + removeSemanticDiagnosticsOf(state, affectedFile.path); + // If affected files is everything except default library, then nothing more to do + if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { + if (!state.cleanedDiagnosticsOfLibFiles) { + state.cleanedDiagnosticsOfLibFiles = true; + var program_1 = ts.Debug.assertDefined(state.program); + var options_2 = program_1.getCompilerOptions(); + ts.forEach(program_1.getSourceFiles(), function (f) { + return program_1.isSourceFileDefaultLibrary(f) && + !ts.skipTypeChecking(f, options_2) && + removeSemanticDiagnosticsOf(state, f.path); + }); + } return; } - // Clean lib file diagnostics if its all files excluding default files to emit - if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles && !state.cleanedDiagnosticsOfLibFiles) { - state.cleanedDiagnosticsOfLibFiles = true; - var program_1 = ts.Debug.assertDefined(state.program); - var options_2 = program_1.getCompilerOptions(); - if (ts.forEach(program_1.getSourceFiles(), function (f) { - return program_1.isSourceFileDefaultLibrary(f) && - !ts.skipTypeChecking(f, options_2) && - removeSemanticDiagnosticsOf(state, f.path); - })) { - return; + forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); }); + } + /** + * Handle the dts may change, so they need to be added to pending emit if dts emit is enabled, + * Also we need to make sure signature is updated for these files + */ + function handleDtsMayChangeOf(state, path, cancellationToken, computeHash) { + removeSemanticDiagnosticsOf(state, path); + if (!state.changedFilesSet.has(path)) { + var program = ts.Debug.assertDefined(state.program); + var sourceFile = program.getSourceFileByPath(path); + if (sourceFile) { + // Even though the js emit doesnt change and we are already handling dts emit and semantic diagnostics + // we need to update the signature to reflect correctness of the signature(which is output d.ts emit) of this file + // This ensures that we dont later during incremental builds considering wrong signature. + // Eg where this also is needed to ensure that .tsbuildinfo generated by incremental build should be same as if it was first fresh build + ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.assertDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap); + // If not dts emit, nothing more to do + if (ts.getEmitDeclarations(state.compilerOptions)) { + addToAffectedFilesPendingEmit(state, [path]); + } } } - // If there was change in signature for the changed file, - // then delete the semantic diagnostics for files that are affected by using exports of this module + return false; + } + /** + * Removes semantic diagnostics for path and + * returns true if there are no more semantic diagnostics from the old state + */ + function removeSemanticDiagnosticsOf(state, path) { + if (!state.semanticDiagnosticsFromOldState) { + return true; + } + state.semanticDiagnosticsFromOldState.delete(path); + state.semanticDiagnosticsPerFile.delete(path); + return !state.semanticDiagnosticsFromOldState.size; + } + /** + * Iterate on referencing modules that export entities from affected file + */ + function forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, fn) { + // If there was change in signature (dts output) for the changed file, + // then only we need to handle pending file emit if (!state.exportedModulesMap || state.affectedFiles.length === 1 || !state.changedFilesSet.has(affectedFile.path)) { return; } @@ -91197,7 +92194,7 @@ var ts; if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) { return exportedModules && exportedModules.has(affectedFile.path) && - removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile); + forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn); })) { return; } @@ -91205,26 +92202,25 @@ var ts; ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it exportedModules.has(affectedFile.path) && - removeSemanticDiagnosticsOfFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile); + forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn); }); } /** - * removes the semantic diagnostics of files referencing referencedPath and - * returns true if there are no more semantic diagnostics from old state + * Iterate on files referencing referencedPath */ - function removeSemanticDiagnosticsOfFilesReferencingPath(state, referencedPath, seenFileAndExportsOfFile) { + function forEachFilesReferencingPath(state, referencedPath, seenFileAndExportsOfFile, fn) { return ts.forEachEntry(state.referencedMap, function (referencesInFile, filePath) { - return referencesInFile.has(referencedPath) && removeSemanticDiagnosticsOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile); + return referencesInFile.has(referencedPath) && forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn); }); } /** - * Removes semantic diagnostics of file and anything that exports this file + * fn on file and iterate on anything that exports this file */ - function removeSemanticDiagnosticsOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile) { + function forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) { if (!ts.addToSeen(seenFileAndExportsOfFile, filePath)) { return false; } - if (removeSemanticDiagnosticsOf(state, filePath)) { + if (fn(state, filePath)) { // If there are no more diagnostics from old cache, done return true; } @@ -91234,7 +92230,7 @@ var ts; if (ts.forEachEntry(state.currentAffectedFilesExportedModulesMap, function (exportedModules, exportedFromPath) { return exportedModules && exportedModules.has(filePath) && - removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile); + forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn); })) { return true; } @@ -91242,7 +92238,7 @@ var ts; if (ts.forEachEntry(state.exportedModulesMap, function (exportedModules, exportedFromPath) { return !state.currentAffectedFilesExportedModulesMap.has(exportedFromPath) && // If we already iterated this through cache, ignore it exportedModules.has(filePath) && - removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile); + forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn); })) { return true; } @@ -91250,22 +92246,10 @@ var ts; return !!ts.forEachEntry(state.referencedMap, function (referencesInFile, referencingFilePath) { return referencesInFile.has(filePath) && !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file - removeSemanticDiagnosticsOf(state, referencingFilePath); + fn(state, referencingFilePath); } // Dont add to seen since this is not yet done with the export removal ); } - /** - * Removes semantic diagnostics for path and - * returns true if there are no more semantic diagnostics from the old state - */ - function removeSemanticDiagnosticsOf(state, path) { - if (!state.semanticDiagnosticsFromOldState) { - return true; - } - state.semanticDiagnosticsFromOldState.delete(path); - state.semanticDiagnosticsPerFile.delete(path); - return !state.semanticDiagnosticsFromOldState.size; - } /** * This is called after completing operation on the next affected file. * The operations here are postponed to ensure that cancellation during the iteration is handled correctly @@ -91493,7 +92477,7 @@ var ts; return toAffectedFileResult(state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file - affected_1.emitBuildInfo(writeFile || host.writeFile, cancellationToken), affected_1, + affected_1.emitBuildInfo(writeFile || ts.maybeBind(host, host.writeFile), cancellationToken), affected_1, /*isPendingEmitFile*/ false, /*isBuildInfoEmit*/ true); } @@ -91509,14 +92493,10 @@ var ts; affected = program; } } - // Mark seen emitted files if there are pending files to be emitted - if (state.affectedFilesPendingEmit && state.program !== affected) { - (state.seenEmittedFiles || (state.seenEmittedFiles = ts.createMap())).set(affected.path, true); - } return toAffectedFileResult(state, // When whole program is affected, do emit only once (eg when --out or --outFile is specified) // Otherwise just affected file - ts.Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected, isPendingEmitFile); + ts.Debug.assertDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers), affected, isPendingEmitFile); } /** * Emits the JavaScript and declaration files. @@ -91553,7 +92533,7 @@ var ts; }; } } - return ts.Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return ts.Debug.assertDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } /** * Return the semantic diagnostics for the next affected file or undefined if iteration is complete @@ -91610,14 +92590,7 @@ var ts; } // In case of emit builder, cache the files to be emitted if (affectedFilesPendingEmit) { - state.affectedFilesPendingEmit = ts.concatenate(state.affectedFilesPendingEmit, affectedFilesPendingEmit); - // affectedFilesPendingEmitIndex === undefined - // - means the emit state.affectedFilesPendingEmit was undefined before adding current affected files - // so start from 0 as array would be affectedFilesPendingEmit - // else, continue to iterate from existing index, the current set is appended to existing files - if (state.affectedFilesPendingEmitIndex === undefined) { - state.affectedFilesPendingEmitIndex = 0; - } + addToAffectedFilesPendingEmit(state, affectedFilesPendingEmit); } var diagnostics; for (var _i = 0, _a = ts.Debug.assertDefined(state.program).getSourceFiles(); _i < _a.length; _i++) { @@ -91628,6 +92601,16 @@ var ts; } } ts.createBuilderProgram = createBuilderProgram; + function addToAffectedFilesPendingEmit(state, affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = ts.concatenate(state.affectedFilesPendingEmit, affectedFilesPendingEmit); + // affectedFilesPendingEmitIndex === undefined + // - means the emit state.affectedFilesPendingEmit was undefined before adding current affected files + // so start from 0 as array would be affectedFilesPendingEmit + // else, continue to iterate from existing index, the current set is appended to existing files + if (state.affectedFilesPendingEmitIndex === undefined) { + state.affectedFilesPendingEmitIndex = 0; + } + } function getMapOfReferencedSet(mapLike) { if (!mapLike) return undefined; @@ -92247,6 +93230,10 @@ var ts; // If something to do with folder/file starting with "." in node_modules folder, skip it if (isPathIgnored(fileOrDirectoryPath)) return false; + // prevent saving an open file from over-eagerly triggering invalidation + if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) { + return false; + } // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); @@ -92489,11 +93476,11 @@ var ts; } function discoverProbableSymlinks(files, getCanonicalFileName, cwd) { var result = ts.createMap(); - var symlinks = ts.mapDefined(files, function (sf) { - return sf.resolvedModules && ts.firstDefinedIterator(sf.resolvedModules.values(), function (res) { + var symlinks = ts.flatten(ts.mapDefined(files, function (sf) { + return sf.resolvedModules && ts.compact(ts.arrayFrom(ts.mapIterator(sf.resolvedModules.values(), function (res) { return res && res.originalPath && res.resolvedFileName !== res.originalPath ? [res.resolvedFileName, res.originalPath] : undefined; - }); - }); + }))); + })); for (var _i = 0, symlinks_1 = symlinks; _i < symlinks_1.length; _i++) { var _a = symlinks_1[_i], resolvedPath = _a[0], originalPath = _a[1]; var _b = guessDirectorySymlink(resolvedPath, originalPath, cwd, getCanonicalFileName), commonResolved = _b[0], commonOriginal = _b[1]; @@ -92836,6 +93823,14 @@ var ts; return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; } ts.getErrorSummaryText = getErrorSummaryText; + function listFiles(program, writeFileName) { + if (program.getCompilerOptions().listFiles) { + ts.forEach(program.getSourceFiles(), function (file) { + writeFileName(file.fileName); + }); + } + } + ts.listFiles = listFiles; /** * Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options */ @@ -92863,11 +93858,7 @@ var ts; var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1); writeFileName("TSFILE: " + filepath); }); - if (program.getCompilerOptions().listFiles) { - ts.forEach(program.getSourceFiles(), function (file) { - writeFileName(file.fileName); - }); - } + listFiles(program, writeFileName); } if (reportSummary) { reportSummary(getErrorCountForSummary(diagnostics)); @@ -93190,6 +94181,7 @@ var ts; hasChangedAutomaticTypeDirectiveNames = true; scheduleProgramUpdate(); }; + compilerHost.fileIsOpen = ts.returnFalse; compilerHost.maxNumberOfFilesToIterateForInvalidation = host.maxNumberOfFilesToIterateForInvalidation; compilerHost.getCurrentProgram = getCurrentProgram; compilerHost.writeLog = writeLog; @@ -93680,7 +94672,8 @@ var ts; function getCompilerOptionsOfBuildOptions(buildOptions) { var result = {}; ts.commonOptionsWithBuild.forEach(function (option) { - result[option.name] = buildOptions[option.name]; + if (ts.hasProperty(buildOptions, option.name)) + result[option.name] = buildOptions[option.name]; }); return result; } @@ -93699,12 +94692,18 @@ var ts; var projectStatus = createFileMap(toPath); var missingRoots = ts.createMap(); var globalDependencyGraph; - var writeFileName = function (s) { return host.trace && host.trace(s); }; + var writeFileName = host.trace ? function (s) { return host.trace(s); } : undefined; var readFileWithCache = function (f) { return host.readFile(f); }; var projectCompilerOptions = baseCompilerOptions; var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return projectCompilerOptions; }); ts.setGetSourceFileAsHashVersioned(compilerHost, host); + compilerHost.getParsedCommandLine = parseConfigFile; + compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames); + compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives); + var moduleResolutionCache = !compilerHost.resolveModuleNames ? ts.createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined; + var cacheState; var buildInfoChecked = createFileMap(toPath); + var extendedConfigCache = ts.createMap(); // Watch state var builderPrograms = createFileMap(toPath); var diagnostics = createFileMap(toPath); @@ -93768,7 +94767,7 @@ var ts; } var diagnostic; parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = function (d) { return diagnostic = d; }; - var parsed = ts.getParsedCommandLineOfConfigFile(configFilePath, baseCompilerOptions, parseConfigFileHost); + var parsed = ts.getParsedCommandLineOfConfigFile(configFilePath, baseCompilerOptions, parseConfigFileHost, extendedConfigCache); parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop; configFileCache.setValue(configFilePath, parsed || diagnostic); return parsed; @@ -94090,6 +95089,7 @@ var ts; projectStatus.removeKey(resolved); diagnostics.removeKey(resolved); addProjToQueue(resolved, reloadLevel); + enableCache(); } /** * return true if new addition @@ -94145,6 +95145,7 @@ var ts; } } else { + disableCache(); reportErrorSummary(); } } @@ -94307,6 +95308,28 @@ var ts; } // TODO: handle resolve module name to cache result in project reference redirect projectCompilerOptions = configFile.options; + // Update module resolution cache if needed + if (moduleResolutionCache) { + var projPath = toPath(proj); + if (moduleResolutionCache.directoryToModuleNameMap.redirectsMap.size === 0) { + // The own map will be for projectCompilerOptions + ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size === 0); + moduleResolutionCache.directoryToModuleNameMap.redirectsMap.set(projPath, moduleResolutionCache.directoryToModuleNameMap.ownMap); + moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.set(projPath, moduleResolutionCache.moduleNameToDirectoryMap.ownMap); + } + else { + // Set correct own map + ts.Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size > 0); + var ref = { + sourceFile: projectCompilerOptions.configFile, + commandLine: configFile + }; + moduleResolutionCache.directoryToModuleNameMap.setOwnMap(moduleResolutionCache.directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref)); + moduleResolutionCache.moduleNameToDirectoryMap.setOwnMap(moduleResolutionCache.moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref)); + } + moduleResolutionCache.directoryToModuleNameMap.setOwnOptions(projectCompilerOptions); + moduleResolutionCache.moduleNameToDirectoryMap.setOwnOptions(projectCompilerOptions); + } var program = host.createProgram(configFile.fileNames, configFile.options, compilerHost, getOldProgram(proj, configFile), configFile.errors, configFile.projectReferences); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getConfigFileParsingDiagnostics().concat(program.getOptionsDiagnostics(), program.getGlobalDiagnostics(), program.getSyntacticDiagnostics()); @@ -94325,7 +95348,7 @@ var ts; var declDiagnostics; var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); }; var outputFiles = []; - ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }); + ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, /*writeFileName*/ undefined, /*reportSummary*/ undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }); // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { program.restoreState(); @@ -94347,7 +95370,7 @@ var ts; anyDtsChanged = true; } } - emittedOutputs.setValue(name, true); + emittedOutputs.setValue(name, name); ts.writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark); if (priorChangeTime !== undefined) { newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime); @@ -94358,6 +95381,10 @@ var ts; if (emitDiagnostics.length) { return buildErrors(emitDiagnostics, BuildResultFlags.EmitErrors, "Emit"); } + if (writeFileName) { + emittedOutputs.forEach(function (name) { return listEmittedFile(configFile, name); }); + ts.listFiles(program, writeFileName); + } // Update time stamps for rest of the outputs newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(configFile, newestDeclarationFileContentChangedTime, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); var status = { @@ -94373,12 +95400,20 @@ var ts; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); + // List files if any other build error using program (emit errors already report files) + if (writeFileName) + ts.listFiles(program, writeFileName); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); afterProgramCreate(proj, program); projectCompilerOptions = baseCompilerOptions; return resultFlags; } } + function listEmittedFile(proj, file) { + if (writeFileName && proj.options.listEmittedFiles) { + writeFileName("TSFILE: " + file); + } + } function afterProgramCreate(proj, program) { if (host.afterProgramEmitAndDiagnostics) { host.afterProgramEmitAndDiagnostics(program); @@ -94417,7 +95452,7 @@ var ts; var emittedOutputs = createFileMap(toPath); outputFiles.forEach(function (_a) { var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark; - emittedOutputs.setValue(name, true); + emittedOutputs.setValue(name, name); ts.writeFile(compilerHost, emitterDiagnostics, name, text, writeByteOrderMark); }); var emitDiagnostics = emitterDiagnostics.getDiagnostics(); @@ -94427,6 +95462,9 @@ var ts; projectCompilerOptions = baseCompilerOptions; return BuildResultFlags.DeclarationOutputUnchanged | BuildResultFlags.EmitErrors; } + if (writeFileName) { + emittedOutputs.forEach(function (name) { return listEmittedFile(config, name); }); + } // Update timestamps for dts var newestDeclarationFileContentChangedTime = updateOutputTimestampsWorker(config, minimumDate, ts.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); var status = { @@ -94467,9 +95505,7 @@ var ts; priorNewestUpdateTime = newer(priorNewestUpdateTime, host.getModifiedTime(file) || ts.missingFileModifiedTime); } host.setModifiedTime(file, now); - if (proj.options.listEmittedFiles) { - writeFileName("TSFILE: " + file); - } + listEmittedFile(proj, file); } } return priorNewestUpdateTime; @@ -94514,28 +95550,67 @@ var ts; function resolveProjectNames(configFileNames) { return configFileNames.map(resolveProjectName); } - function buildAllProjects() { - if (options.watch) { - reportWatchStatus(ts.Diagnostics.Starting_compilation_in_watch_mode); + function enableCache() { + if (cacheState) { + disableCache(); } - // TODO:: In watch mode as well to use caches for incremental build once we can invalidate caches correctly and have right api - // Override readFile for json files and output .d.ts to cache the text - var savedReadFileWithCache = readFileWithCache; - var savedGetSourceFile = compilerHost.getSourceFile; + var originalReadFileWithCache = readFileWithCache; + var originalGetSourceFile = compilerHost.getSourceFile; var _a = ts.changeCompilerHostLikeToUseCache(host, toPath, function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - return savedGetSourceFile.call.apply(savedGetSourceFile, [compilerHost].concat(args)); + return originalGetSourceFile.call.apply(originalGetSourceFile, [compilerHost].concat(args)); }), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, getSourceFileWithCache = _a.getSourceFileWithCache, newReadFileWithCache = _a.readFileWithCache; readFileWithCache = newReadFileWithCache; compilerHost.getSourceFile = getSourceFileWithCache; + var originalResolveModuleNames = compilerHost.resolveModuleNames; + if (!compilerHost.resolveModuleNames) { + var loader_3 = function (moduleName, containingFile, redirectedReference) { return ts.resolveModuleName(moduleName, containingFile, projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference).resolvedModule; }; + compilerHost.resolveModuleNames = function (moduleNames, containingFile, _reusedNames, redirectedReference) { + return ts.loadWithLocalCache(ts.Debug.assertEachDefined(moduleNames), containingFile, redirectedReference, loader_3); + }; + } + cacheState = { + originalReadFile: originalReadFile, + originalFileExists: originalFileExists, + originalDirectoryExists: originalDirectoryExists, + originalCreateDirectory: originalCreateDirectory, + originalWriteFile: originalWriteFile, + originalReadFileWithCache: originalReadFileWithCache, + originalGetSourceFile: originalGetSourceFile, + originalResolveModuleNames: originalResolveModuleNames + }; + } + function disableCache() { + if (!cacheState) + return; + host.readFile = cacheState.originalReadFile; + host.fileExists = cacheState.originalFileExists; + host.directoryExists = cacheState.originalDirectoryExists; + host.createDirectory = cacheState.originalCreateDirectory; + host.writeFile = cacheState.originalWriteFile; + compilerHost.getSourceFile = cacheState.originalGetSourceFile; + readFileWithCache = cacheState.originalReadFileWithCache; + compilerHost.resolveModuleNames = cacheState.originalResolveModuleNames; + extendedConfigCache.clear(); + if (moduleResolutionCache) { + moduleResolutionCache.directoryToModuleNameMap.clear(); + moduleResolutionCache.moduleNameToDirectoryMap.clear(); + } + cacheState = undefined; + } + function buildAllProjects() { + if (options.watch) { + reportWatchStatus(ts.Diagnostics.Starting_compilation_in_watch_mode); + } + enableCache(); var graph = getGlobalDependencyGraph(); reportBuildQueue(graph); var anyFailed = false; - for (var _i = 0, _b = graph.buildQueue; _i < _b.length; _i++) { - var next = _b[_i]; + for (var _i = 0, _a = graph.buildQueue; _i < _a.length; _i++) { + var next = _a[_i]; var proj = parseConfigFile(next); if (proj === undefined) { reportParseConfigFileDiagnostic(next); @@ -94579,13 +95654,7 @@ var ts; anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors); } reportErrorSummary(); - host.readFile = originalReadFile; - host.fileExists = originalFileExists; - host.directoryExists = originalDirectoryExists; - host.createDirectory = originalCreateDirectory; - host.writeFile = originalWriteFile; - compilerHost.getSourceFile = savedGetSourceFile; - readFileWithCache = savedReadFileWithCache; + disableCache(); return anyFailed ? ts.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts.ExitStatus.Success; } function needsBuild(status, configFile) { @@ -94675,144 +95744,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var ValueKind; - (function (ValueKind) { - ValueKind[ValueKind["Const"] = 0] = "Const"; - ValueKind[ValueKind["Array"] = 1] = "Array"; - ValueKind[ValueKind["FunctionOrClass"] = 2] = "FunctionOrClass"; - ValueKind[ValueKind["Object"] = 3] = "Object"; - })(ValueKind = ts.ValueKind || (ts.ValueKind = {})); - function inspectModule(fileNameToRequire) { - return inspectValue(ts.removeFileExtension(ts.getBaseFileName(fileNameToRequire)), tryRequire(fileNameToRequire)); - } - ts.inspectModule = inspectModule; - function inspectValue(name, value) { - return getValueInfo(name, value, getRecurser()); - } - ts.inspectValue = inspectValue; - function getRecurser() { - var seen = []; - var nameStack = []; - return function (obj, name, cbOk, cbFail) { - if (seen.indexOf(obj) !== -1 || nameStack.length > 4) { - return cbFail(seen.indexOf(obj) !== -1, nameStack); - } - seen.push(obj); - nameStack.push(name); - var res = cbOk(); - nameStack.pop(); - seen.pop(); - return res; - }; - } - function getValueInfo(name, value, recurser) { - return recurser(value, name, function () { - if (typeof value === "function") - return getFunctionOrClassInfo(value, name, recurser); - if (typeof value === "object") { - var builtin = getBuiltinType(name, value, recurser); - if (builtin !== undefined) - return builtin; - var entries = getEntriesOfObject(value); - var hasNontrivialPrototype = Object.getPrototypeOf(value) !== Object.prototype; - var members = ts.flatMap(entries, function (_a) { - var key = _a.key, value = _a.value; - return getValueInfo(key, value, recurser); - }); - return { kind: 3 /* Object */, name: name, hasNontrivialPrototype: hasNontrivialPrototype, members: members }; - } - return { kind: 0 /* Const */, name: name, typeName: isNullOrUndefined(value) ? "any" : typeof value }; - }, function (isCircularReference, keyStack) { return anyValue(name, " " + (isCircularReference ? "Circular reference" : "Too-deep object hierarchy") + " from " + keyStack.join(".")); }); - } - function getFunctionOrClassInfo(fn, name, recurser) { - var prototypeMembers = getPrototypeMembers(fn, recurser); - var namespaceMembers = ts.flatMap(getEntriesOfObject(fn), function (_a) { - var key = _a.key, value = _a.value; - return getValueInfo(key, value, recurser); - }); - var toString = ts.cast(Function.prototype.toString.call(fn), ts.isString); - var source = ts.stringContains(toString, "{ [native code] }") ? getFunctionLength(fn) : toString; - return { kind: 2 /* FunctionOrClass */, name: name, source: source, namespaceMembers: namespaceMembers, prototypeMembers: prototypeMembers }; - } - var builtins = ts.memoize(function () { - var map = ts.createMap(); - for (var _i = 0, _a = getEntriesOfObject(global); _i < _a.length; _i++) { - var _b = _a[_i], key = _b.key, value = _b.value; - if (typeof value === "function" && typeof value.prototype === "object" && value !== Object) { - map.set(key, value); - } - } - return map; - }); - function getBuiltinType(name, value, recurser) { - return ts.isArray(value) - ? { name: name, kind: 1 /* Array */, inner: value.length && getValueInfo("element", ts.first(value), recurser) || anyValue(name) } - : ts.forEachEntry(builtins(), function (builtin, builtinName) { - return value instanceof builtin ? { kind: 0 /* Const */, name: name, typeName: builtinName } : undefined; - }); - } - function getPrototypeMembers(fn, recurser) { - var prototype = fn.prototype; - // tslint:disable-next-line no-unnecessary-type-assertion (TODO: update LKG and it will really be unnecessary) - return typeof prototype !== "object" || prototype === null ? ts.emptyArray : ts.mapDefined(getEntriesOfObject(prototype), function (_a) { - var key = _a.key, value = _a.value; - return key === "constructor" ? undefined : getValueInfo(key, value, recurser); - }); - } - var ignoredProperties = ["arguments", "caller", "constructor", "eval", "super_"]; - var reservedFunctionProperties = Object.getOwnPropertyNames(ts.noop); - function getEntriesOfObject(obj) { - var seen = ts.createMap(); - var entries = []; - var chain = obj; - while (!isNullOrUndefined(chain) && chain !== Object.prototype && chain !== Function.prototype) { - for (var _i = 0, _a = Object.getOwnPropertyNames(chain); _i < _a.length; _i++) { - var key = _a[_i]; - if (!isJsPrivate(key) && - ignoredProperties.indexOf(key) === -1 && - (typeof obj !== "function" || reservedFunctionProperties.indexOf(key) === -1) && - // Don't add property from a higher prototype if it already exists in a lower one - ts.addToSeen(seen, key)) { - var value = safeGetPropertyOfObject(chain, key); - // Don't repeat "toString" that matches signature from Object.prototype - if (!(key === "toString" && typeof value === "function" && value.length === 0)) { - entries.push({ key: key, value: value }); - } - } - } - chain = Object.getPrototypeOf(chain); - } - return entries.sort(function (e1, e2) { return ts.compareStringsCaseSensitive(e1.key, e2.key); }); - } - function getFunctionLength(fn) { - return ts.tryCast(safeGetPropertyOfObject(fn, "length"), ts.isNumber) || 0; - } - function safeGetPropertyOfObject(obj, key) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - return desc && desc.value; - } - function isNullOrUndefined(value) { - return value == null; // tslint:disable-line - } - function anyValue(name, comment) { - return { kind: 0 /* Const */, name: name, typeName: "any", comment: comment }; - } - function isJsPrivate(name) { - return ts.startsWith(name, "_"); - } - ts.isJsPrivate = isJsPrivate; - function tryRequire(fileNameToRequire) { - try { - return require(fileNameToRequire); - } - catch (_a) { - return undefined; - } - } -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var server; (function (server) { @@ -94820,7 +95751,6 @@ var ts; server.ActionSet = "action::set"; server.ActionInvalidate = "action::invalidate"; server.ActionPackageInstalled = "action::packageInstalled"; - server.ActionValueInspected = "action::valueInspected"; server.EventTypesRegistry = "event::typesRegistry"; server.EventBeginInstallTypes = "event::beginInstallTypes"; server.EventEndInstallTypes = "event::endInstallTypes"; @@ -94837,6 +95767,11 @@ var ts; * typingsInstaller will run the command with `${npmLocation} install ...`. */ Arguments.NpmLocation = "--npmLocation"; + /** + * Flag indicating that the typings installer should try to validate the default npm location. + * If the default npm is not found when this flag is enabled, fallback to `npm install` + */ + Arguments.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; })(Arguments = server.Arguments || (server.Arguments = {})); function hasArgument(argumentName) { return ts.sys.args.indexOf(argumentName) >= 0; @@ -95433,7 +96368,7 @@ var ts; /* @internal */ var ts; (function (ts) { - ts.scanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ true); + ts.scanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ true); var SemanticMeaning; (function (SemanticMeaning) { SemanticMeaning[SemanticMeaning["None"] = 0] = "None"; @@ -95444,37 +96379,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 151 /* Parameter */: - case 186 /* BindingElement */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 275 /* PropertyAssignment */: - case 276 /* ShorthandPropertyAssignment */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 274 /* CatchClause */: - case 267 /* JsxAttribute */: + case 152 /* Parameter */: + case 187 /* BindingElement */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 276 /* PropertyAssignment */: + case 277 /* ShorthandPropertyAssignment */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 275 /* CatchClause */: + case 268 /* JsxAttribute */: return 1 /* Value */; - case 150 /* TypeParameter */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 168 /* TypeLiteral */: + case 151 /* TypeParameter */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 169 /* TypeLiteral */: return 2 /* Type */; - case 309 /* JSDocTypedefTag */: + case 310 /* 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 278 /* EnumMember */: - case 240 /* ClassDeclaration */: + case 279 /* EnumMember */: + case 241 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -95484,26 +96419,26 @@ var ts; else { return 4 /* Namespace */; } - case 243 /* EnumDeclaration */: - case 252 /* NamedImports */: - case 253 /* ImportSpecifier */: - case 248 /* ImportEqualsDeclaration */: - case 249 /* ImportDeclaration */: - case 254 /* ExportAssignment */: - case 255 /* ExportDeclaration */: + case 244 /* EnumDeclaration */: + case 253 /* NamedImports */: + case 254 /* ImportSpecifier */: + case 249 /* ImportEqualsDeclaration */: + case 250 /* ImportDeclaration */: + case 255 /* ExportAssignment */: + case 256 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 284 /* SourceFile */: + case 285 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 254 /* ExportAssignment */ || node.parent.kind === 259 /* ExternalModuleReference */) { + else if (node.parent.kind === 255 /* ExportAssignment */ || node.parent.kind === 260 /* ExternalModuleReference */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -95535,11 +96470,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 148 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 248 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 149 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 249 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 148 /* QualifiedName */) { + while (node.parent.kind === 149 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -95551,27 +96486,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 148 /* QualifiedName */) { - while (root.parent && root.parent.kind === 148 /* QualifiedName */) { + if (root.parent.kind === 149 /* QualifiedName */) { + while (root.parent && root.parent.kind === 149 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 164 /* TypeReference */ && !isLastClause; + return root.parent.kind === 165 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 189 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 189 /* PropertyAccessExpression */) { + if (root.parent.kind === 190 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 190 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 211 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 273 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 212 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 274 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 240 /* ClassDeclaration */ && root.parent.parent.token === 109 /* ImplementsKeyword */) || - (decl.kind === 241 /* InterfaceDeclaration */ && root.parent.parent.token === 86 /* ExtendsKeyword */); + return (decl.kind === 241 /* ClassDeclaration */ && root.parent.parent.token === 110 /* ImplementsKeyword */) || + (decl.kind === 242 /* InterfaceDeclaration */ && root.parent.parent.token === 87 /* ExtendsKeyword */); } return false; } @@ -95580,17 +96515,17 @@ var ts; node = node.parent; } switch (node.kind) { - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 178 /* ThisType */: + case 179 /* ThisType */: return true; } switch (node.parent.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return true; - case 183 /* ImportType */: + case 184 /* ImportType */: return !node.parent.isTypeOf; - case 211 /* ExpressionWithTypeArguments */: + case 212 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -95617,7 +96552,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 233 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 234 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -95633,11 +96568,11 @@ var ts; } ts.hasPropertyAccessExpressionWithName = hasPropertyAccessExpressionWithName; function isJumpStatementTarget(node) { - return node.kind === 72 /* Identifier */ && ts.isBreakOrContinueStatement(node.parent) && node.parent.label === node; + return node.kind === 73 /* Identifier */ && ts.isBreakOrContinueStatement(node.parent) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { - return node.kind === 72 /* Identifier */ && ts.isLabeledStatement(node.parent) && node.parent.label === node; + return node.kind === 73 /* Identifier */ && ts.isLabeledStatement(node.parent) && node.parent.label === node; } ts.isLabelOfLabeledStatement = isLabelOfLabeledStatement; function isLabelName(node) { @@ -95649,40 +96584,40 @@ var ts; } ts.isTagName = isTagName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 149 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 189 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 190 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 244 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 245 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { - return node.kind === 72 /* Identifier */ && + return node.kind === 73 /* Identifier */ && ts.isFunctionLike(node.parent) && node.parent.name === node; } ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 275 /* PropertyAssignment */: - case 278 /* EnumMember */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 244 /* ModuleDeclaration */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 276 /* PropertyAssignment */: + case 279 /* EnumMember */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 245 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 149 /* ComputedPropertyName */: + case 150 /* ComputedPropertyName */: return true; - case 182 /* LiteralType */: - return node.parent.parent.kind === 180 /* IndexedAccessType */; + case 183 /* LiteralType */: + return node.parent.parent.kind === 181 /* IndexedAccessType */; default: return false; } @@ -95706,17 +96641,17 @@ var ts; return undefined; } switch (node.kind) { - case 284 /* SourceFile */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 244 /* ModuleDeclaration */: + case 285 /* SourceFile */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 245 /* ModuleDeclaration */: return node; } } @@ -95724,48 +96659,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 284 /* SourceFile */: + case 285 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: return "class" /* classElement */; - case 241 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 242 /* TypeAliasDeclaration */: - case 302 /* JSDocCallbackTag */: - case 309 /* JSDocTypedefTag */: + case 242 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 243 /* TypeAliasDeclaration */: + case 303 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 243 /* EnumDeclaration */: return "enum" /* enumElement */; - case 237 /* VariableDeclaration */: + case 244 /* EnumDeclaration */: return "enum" /* enumElement */; + case 238 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 197 /* ArrowFunction */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: return "function" /* functionElement */; - case 158 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 159 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 159 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 160 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return "property" /* memberVariableElement */; - case 162 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 161 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 160 /* CallSignature */: return "call" /* callSignatureElement */; - case 157 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 150 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 278 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 151 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 248 /* ImportEqualsDeclaration */: - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: - case 251 /* NamespaceImport */: + case 163 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 162 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 161 /* CallSignature */: return "call" /* callSignatureElement */; + case 158 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 151 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 279 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 152 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 249 /* ImportEqualsDeclaration */: + case 254 /* ImportSpecifier */: + case 258 /* ExportSpecifier */: + case 252 /* NamespaceImport */: return "alias" /* alias */; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -95792,7 +96727,7 @@ var ts; return "" /* unknown */; } } - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; default: return "" /* unknown */; @@ -95808,12 +96743,12 @@ var ts; ts.getNodeKind = getNodeKind; function isThis(node) { switch (node.kind) { - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: // case SyntaxKind.ThisType: TODO: GH#9267 return true; - case 72 /* Identifier */: + case 73 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 151 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 152 /* Parameter */; default: return false; } @@ -95878,42 +96813,42 @@ var ts; return false; } switch (n.kind) { - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 188 /* ObjectLiteralExpression */: - case 184 /* ObjectBindingPattern */: - case 168 /* TypeLiteral */: - case 218 /* Block */: - case 245 /* ModuleBlock */: - case 246 /* CaseBlock */: - case 252 /* NamedImports */: - case 256 /* NamedExports */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 189 /* ObjectLiteralExpression */: + case 185 /* ObjectBindingPattern */: + case 169 /* TypeLiteral */: + case 219 /* Block */: + case 246 /* ModuleBlock */: + case 247 /* CaseBlock */: + case 253 /* NamedImports */: + case 257 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 192 /* NewExpression */: + case 193 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 191 /* CallExpression */: - case 195 /* ParenthesizedExpression */: - case 177 /* ParenthesizedType */: + case 192 /* CallExpression */: + case 196 /* ParenthesizedExpression */: + case 178 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 165 /* FunctionType */: - case 166 /* ConstructorType */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 161 /* ConstructSignature */: - case 160 /* CallSignature */: - case 197 /* ArrowFunction */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 162 /* ConstructSignature */: + case 161 /* CallSignature */: + case 198 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -95923,65 +96858,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 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 222 /* IfStatement */: + case 223 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 187 /* ArrayLiteralExpression */: - case 185 /* ArrayBindingPattern */: - case 190 /* ElementAccessExpression */: - case 149 /* ComputedPropertyName */: - case 170 /* TupleType */: + case 188 /* ArrayLiteralExpression */: + case 186 /* ArrayBindingPattern */: + case 191 /* ElementAccessExpression */: + case 150 /* ComputedPropertyName */: + case 171 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 224 /* WhileStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 225 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 223 /* DoStatement */: + case 224 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - return hasChildOfKind(n, 107 /* WhileKeyword */, sourceFile) + return hasChildOfKind(n, 108 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 167 /* TypeQuery */: + case 168 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 199 /* TypeOfExpression */: - case 198 /* DeleteExpression */: - case 200 /* VoidExpression */: - case 207 /* YieldExpression */: - case 208 /* SpreadElement */: + case 200 /* TypeOfExpression */: + case 199 /* DeleteExpression */: + case 201 /* VoidExpression */: + case 208 /* YieldExpression */: + case 209 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 193 /* TaggedTemplateExpression */: + case 194 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 206 /* TemplateExpression */: + case 207 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 216 /* TemplateSpan */: + case 217 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 255 /* ExportDeclaration */: - case 249 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 205 /* ConditionalExpression */: + case 206 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -96160,7 +97095,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 284 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 285 /* 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. @@ -96230,17 +97165,17 @@ var ts; return true; } // <div> { | </div> or <div a={| </div> - if (token.kind === 28 /* LessThanToken */ && token.parent.kind === 270 /* JsxExpression */) { + if (token.kind === 28 /* LessThanToken */ && token.parent.kind === 271 /* JsxExpression */) { return true; } // <div> { // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 270 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 271 /* JsxExpression */) { return true; } // <div>|</div> - if (token.kind === 28 /* LessThanToken */ && token.parent.kind === 263 /* JsxClosingElement */) { + if (token.kind === 28 /* LessThanToken */ && token.parent.kind === 264 /* JsxClosingElement */) { return true; } return false; @@ -96359,15 +97294,15 @@ var ts; nTypeArguments++; break; case 37 /* EqualsGreaterThanToken */: - case 72 /* Identifier */: + case 73 /* Identifier */: case 10 /* StringLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - case 102 /* TrueKeyword */: - case 87 /* FalseKeyword */: - case 104 /* TypeOfKeyword */: - case 86 /* ExtendsKeyword */: - case 129 /* KeyOfKeyword */: + case 103 /* TrueKeyword */: + case 88 /* FalseKeyword */: + case 105 /* TypeOfKeyword */: + case 87 /* ExtendsKeyword */: + case 130 /* KeyOfKeyword */: case 24 /* DotToken */: case 50 /* BarToken */: case 56 /* QuestionToken */: @@ -96426,10 +97361,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 164 /* TypeReference */ || node.kind === 191 /* CallExpression */) { + if (node.kind === 165 /* TypeReference */ || node.kind === 192 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 240 /* ClassDeclaration */ || node.kind === 241 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 241 /* ClassDeclaration */ || node.kind === 242 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -96449,7 +97384,7 @@ var ts; } ts.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral; function isPunctuation(kind) { - return 18 /* FirstPunctuation */ <= kind && kind <= 71 /* LastPunctuation */; + return 18 /* FirstPunctuation */ <= kind && kind <= 72 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position, sourceFile) { @@ -96459,9 +97394,9 @@ var ts; ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function isAccessibilityModifier(kind) { switch (kind) { - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: return true; } return false; @@ -96474,18 +97409,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 187 /* ArrayLiteralExpression */ || - node.kind === 188 /* ObjectLiteralExpression */) { + if (node.kind === 188 /* ArrayLiteralExpression */ || + node.kind === 189 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 204 /* BinaryExpression */ && + if (node.parent.kind === 205 /* BinaryExpression */ && node.parent.left === node && - node.parent.operatorToken.kind === 59 /* EqualsToken */) { + node.parent.operatorToken.kind === 60 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 227 /* ForOfStatement */ && + if (node.parent.kind === 228 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -96493,7 +97428,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 275 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 276 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -96537,22 +97472,22 @@ var ts; } ts.createTextChange = createTextChange; ts.typeKeywords = [ - 120 /* AnyKeyword */, - 146 /* BigIntKeyword */, - 123 /* BooleanKeyword */, - 87 /* FalseKeyword */, - 129 /* KeyOfKeyword */, - 132 /* NeverKeyword */, - 96 /* NullKeyword */, - 135 /* NumberKeyword */, - 136 /* ObjectKeyword */, - 138 /* StringKeyword */, - 139 /* SymbolKeyword */, - 102 /* TrueKeyword */, - 106 /* VoidKeyword */, - 141 /* UndefinedKeyword */, - 142 /* UniqueKeyword */, - 143 /* UnknownKeyword */, + 121 /* AnyKeyword */, + 147 /* BigIntKeyword */, + 124 /* BooleanKeyword */, + 88 /* FalseKeyword */, + 130 /* KeyOfKeyword */, + 133 /* NeverKeyword */, + 97 /* NullKeyword */, + 136 /* NumberKeyword */, + 137 /* ObjectKeyword */, + 139 /* StringKeyword */, + 140 /* SymbolKeyword */, + 103 /* TrueKeyword */, + 107 /* VoidKeyword */, + 142 /* UndefinedKeyword */, + 143 /* UniqueKeyword */, + 144 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -96588,7 +97523,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 149 /* ComputedPropertyName */ + return name.kind === 150 /* 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.getTextOfIdentifierOrLiteral(name); @@ -96664,7 +97599,7 @@ var ts; } return ts.firstDefined(symbol.declarations, function (decl) { var name = ts.getNameOfDeclaration(decl); - return name && name.kind === 72 /* Identifier */ ? name.escapedText : undefined; + return name && name.kind === 73 /* Identifier */ ? name.escapedText : undefined; }); } ts.symbolEscapedNameNoDefault = symbolEscapedNameNoDefault; @@ -96753,7 +97688,7 @@ var ts; /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 151 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 152 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -97007,10 +97942,15 @@ var ts; return ts.ensureScriptKind(fileName, host && host.getScriptKind && host.getScriptKind(fileName)); } ts.getScriptKind = getScriptKind; - function getSymbolTarget(symbol) { + function getSymbolTarget(symbol, checker) { var next = symbol; - while (isTransientSymbol(next) && next.target) { - next = next.target; + while (isAliasSymbol(next) || (isTransientSymbol(next) && next.target)) { + if (isTransientSymbol(next) && next.target) { + next = next.target; + } + else { + next = ts.skipAlias(next, checker); + } } return next; } @@ -97018,6 +97958,9 @@ var ts; function isTransientSymbol(symbol) { return (symbol.flags & 33554432 /* Transient */) !== 0; } + function isAliasSymbol(symbol) { + return (symbol.flags & 2097152 /* Alias */) !== 0; + } function getUniqueSymbolId(symbol, checker) { return ts.getSymbolId(ts.skipAlias(symbol, checker)); } @@ -97053,7 +97996,14 @@ var ts; function getSynthesizedDeepCloneWithRenames(node, includeTrivia, renameMap, checker, callback) { if (includeTrivia === void 0) { includeTrivia = true; } var clone; - if (ts.isIdentifier(node) && renameMap && checker) { + 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.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer); + } + } + else if (renameMap && checker && ts.isIdentifier(node)) { var symbol = checker.getSymbolAtLocation(node); var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); if (renameInfo) { @@ -97217,15 +98167,15 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 192 /* NewExpression */: + case 193 /* NewExpression */: return checker.getContextualType(parent); - case 204 /* BinaryExpression */: { + case 205 /* 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 271 /* CaseClause */: + case 272 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -97267,8 +98217,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 206 /* TemplateExpression */: - case 193 /* TaggedTemplateExpression */: + case 207 /* TemplateExpression */: + case 194 /* TaggedTemplateExpression */: return true; default: return false; @@ -97311,7 +98261,7 @@ var ts; var ts; (function (ts) { function createClassifier() { - var scanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ false); + var scanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ false); function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { return convertClassificationsToResult(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); } @@ -97388,13 +98338,13 @@ var ts; function handleToken() { switch (token) { case 42 /* SlashToken */: - case 64 /* SlashEqualsToken */: + case 65 /* SlashEqualsToken */: if (!noRegexTable[lastNonTriviaToken] && scanner.reScanSlashToken() === 13 /* RegularExpressionLiteral */) { token = 13 /* RegularExpressionLiteral */; } break; case 28 /* LessThanToken */: - if (lastNonTriviaToken === 72 /* Identifier */) { + if (lastNonTriviaToken === 73 /* Identifier */) { // Could be the start of something generic. Keep track of that by bumping // up the current count of generic contexts we may be in. angleBracketStack++; @@ -97407,16 +98357,16 @@ var ts; angleBracketStack--; } break; - case 120 /* AnyKeyword */: - case 138 /* StringKeyword */: - case 135 /* NumberKeyword */: - case 123 /* BooleanKeyword */: - case 139 /* SymbolKeyword */: + case 121 /* AnyKeyword */: + case 139 /* StringKeyword */: + case 136 /* NumberKeyword */: + case 124 /* BooleanKeyword */: + case 140 /* 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, // causing a noisy experience for the user. - token = 72 /* Identifier */; + token = 73 /* Identifier */; } break; case 15 /* TemplateHead */: @@ -97455,14 +98405,14 @@ var ts; break; } if (lastNonTriviaToken === 24 /* DotToken */) { - token = 72 /* Identifier */; + token = 73 /* Identifier */; } else if (ts.isKeyword(lastNonTriviaToken) && ts.isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { // We have two keywords in a row. Only treat the second as a keyword if // it's a sequence that could legally occur in the language. Otherwise // treat it as an identifier. This way, if someone writes "private var" // we recognize that 'var' is actually an identifier here. - token = 72 /* Identifier */; + token = 73 /* Identifier */; } } } @@ -97476,19 +98426,19 @@ var ts; /// we have a series of divide operator. this list allows us to be more accurate by ruling out /// locations where a regexp cannot exist. var noRegexTable = ts.arrayToNumericMap([ - 72 /* Identifier */, + 73 /* Identifier */, 10 /* StringLiteral */, 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 13 /* RegularExpressionLiteral */, - 100 /* ThisKeyword */, + 101 /* ThisKeyword */, 44 /* PlusPlusToken */, 45 /* MinusMinusToken */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 19 /* CloseBraceToken */, - 102 /* TrueKeyword */, - 87 /* FalseKeyword */, + 103 /* TrueKeyword */, + 88 /* FalseKeyword */, ], function (token) { return token; }, function () { return true; }); function getNewEndOfLineState(scanner, token, lastOnTemplateStack) { switch (token) { @@ -97600,10 +98550,10 @@ var ts; return true; } switch (keyword2) { - case 126 /* GetKeyword */: - case 137 /* SetKeyword */: - case 124 /* ConstructorKeyword */: - case 116 /* StaticKeyword */: + case 127 /* GetKeyword */: + case 138 /* SetKeyword */: + case 125 /* ConstructorKeyword */: + case 117 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". default: return false; // Any other keyword following "public" is actually an identifier, not a real keyword. @@ -97648,9 +98598,9 @@ var ts; case 30 /* GreaterThanToken */: case 31 /* LessThanEqualsToken */: case 32 /* GreaterThanEqualsToken */: - case 94 /* InstanceOfKeyword */: - case 93 /* InKeyword */: - case 119 /* AsKeyword */: + case 95 /* InstanceOfKeyword */: + case 94 /* InKeyword */: + case 120 /* AsKeyword */: case 33 /* EqualsEqualsToken */: case 34 /* ExclamationEqualsToken */: case 35 /* EqualsEqualsEqualsToken */: @@ -97660,18 +98610,18 @@ var ts; case 50 /* BarToken */: case 54 /* AmpersandAmpersandToken */: case 55 /* BarBarToken */: - case 70 /* BarEqualsToken */: - case 69 /* AmpersandEqualsToken */: - case 71 /* CaretEqualsToken */: - case 66 /* LessThanLessThanEqualsToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 60 /* PlusEqualsToken */: - case 61 /* MinusEqualsToken */: - case 62 /* AsteriskEqualsToken */: - case 64 /* SlashEqualsToken */: - case 65 /* PercentEqualsToken */: - case 59 /* EqualsToken */: + case 71 /* BarEqualsToken */: + case 70 /* AmpersandEqualsToken */: + case 72 /* CaretEqualsToken */: + case 67 /* LessThanLessThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 61 /* PlusEqualsToken */: + case 62 /* MinusEqualsToken */: + case 63 /* AsteriskEqualsToken */: + case 65 /* SlashEqualsToken */: + case 66 /* PercentEqualsToken */: + case 60 /* EqualsToken */: case 27 /* CommaToken */: return true; default: @@ -97698,7 +98648,7 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 5 /* operator */; } - else if (token >= 18 /* FirstPunctuation */ && token <= 71 /* LastPunctuation */) { + else if (token >= 18 /* FirstPunctuation */ && token <= 72 /* LastPunctuation */) { return 10 /* punctuation */; } switch (token) { @@ -97717,7 +98667,7 @@ var ts; case 5 /* WhitespaceTrivia */: case 4 /* NewLineTrivia */: return 8 /* whiteSpace */; - case 72 /* Identifier */: + case 73 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { return 6 /* stringLiteral */; @@ -97742,10 +98692,10 @@ 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 244 /* ModuleDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 239 /* FunctionDeclaration */: + case 245 /* ModuleDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 240 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -97865,8 +98815,8 @@ var ts; var spanStart = span.start; var spanLength = span.length; // Make a scanner we can get trivia from. - var triviaScanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); - var mergeConflictScanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + var triviaScanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + var mergeConflictScanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); var result = []; processElement(sourceFile); return { spans: result, endOfLineState: 0 /* None */ }; @@ -97958,18 +98908,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 304 /* JSDocParameterTag */: + case 305 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 307 /* JSDocTypeTag */: + case 308 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 305 /* JSDocReturnTag */: + case 306 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -98056,22 +99006,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 262 /* JsxOpeningElement */: + case 263 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 263 /* JsxClosingElement */: + case 264 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 261 /* JsxSelfClosingElement */: + case 262 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -98098,19 +99048,19 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { var parent = token.parent; - if (tokenKind === 59 /* EqualsToken */) { + if (tokenKind === 60 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 237 /* VariableDeclaration */ || - parent.kind === 154 /* PropertyDeclaration */ || - parent.kind === 151 /* Parameter */ || - parent.kind === 267 /* JsxAttribute */) { + if (parent.kind === 238 /* VariableDeclaration */ || + parent.kind === 155 /* PropertyDeclaration */ || + parent.kind === 152 /* Parameter */ || + parent.kind === 268 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 204 /* BinaryExpression */ || - parent.kind === 202 /* PrefixUnaryExpression */ || - parent.kind === 203 /* PostfixUnaryExpression */ || - parent.kind === 205 /* ConditionalExpression */) { + if (parent.kind === 205 /* BinaryExpression */ || + parent.kind === 203 /* PrefixUnaryExpression */ || + parent.kind === 204 /* PostfixUnaryExpression */ || + parent.kind === 206 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -98124,7 +99074,7 @@ var ts; } else if (tokenKind === 10 /* StringLiteral */) { // TODO: GH#18217 - return token.parent.kind === 267 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 268 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -98137,35 +99087,35 @@ var ts; else if (tokenKind === 11 /* JsxText */) { return 23 /* jsxText */; } - else if (tokenKind === 72 /* Identifier */) { + else if (tokenKind === 73 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 151 /* Parameter */: + case 152 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -98222,7 +99172,7 @@ var ts; return convertPathCompletions(completion.paths); case 1 /* Properties */: { var entries = []; - Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, sourceFile, sourceFile, checker, 7 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary + Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, sourceFile, sourceFile, checker, 8 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries: entries }; } case 2 /* Types */: { @@ -98261,7 +99211,7 @@ var ts; var isNewIdentifierLocation = true; // The user may type in a path that doesn't yet exist, creating a "new identifier" with respect to the collection of identifiers the server is aware of. var entries = pathCompletions.map(function (_a) { var name = _a.name, kind = _a.kind, span = _a.span, extension = _a.extension; - return ({ name: name, kind: kind, kindModifiers: kindModifiersFromExtension(extension), sortText: "0", replacementSpan: span }); + return ({ name: name, kind: kind, kindModifiers: kindModifiersFromExtension(extension), sortText: Completions.SortText.LocationPriority, replacementSpan: span }); }); return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } @@ -98288,11 +99238,11 @@ var ts; function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { var parent = node.parent; switch (parent.kind) { - case 182 /* LiteralType */: + case 183 /* LiteralType */: switch (parent.parent.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; - case 180 /* IndexedAccessType */: + case 181 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; @@ -98300,9 +99250,9 @@ var ts; // } // let x: Foo["/*completion position*/"] return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); - case 183 /* ImportType */: + case 184 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 173 /* UnionType */: { + case 174 /* UnionType */: { if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); @@ -98312,7 +99262,7 @@ var ts; default: return undefined; } - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -98329,7 +99279,7 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 190 /* ElementAccessExpression */: { + case 191 /* ElementAccessExpression */: { var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; if (node === argumentExpression) { // Get all names of properties on the expression @@ -98342,8 +99292,8 @@ var ts; } return undefined; } - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* 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 @@ -98352,9 +99302,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 249 /* ImportDeclaration */: - case 255 /* ExportDeclaration */: - case 259 /* ExternalModuleReference */: + case 250 /* ImportDeclaration */: + case 256 /* ExportDeclaration */: + case 260 /* 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*/"); @@ -98801,7 +99751,7 @@ var ts; var offset = index !== -1 ? index + 1 : 0; // If the range is an identifier, span is unnecessary. var length = text.length - offset; - return length === 0 || ts.isIdentifierText(text.substr(offset, length), 7 /* ESNext */) ? undefined : ts.createTextSpan(textStart + offset, length); + return length === 0 || ts.isIdentifierText(text.substr(offset, length), 8 /* ESNext */) ? undefined : ts.createTextSpan(textStart + offset, length); } // Returns true if the path is explicitly relative to the script (i.e. relative to . or ..) function isPathRelativeToScript(path) { @@ -98864,6 +99814,14 @@ var ts; (function (ts) { var Completions; (function (Completions) { + var SortText; + (function (SortText) { + SortText["LocationPriority"] = "0"; + SortText["SuggestedClassMembers"] = "1"; + SortText["GlobalsOrKeywords"] = "2"; + SortText["AutoImportSuggestions"] = "3"; + SortText["JavascriptIdentifiers"] = "4"; + })(SortText = Completions.SortText || (Completions.SortText = {})); var SymbolOriginInfoKind; (function (SymbolOriginInfoKind) { SymbolOriginInfoKind[SymbolOriginInfoKind["ThisType"] = 0] = "ThisType"; @@ -98898,14 +99856,15 @@ var ts; var typeChecker = program.getTypeChecker(); var compilerOptions = program.getCompilerOptions(); var contextToken = ts.findPrecedingToken(position, sourceFile); - if (triggerCharacter && !isValidTrigger(sourceFile, triggerCharacter, contextToken, position)) + if (triggerCharacter && !ts.isInString(sourceFile, position, contextToken) && !isValidTrigger(sourceFile, triggerCharacter, contextToken, position)) { return undefined; + } var stringCompletions = Completions.StringCompletions.getStringLiteralCompletions(sourceFile, position, contextToken, typeChecker, compilerOptions, host, log, preferences); if (stringCompletions) { return stringCompletions; } if (contextToken && ts.isBreakOrContinueStatement(contextToken.parent) - && (contextToken.kind === 73 /* BreakKeyword */ || contextToken.kind === 78 /* ContinueKeyword */ || contextToken.kind === 72 /* Identifier */)) { + && (contextToken.kind === 74 /* BreakKeyword */ || contextToken.kind === 79 /* ContinueKeyword */ || contextToken.kind === 73 /* Identifier */)) { return getLabelCompletionAtPosition(contextToken.parent); } var completionData = getCompletionData(program, log, sourceFile, isUncheckedFile(sourceFile, compilerOptions), position, preferences, /*detailsEntryId*/ undefined); @@ -98932,7 +99891,7 @@ var ts; return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } 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; + 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)) { // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. @@ -98946,20 +99905,20 @@ var ts; name: tagName.getFullText(sourceFile) + (hasClosingAngleBracket ? "" : ">"), kind: "class" /* classElement */, kindModifiers: undefined, - sortText: "0", + sortText: SortText.LocationPriority, }; return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } var entries = []; if (isUncheckedFile(sourceFile, compilerOptions)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap); getJSCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); // TODO: GH#18217 } else { if (!isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } - getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); + getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap); } if (keywordFilters !== 0 /* None */) { var entryNames = ts.arrayToSet(entries, function (e) { return e.name; }); @@ -99001,7 +99960,7 @@ var ts; name: realName, kind: "warning" /* warning */, kindModifiers: "", - sortText: "1" + sortText: SortText.JavascriptIdentifiers }); } }); @@ -99010,14 +99969,9 @@ var ts; return typeof literal === "object" ? ts.pseudoBigIntToString(literal) + "n" : JSON.stringify(literal); }; function createCompletionEntryForLiteral(literal) { - return { name: completionNameForLiteral(literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: "0" }; + return { name: completionNameForLiteral(literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } - function createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { - var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind); - if (!info) { - return undefined; - } - var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess; + function createCompletionEntry(symbol, sortText, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { var insertText; var replacementSpan; if (origin && origin.kind === 0 /* ThisType */) { @@ -99054,7 +100008,7 @@ var ts; name: name, kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - sortText: "0", + sortText: sortText, source: getSourceFromOrigin(origin), hasAction: trueOrUndefined(!!origin && originIsExport(origin)), isRecommended: trueOrUndefined(isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker)), @@ -99072,7 +100026,7 @@ var ts; function getSourceFromOrigin(origin) { return origin && originIsExport(origin) ? ts.stripQuotes(origin.moduleSymbol.name) : undefined; } - function getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, target, log, kind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap) { + function getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, target, log, kind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap) { var start = ts.timestamp(); // Tracks unique names. // We don't set this for global variables or completions from external module exports, because we can have multiple of those. @@ -99082,14 +100036,18 @@ var ts; for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { var symbol = symbols_1[_i]; var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; - var entry = createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences); - if (!entry) { + var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind); + if (!info) { continue; } - var name = entry.name; + var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess; if (uniques.has(name)) { continue; } + var entry = createCompletionEntry(symbol, symbolToSortTextMap && symbolToSortTextMap[ts.getSymbolId(symbol)] || SortText.LocationPriority, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences); + if (!entry) { + continue; + } // Latter case tests whether this is a global variable. if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { // TODO: GH#18217 uniques.set(name, true); @@ -99122,7 +100080,7 @@ var ts; name: name, kindModifiers: "" /* none */, kind: "label" /* label */, - sortText: "0" + sortText: SortText.LocationPriority }); } } @@ -99262,25 +100220,25 @@ var ts; function getContextualType(previousToken, position, sourceFile, checker) { var parent = previousToken.parent; switch (previousToken.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.getContextualTypeFromParent(previousToken, checker); - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: switch (parent.kind) { - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; } - case 95 /* NewKeyword */: + case 96 /* NewKeyword */: return checker.getContextualType(parent); - case 74 /* CaseKeyword */: + case 75 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 260 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 261 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo @@ -99299,7 +100257,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 === 284 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 285 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId) { var typeChecker = program.getTypeChecker(); @@ -99350,11 +100308,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 288 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 289 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 310 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 311 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -99404,7 +100362,7 @@ var ts; if (contextToken.kind === 24 /* DotToken */) { isRightOfDot = true; switch (parent.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if (node.end === contextToken.pos && @@ -99416,14 +100374,14 @@ var ts; return undefined; } break; - case 148 /* QualifiedName */: + case 149 /* QualifiedName */: node = parent.left; break; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: node = parent.name; break; - case 183 /* ImportType */: - case 214 /* MetaProperty */: + case 184 /* ImportType */: + case 215 /* MetaProperty */: node = parent; break; default: @@ -99436,7 +100394,7 @@ var ts; // <UI.Test /* completion position */ /> // 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 === 189 /* PropertyAccessExpression */) { + if (parent && parent.kind === 190 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -99444,48 +100402,48 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 30 /* GreaterThanToken */: - if (currentToken.parent.kind === 260 /* JsxElement */ || currentToken.parent.kind === 262 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 261 /* JsxElement */ || currentToken.parent.kind === 263 /* JsxOpeningElement */) { location = currentToken; } break; case 42 /* SlashToken */: - if (currentToken.parent.kind === 261 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 262 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 263 /* JsxClosingElement */: + case 264 /* JsxClosingElement */: if (contextToken.kind === 42 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 261 /* JsxSelfClosingElement */: - case 260 /* JsxElement */: - case 262 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: + case 261 /* JsxElement */: + case 263 /* JsxOpeningElement */: if (contextToken.kind === 28 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 267 /* JsxAttribute */: + case 268 /* JsxAttribute */: switch (previousToken.kind) { - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: isJsxInitializer = true; break; - case 72 /* Identifier */: + case 73 /* Identifier */: // For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute) // Note for `<div someBool f>` we don't want to treat this as a jsx inializer, instead it's the attribute name. if (parent !== previousToken.parent && !parent.initializer && - ts.findChildOfKind(parent, 59 /* EqualsToken */, sourceFile)) { + ts.findChildOfKind(parent, 60 /* EqualsToken */, sourceFile)) { isJsxInitializer = previousToken; } } @@ -99499,6 +100457,7 @@ var ts; var keywordFilters = 0 /* None */; var symbols = []; var symbolToOriginInfoMap = []; + var symbolToSortTextMap = []; if (isRightOfDot) { getTypeScriptMemberSymbols(); } @@ -99544,15 +100503,16 @@ var ts; recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer, - insideJsDocTagTypeExpression: insideJsDocTagTypeExpression + insideJsDocTagTypeExpression: insideJsDocTagTypeExpression, + symbolToSortTextMap: symbolToSortTextMap }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 304 /* JSDocParameterTag */: - case 310 /* JSDocPropertyTag */: - case 305 /* JSDocReturnTag */: - case 307 /* JSDocTypeTag */: - case 309 /* JSDocTypedefTag */: + case 305 /* JSDocParameterTag */: + case 311 /* JSDocPropertyTag */: + case 306 /* JSDocReturnTag */: + case 308 /* JSDocTypeTag */: + case 310 /* JSDocTypedefTag */: return true; default: return false; @@ -99594,15 +100554,15 @@ 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 !== 284 /* SourceFile */ && d.kind !== 244 /* ModuleDeclaration */ && d.kind !== 243 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 285 /* SourceFile */ && d.kind !== 245 /* ModuleDeclaration */ && d.kind !== 244 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; } } } - if (ts.isMetaProperty(node) && (node.keywordToken === 95 /* NewKeyword */ || node.keywordToken === 92 /* ImportKeyword */)) { - var completion = (node.keywordToken === 95 /* NewKeyword */) ? "target" : "meta"; + if (ts.isMetaProperty(node) && (node.keywordToken === 96 /* NewKeyword */ || node.keywordToken === 93 /* ImportKeyword */)) { + var completion = (node.keywordToken === 96 /* NewKeyword */) ? "target" : "meta"; symbols.push(typeChecker.createSymbol(4 /* Property */, ts.escapeLeadingUnderscores(completion))); return; } @@ -99623,7 +100583,7 @@ var ts; else { for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; - if (typeChecker.isValidPropertyAccessForCompletions(node.kind === 183 /* ImportType */ ? node : node.parent, type, symbol)) { + if (typeChecker.isValidPropertyAccessForCompletions(node.kind === 184 /* ImportType */ ? node : node.parent, type, symbol)) { addPropertySymbol(symbol); } } @@ -99726,14 +100686,22 @@ var ts; var isTypeOnly = isTypeOnlyCompletion(); var symbolMeanings = (isTypeOnly ? 0 /* None */ : 67220415 /* Value */) | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); + for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { + var symbol = symbols_2[_i]; + if (!typeChecker.isArgumentsSymbol(symbol) && + !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === sourceFile; })) { + symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.GlobalsOrKeywords; + } + } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 284 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 285 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType) { - for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker); _i < _a.length; _i++) { - var symbol = _a[_i]; + for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { + var symbol = _b[_a]; symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { kind: 0 /* ThisType */ }; symbols.push(symbol); + symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.SuggestedClassMembers; } } } @@ -99760,10 +100728,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 284 /* SourceFile */: - case 206 /* TemplateExpression */: - case 270 /* JsxExpression */: - case 218 /* Block */: + case 285 /* SourceFile */: + case 207 /* TemplateExpression */: + case 271 /* JsxExpression */: + case 219 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -99802,25 +100770,25 @@ var ts; } function isContextTokenValueLocation(contextToken) { return contextToken && - contextToken.kind === 104 /* TypeOfKeyword */ && - (contextToken.parent.kind === 167 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + contextToken.kind === 105 /* TypeOfKeyword */ && + (contextToken.parent.kind === 168 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 57 /* ColonToken */: - return parentKind === 154 /* PropertyDeclaration */ || - parentKind === 153 /* PropertySignature */ || - parentKind === 151 /* Parameter */ || - parentKind === 237 /* VariableDeclaration */ || + return parentKind === 155 /* PropertyDeclaration */ || + parentKind === 154 /* PropertySignature */ || + parentKind === 152 /* Parameter */ || + parentKind === 238 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); - case 59 /* EqualsToken */: - return parentKind === 242 /* TypeAliasDeclaration */; - case 119 /* AsKeyword */: - return parentKind === 212 /* AsExpression */; - case 86 /* ExtendsKeyword */: - return parentKind === 150 /* TypeParameter */; + case 60 /* EqualsToken */: + return parentKind === 243 /* TypeAliasDeclaration */; + case 120 /* AsKeyword */: + return parentKind === 213 /* AsExpression */; + case 87 /* ExtendsKeyword */: + return parentKind === 151 /* TypeParameter */; } } return false; @@ -99852,6 +100820,7 @@ var ts; // So in `declare namespace foo {} declare module "foo" { export = foo; }`, there will just be the global completion for `foo`. ts.some(resolvedModuleSymbol.declarations, function (d) { return !!d.getSourceFile().externalModuleIndicator; })) { symbols.push(resolvedModuleSymbol); + symbolToSortTextMap[ts.getSymbolId(resolvedModuleSymbol)] = SortText.AutoImportSuggestions; symbolToOriginInfoMap[ts.getSymbolId(resolvedModuleSymbol)] = { kind: 3 /* Export */, moduleSymbol: moduleSymbol, isDefaultExport: false }; } for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { @@ -99876,6 +100845,7 @@ var ts; var origin = { kind: 3 /* Export */, moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; if (detailsEntryId || stringContainsCharactersInOrder(getSymbolName(symbol, origin, target).toLowerCase(), tokenTextLowerCase)) { symbols.push(symbol); + symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.AutoImportSuggestions; symbolToOriginInfoMap[ts.getSymbolId(symbol)] = origin; } } @@ -99927,11 +100897,11 @@ var ts; return true; } if (contextToken.kind === 30 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 262 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 263 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 263 /* JsxClosingElement */ || contextToken.parent.kind === 261 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 260 /* JsxElement */; + if (contextToken.parent.kind === 264 /* JsxClosingElement */ || contextToken.parent.kind === 262 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 261 /* JsxElement */; } } return false; @@ -99942,40 +100912,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 191 /* CallExpression */ // func( a, | - || containingNodeKind === 157 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 192 /* NewExpression */ // new C(a, | - || containingNodeKind === 187 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 204 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 165 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 192 /* CallExpression */ // func( a, | + || containingNodeKind === 158 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 193 /* NewExpression */ // new C(a, | + || containingNodeKind === 188 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 205 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 166 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 191 /* CallExpression */ // func( | - || containingNodeKind === 157 /* Constructor */ // constructor( | - || containingNodeKind === 192 /* NewExpression */ // new C(a| - || containingNodeKind === 195 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 177 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 192 /* CallExpression */ // func( | + || containingNodeKind === 158 /* Constructor */ // constructor( | + || containingNodeKind === 193 /* NewExpression */ // new C(a| + || containingNodeKind === 196 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 178 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 187 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 162 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 149 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 130 /* ModuleKeyword */: // module | - case 131 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 188 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 163 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 150 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 131 /* ModuleKeyword */: // module | + case 132 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 244 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 245 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 240 /* ClassDeclaration */; // class A{ | - case 59 /* EqualsToken */: - return containingNodeKind === 237 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 204 /* BinaryExpression */; // x = a| + return containingNodeKind === 241 /* ClassDeclaration */; // class A{ | + case 60 /* EqualsToken */: + return containingNodeKind === 238 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 205 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 206 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 207 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 216 /* TemplateSpan */; // `aa ${10} dd ${| - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - return containingNodeKind === 154 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 217 /* TemplateSpan */; // `aa ${10} dd ${| + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + return containingNodeKind === 155 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -100002,7 +100972,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 188 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 189 /* ObjectLiteralExpression */) { var typeForObject = typeChecker.getContextualType(objectLikeContainer); if (!typeForObject) return 2 /* Fail */; @@ -100011,7 +100981,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 184 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 185 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -100022,12 +100992,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 === 227 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 151 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 228 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 152 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 156 /* MethodDeclaration */ || rootDeclaration.parent.kind === 159 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 157 /* MethodDeclaration */ || rootDeclaration.parent.kind === 160 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -100069,7 +101039,7 @@ var ts; return 0 /* Continue */; // cursor is in an import clause // try to show exported member for imported module - var moduleSpecifier = (namedImportsOrExports.kind === 252 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 253 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -100100,7 +101070,7 @@ var ts; var classElement = contextToken.parent; var classElementModifierFlags = ts.isClassElement(classElement) ? ts.getModifierFlags(classElement) : 0 /* None */; // If this is context token is not something we are editing now, consider if this would lead to be modifier - if (contextToken.kind === 72 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) { + if (contextToken.kind === 73 /* Identifier */ && !isCurrentlyEditingNode(contextToken)) { switch (contextToken.getText()) { case "private": classElementModifierFlags = classElementModifierFlags | 8 /* Private */; @@ -100137,7 +101107,7 @@ var ts; break; case 40 /* AsteriskToken */: return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined; - case 72 /* Identifier */: + case 73 /* Identifier */: return contextToken.text === "async" && ts.isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : undefined; } @@ -100190,12 +101160,12 @@ var ts; case 30 /* GreaterThanToken */: // End of a type argument list case 29 /* LessThanSlashToken */: case 42 /* SlashToken */: - case 72 /* Identifier */: - case 189 /* PropertyAccessExpression */: - case 268 /* JsxAttributes */: - case 267 /* JsxAttribute */: - case 269 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 261 /* JsxSelfClosingElement */ || parent.kind === 262 /* JsxOpeningElement */)) { + case 73 /* Identifier */: + case 190 /* PropertyAccessExpression */: + case 269 /* JsxAttributes */: + case 268 /* JsxAttribute */: + case 270 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 262 /* JsxSelfClosingElement */ || parent.kind === 263 /* JsxOpeningElement */)) { if (contextToken.kind === 30 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 42 /* SlashToken */)) @@ -100203,7 +101173,7 @@ var ts; } return parent; } - else if (parent.kind === 267 /* JsxAttribute */) { + else if (parent.kind === 268 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -100215,7 +101185,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 === 267 /* JsxAttribute */) || (parent.kind === 269 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 268 /* JsxAttribute */) || (parent.kind === 270 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -100225,8 +101195,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 270 /* JsxExpression */ && - parent.parent && parent.parent.kind === 267 /* JsxAttribute */) { + parent.kind === 271 /* JsxExpression */ && + parent.parent && parent.parent.kind === 268 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -100234,7 +101204,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 269 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 270 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -100254,62 +101224,62 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 237 /* VariableDeclaration */ || - containingNodeKind === 238 /* VariableDeclarationList */ || - containingNodeKind === 219 /* VariableStatement */ || - containingNodeKind === 243 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 238 /* VariableDeclaration */ || + containingNodeKind === 239 /* VariableDeclarationList */ || + containingNodeKind === 220 /* VariableStatement */ || + containingNodeKind === 244 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 241 /* InterfaceDeclaration */ || // interface A<T, | - containingNodeKind === 185 /* ArrayBindingPattern */ || // var [x, y| - containingNodeKind === 242 /* TypeAliasDeclaration */ || // type Map, K, | + containingNodeKind === 242 /* InterfaceDeclaration */ || // interface A<T, | + containingNodeKind === 186 /* ArrayBindingPattern */ || // var [x, y| + containingNodeKind === 243 /* TypeAliasDeclaration */ || // type Map, K, | // class A<T, | // var C = class D<T, | (ts.isClassLike(parent) && !!parent.typeParameters && parent.typeParameters.end >= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 185 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 186 /* ArrayBindingPattern */; // var [.| case 57 /* ColonToken */: - return containingNodeKind === 186 /* BindingElement */; // var {x :html| + return containingNodeKind === 187 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 185 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 186 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 274 /* CatchClause */ || + return containingNodeKind === 275 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 243 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 244 /* EnumDeclaration */; // enum a { | case 28 /* LessThanToken */: - return containingNodeKind === 240 /* ClassDeclaration */ || // class A< | - containingNodeKind === 209 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 241 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 242 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 241 /* ClassDeclaration */ || // class A< | + containingNodeKind === 210 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 242 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 243 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); - case 116 /* StaticKeyword */: - return containingNodeKind === 154 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + case 117 /* StaticKeyword */: + return containingNodeKind === 155 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 151 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 185 /* ArrayBindingPattern */); // var [...z| - case 115 /* PublicKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - return containingNodeKind === 151 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); - case 119 /* AsKeyword */: - return containingNodeKind === 253 /* ImportSpecifier */ || - containingNodeKind === 257 /* ExportSpecifier */ || - containingNodeKind === 251 /* NamespaceImport */; - case 126 /* GetKeyword */: - case 137 /* SetKeyword */: + return containingNodeKind === 152 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 186 /* ArrayBindingPattern */); // var [...z| + case 116 /* PublicKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + return containingNodeKind === 152 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + case 120 /* AsKeyword */: + return containingNodeKind === 254 /* ImportSpecifier */ || + containingNodeKind === 258 /* ExportSpecifier */ || + containingNodeKind === 252 /* NamespaceImport */; + case 127 /* GetKeyword */: + case 138 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); - case 76 /* ClassKeyword */: - case 84 /* EnumKeyword */: - case 110 /* InterfaceKeyword */: - case 90 /* FunctionKeyword */: - case 105 /* VarKeyword */: - case 92 /* ImportKeyword */: - case 111 /* LetKeyword */: - case 77 /* ConstKeyword */: - case 117 /* YieldKeyword */: - case 140 /* TypeKeyword */: // type htm| + case 77 /* ClassKeyword */: + case 85 /* EnumKeyword */: + case 111 /* InterfaceKeyword */: + case 91 /* FunctionKeyword */: + case 106 /* VarKeyword */: + case 93 /* ImportKeyword */: + case 112 /* LetKeyword */: + case 78 /* ConstKeyword */: + case 118 /* YieldKeyword */: + case 141 /* TypeKeyword */: // type htm| return true; case 40 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -100332,22 +101302,22 @@ var ts; } // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(contextToken)) { - case 118 /* AbstractKeyword */: - case 76 /* ClassKeyword */: - case 77 /* ConstKeyword */: - case 125 /* DeclareKeyword */: - case 84 /* EnumKeyword */: - case 90 /* FunctionKeyword */: - case 110 /* InterfaceKeyword */: - case 111 /* LetKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 115 /* PublicKeyword */: - case 116 /* StaticKeyword */: - case 105 /* VarKeyword */: - case 117 /* YieldKeyword */: + case 119 /* AbstractKeyword */: + case 77 /* ClassKeyword */: + case 78 /* ConstKeyword */: + case 126 /* DeclareKeyword */: + case 85 /* EnumKeyword */: + case 91 /* FunctionKeyword */: + case 111 /* InterfaceKeyword */: + case 112 /* LetKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 116 /* PublicKeyword */: + case 117 /* StaticKeyword */: + case 106 /* VarKeyword */: + case 118 /* YieldKeyword */: return true; - case 121 /* AsyncKeyword */: + case 122 /* AsyncKeyword */: return ts.isPropertyDeclaration(contextToken.parent); } return ts.isDeclarationName(contextToken) @@ -100357,7 +101327,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 157 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 158 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -100380,12 +101350,12 @@ 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 !== 275 /* PropertyAssignment */ && - m.kind !== 276 /* ShorthandPropertyAssignment */ && - m.kind !== 186 /* BindingElement */ && - m.kind !== 156 /* MethodDeclaration */ && - m.kind !== 158 /* GetAccessor */ && - m.kind !== 159 /* SetAccessor */) { + if (m.kind !== 276 /* PropertyAssignment */ && + m.kind !== 277 /* ShorthandPropertyAssignment */ && + m.kind !== 187 /* BindingElement */ && + m.kind !== 157 /* MethodDeclaration */ && + m.kind !== 159 /* GetAccessor */ && + m.kind !== 160 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -100395,7 +101365,7 @@ var ts; var existingName = void 0; if (ts.isBindingElement(m) && m.propertyName) { // include only identifiers in completion list - if (m.propertyName.kind === 72 /* Identifier */) { + if (m.propertyName.kind === 73 /* Identifier */) { existingName = m.propertyName.escapedText; } } @@ -100420,10 +101390,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 !== 154 /* PropertyDeclaration */ && - m.kind !== 156 /* MethodDeclaration */ && - m.kind !== 158 /* GetAccessor */ && - m.kind !== 159 /* SetAccessor */) { + if (m.kind !== 155 /* PropertyDeclaration */ && + m.kind !== 157 /* MethodDeclaration */ && + m.kind !== 159 /* GetAccessor */ && + m.kind !== 160 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -100463,7 +101433,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 267 /* JsxAttribute */) { + if (attr.kind === 268 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } @@ -100483,9 +101453,9 @@ var ts; || ts.isKnownSymbol(symbol)) { return undefined; } - var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + var validIdentifierResult = { name: name, needsConvertPropertyAccess: false }; if (ts.isIdentifierText(name, target)) - return validIdentiferResult; + return validIdentifierResult; switch (kind) { case 3 /* MemberLike */: return undefined; @@ -100498,7 +101468,7 @@ var ts; return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; case 5 /* None */: case 4 /* String */: - return validIdentiferResult; + return validIdentifierResult; default: ts.Debug.assertNever(kind); } @@ -100507,12 +101477,12 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 73 /* FirstKeyword */; i <= 147 /* LastKeyword */; i++) { + for (var i = 74 /* FirstKeyword */; i <= 148 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, kindModifiers: "" /* none */, - sortText: "0" + sortText: SortText.GlobalsOrKeywords }); } return res; @@ -100532,8 +101502,8 @@ var ts; case 0 /* None */: return false; case 1 /* All */: - return kind === 121 /* AsyncKeyword */ || 122 /* AwaitKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === 125 /* DeclareKeyword */ || kind === 130 /* ModuleKeyword */ - || ts.isTypeKeyword(kind) && kind !== 141 /* UndefinedKeyword */; + return kind === 122 /* AsyncKeyword */ || 123 /* AwaitKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === 126 /* DeclareKeyword */ || kind === 131 /* ModuleKeyword */ + || ts.isTypeKeyword(kind) && kind !== 142 /* UndefinedKeyword */; case 2 /* ClassElementKeywords */: return isClassMemberCompletionKeyword(kind); case 3 /* InterfaceElementKeywords */: @@ -100551,54 +101521,54 @@ var ts; } function isTypeScriptOnlyKeyword(kind) { switch (kind) { - case 118 /* AbstractKeyword */: - case 120 /* AnyKeyword */: - case 146 /* BigIntKeyword */: - case 123 /* BooleanKeyword */: - case 125 /* DeclareKeyword */: - case 84 /* EnumKeyword */: - case 145 /* GlobalKeyword */: - case 109 /* ImplementsKeyword */: - case 127 /* InferKeyword */: - case 110 /* InterfaceKeyword */: - case 128 /* IsKeyword */: - case 129 /* KeyOfKeyword */: - case 130 /* ModuleKeyword */: - case 131 /* NamespaceKeyword */: - case 132 /* NeverKeyword */: - case 135 /* NumberKeyword */: - case 136 /* ObjectKeyword */: - case 113 /* PrivateKeyword */: - case 114 /* ProtectedKeyword */: - case 115 /* PublicKeyword */: - case 133 /* ReadonlyKeyword */: - case 138 /* StringKeyword */: - case 139 /* SymbolKeyword */: - case 140 /* TypeKeyword */: - case 142 /* UniqueKeyword */: - case 143 /* UnknownKeyword */: + case 119 /* AbstractKeyword */: + case 121 /* AnyKeyword */: + case 147 /* BigIntKeyword */: + case 124 /* BooleanKeyword */: + case 126 /* DeclareKeyword */: + case 85 /* EnumKeyword */: + case 146 /* GlobalKeyword */: + case 110 /* ImplementsKeyword */: + case 128 /* InferKeyword */: + case 111 /* InterfaceKeyword */: + case 129 /* IsKeyword */: + case 130 /* KeyOfKeyword */: + case 131 /* ModuleKeyword */: + case 132 /* NamespaceKeyword */: + case 133 /* NeverKeyword */: + case 136 /* NumberKeyword */: + case 137 /* ObjectKeyword */: + case 114 /* PrivateKeyword */: + case 115 /* ProtectedKeyword */: + case 116 /* PublicKeyword */: + case 134 /* ReadonlyKeyword */: + case 139 /* StringKeyword */: + case 140 /* SymbolKeyword */: + case 141 /* TypeKeyword */: + case 143 /* UniqueKeyword */: + case 144 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 133 /* ReadonlyKeyword */; + return kind === 134 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { - case 118 /* AbstractKeyword */: - case 124 /* ConstructorKeyword */: - case 126 /* GetKeyword */: - case 137 /* SetKeyword */: - case 121 /* AsyncKeyword */: + case 119 /* AbstractKeyword */: + case 125 /* ConstructorKeyword */: + case 127 /* GetKeyword */: + case 138 /* SetKeyword */: + case 122 /* AsyncKeyword */: return true; default: return ts.isClassMemberModifier(kind); } } function isFunctionLikeBodyKeyword(kind) { - return kind === 121 /* AsyncKeyword */ || kind === 122 /* AwaitKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === 122 /* AsyncKeyword */ || kind === 123 /* AwaitKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { return ts.isIdentifier(node) ? node.originalKeywordKind || 0 /* Unknown */ : node.kind; @@ -100635,7 +101605,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location) { // class c { method() { } | method2() { } } switch (location.kind) { - case 311 /* SyntaxList */: + case 312 /* 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); @@ -100744,40 +101714,40 @@ var ts; } function getHighlightSpans(node, sourceFile) { switch (node.kind) { - case 91 /* IfKeyword */: - case 83 /* ElseKeyword */: + case 92 /* IfKeyword */: + case 84 /* ElseKeyword */: return ts.isIfStatement(node.parent) ? getIfElseOccurrences(node.parent, sourceFile) : undefined; - case 97 /* ReturnKeyword */: + case 98 /* ReturnKeyword */: return useParent(node.parent, ts.isReturnStatement, getReturnOccurrences); - case 101 /* ThrowKeyword */: + case 102 /* ThrowKeyword */: return useParent(node.parent, ts.isThrowStatement, getThrowOccurrences); - case 103 /* TryKeyword */: - case 75 /* CatchKeyword */: - case 88 /* FinallyKeyword */: - var tryStatement = node.kind === 75 /* CatchKeyword */ ? node.parent.parent : node.parent; + case 104 /* TryKeyword */: + case 76 /* CatchKeyword */: + case 89 /* FinallyKeyword */: + var tryStatement = node.kind === 76 /* CatchKeyword */ ? node.parent.parent : node.parent; return useParent(tryStatement, ts.isTryStatement, getTryCatchFinallyOccurrences); - case 99 /* SwitchKeyword */: + case 100 /* SwitchKeyword */: return useParent(node.parent, ts.isSwitchStatement, getSwitchCaseDefaultOccurrences); - case 74 /* CaseKeyword */: - case 80 /* DefaultKeyword */: + case 75 /* CaseKeyword */: + case 81 /* DefaultKeyword */: return useParent(node.parent.parent.parent, ts.isSwitchStatement, getSwitchCaseDefaultOccurrences); - case 73 /* BreakKeyword */: - case 78 /* ContinueKeyword */: + case 74 /* BreakKeyword */: + case 79 /* ContinueKeyword */: return useParent(node.parent, ts.isBreakOrContinueStatement, getBreakOrContinueStatementOccurrences); - case 89 /* ForKeyword */: - case 107 /* WhileKeyword */: - case 82 /* DoKeyword */: + case 90 /* ForKeyword */: + case 108 /* WhileKeyword */: + case 83 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); - case 124 /* ConstructorKeyword */: - return getFromAllDeclarations(ts.isConstructorDeclaration, [124 /* ConstructorKeyword */]); - case 126 /* GetKeyword */: - case 137 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [126 /* GetKeyword */, 137 /* SetKeyword */]); - case 122 /* AwaitKeyword */: + case 125 /* ConstructorKeyword */: + return getFromAllDeclarations(ts.isConstructorDeclaration, [125 /* ConstructorKeyword */]); + case 127 /* GetKeyword */: + case 138 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [127 /* GetKeyword */, 138 /* SetKeyword */]); + case 123 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); - case 121 /* AsyncKeyword */: + case 122 /* AsyncKeyword */: return highlightSpans(getAsyncAndAwaitOccurrences(node)); - case 117 /* YieldKeyword */: + case 118 /* YieldKeyword */: return highlightSpans(getYieldOccurrences(node)); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) @@ -100820,7 +101790,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 284 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 285 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -100852,16 +101822,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 232 /* SwitchStatement */: - if (statement.kind === 228 /* ContinueStatement */) { + case 233 /* SwitchStatement */: + if (statement.kind === 229 /* ContinueStatement */) { return false; } // falls through - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 224 /* WhileStatement */: - case 223 /* DoStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 225 /* WhileStatement */: + case 224 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -100877,11 +101847,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 245 /* ModuleBlock */: - case 284 /* SourceFile */: - case 218 /* Block */: - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 246 /* ModuleBlock */: + case 285 /* SourceFile */: + case 219 /* Block */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); @@ -100889,12 +101859,12 @@ var ts; else { return container.statements; } - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 239 /* FunctionDeclaration */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 240 /* FunctionDeclaration */: return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: 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. @@ -100925,12 +101895,12 @@ var ts; } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 89 /* ForKeyword */, 107 /* WhileKeyword */, 82 /* DoKeyword */)) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 90 /* ForKeyword */, 108 /* WhileKeyword */, 83 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 223 /* DoStatement */) { + if (loopNode.kind === 224 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 107 /* WhileKeyword */)) { + if (pushKeywordIf(keywords, loopTokens[i], 108 /* WhileKeyword */)) { break; } } @@ -100938,7 +101908,7 @@ var ts; } ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 73 /* BreakKeyword */, 78 /* ContinueKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 74 /* BreakKeyword */, 79 /* ContinueKeyword */); } }); return keywords; @@ -100947,13 +101917,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 223 /* DoStatement */: - case 224 /* WhileStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 224 /* DoStatement */: + case 225 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -100961,13 +101931,13 @@ var ts; } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 99 /* SwitchKeyword */); + pushKeywordIf(keywords, switchStatement.getFirstToken(), 100 /* SwitchKeyword */); // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 74 /* CaseKeyword */, 80 /* DefaultKeyword */); + pushKeywordIf(keywords, clause.getFirstToken(), 75 /* CaseKeyword */, 81 /* DefaultKeyword */); ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 73 /* BreakKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 74 /* BreakKeyword */); } }); }); @@ -100975,13 +101945,13 @@ var ts; } function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 103 /* TryKeyword */); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 104 /* TryKeyword */); if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 75 /* CatchKeyword */); + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 76 /* CatchKeyword */); } if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 88 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 88 /* FinallyKeyword */); + var finallyKeyword = ts.findChildOfKind(tryStatement, 89 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 89 /* FinallyKeyword */); } return keywords; } @@ -100992,13 +101962,13 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - keywords.push(ts.findChildOfKind(throwStatement, 101 /* ThrowKeyword */, sourceFile)); + keywords.push(ts.findChildOfKind(throwStatement, 102 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - keywords.push(ts.findChildOfKind(returnStatement, 97 /* ReturnKeyword */, sourceFile)); + keywords.push(ts.findChildOfKind(returnStatement, 98 /* ReturnKeyword */, sourceFile)); }); } return keywords; @@ -101010,11 +101980,11 @@ var ts; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - keywords.push(ts.findChildOfKind(returnStatement, 97 /* ReturnKeyword */, sourceFile)); + keywords.push(ts.findChildOfKind(returnStatement, 98 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - keywords.push(ts.findChildOfKind(throwStatement, 101 /* ThrowKeyword */, sourceFile)); + keywords.push(ts.findChildOfKind(throwStatement, 102 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -101026,13 +101996,13 @@ var ts; var keywords = []; if (func.modifiers) { func.modifiers.forEach(function (modifier) { - pushKeywordIf(keywords, modifier, 121 /* AsyncKeyword */); + pushKeywordIf(keywords, modifier, 122 /* AsyncKeyword */); }); } ts.forEachChild(func, function (child) { traverseWithoutCrossingFunction(child, function (node) { if (ts.isAwaitExpression(node)) { - pushKeywordIf(keywords, node.getFirstToken(), 122 /* AwaitKeyword */); + pushKeywordIf(keywords, node.getFirstToken(), 123 /* AwaitKeyword */); } }); }); @@ -101047,7 +102017,7 @@ var ts; ts.forEachChild(func, function (child) { traverseWithoutCrossingFunction(child, function (node) { if (ts.isYieldExpression(node)) { - pushKeywordIf(keywords, node.getFirstToken(), 117 /* YieldKeyword */); + pushKeywordIf(keywords, node.getFirstToken(), 118 /* YieldKeyword */); } }); }); @@ -101066,7 +102036,7 @@ var ts; // We'd like to highlight else/ifs together if they are only separated by whitespace // (i.e. the keywords are separated by no comments, no newlines). for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 83 /* ElseKeyword */ && i < keywords.length - 1) { + if (keywords[i].kind === 84 /* ElseKeyword */ && i < keywords.length - 1) { var elseKeyword = keywords[i]; var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. var shouldCombineElseAndIf = true; @@ -101101,10 +102071,10 @@ var ts; // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. while (true) { var children = ifStatement.getChildren(sourceFile); - pushKeywordIf(keywords, children[0], 91 /* IfKeyword */); + pushKeywordIf(keywords, children[0], 92 /* IfKeyword */); // Generally the 'else' keyword is second-to-last, so we traverse backwards. for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 83 /* ElseKeyword */)) { + if (pushKeywordIf(keywords, children[i], 84 /* ElseKeyword */)) { break; } } @@ -101320,12 +102290,12 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 191 /* CallExpression */: + case 192 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 237 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 238 /* VariableDeclaration */) { var name = parent.name; - if (name.kind === 72 /* Identifier */) { + if (name.kind === 73 /* Identifier */) { directImports.push(name); break; } @@ -101334,22 +102304,22 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 72 /* Identifier */: // for 'const x = require("y"); + case 73 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 251 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 252 /* 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 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -101359,11 +102329,11 @@ var ts; directImports.push(direct); } break; - case 183 /* ImportType */: + case 184 /* ImportType */: directImports.push(direct); break; default: - ts.Debug.assertNever(direct, "Unexpected import kind: " + ts.Debug.showSyntaxKind(direct)); + ts.Debug.failBadSyntaxKind(direct, "Unexpected import kind."); } } } @@ -101376,7 +102346,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 284 /* SourceFile */ || sourceFileLike.kind === 244 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 285 /* SourceFile */ || sourceFileLike.kind === 245 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -101431,17 +102401,17 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 248 /* ImportEqualsDeclaration */) { + if (decl.kind === 249 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } return; } - if (decl.kind === 72 /* Identifier */) { + if (decl.kind === 73 /* Identifier */) { handleNamespaceImportLike(decl); return; } - if (decl.kind === 183 /* ImportType */) { + if (decl.kind === 184 /* ImportType */) { if (decl.qualifier) { if (ts.isIdentifier(decl.qualifier) && decl.qualifier.escapedText === ts.symbolName(exportSymbol)) { singleReferences.push(decl.qualifier); @@ -101456,17 +102426,17 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 255 /* ExportDeclaration */) { + if (decl.kind === 256 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 252 /* NamedImports */: + case 253 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -101516,7 +102486,7 @@ var ts; } } else { - var localSymbol = element.kind === 257 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 258 /* 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); @@ -101545,7 +102515,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 === 284 /* SourceFile */) { + if (searchSourceFile.kind === 285 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -101593,7 +102563,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 === 284 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 285 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -101608,15 +102578,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 255 /* ExportDeclaration */: - case 249 /* ImportDeclaration */: { + case 256 /* ExportDeclaration */: + case 250 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 248 /* ImportEqualsDeclaration */: { + case 249 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -101640,7 +102610,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 189 /* PropertyAccessExpression */) { + if (parent.kind === 190 /* 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) @@ -101706,7 +102676,7 @@ var ts; var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; // Better detection for GH#20803 if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { - ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.formatSymbol(sym) + ", parent is " + ts.Debug.formatSymbol(sym.parent)); } return sym && exportInfo(sym, kind); } @@ -101762,10 +102732,10 @@ var ts; // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 237 /* VariableDeclaration */) { + if (parent.kind === 238 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 274 /* CatchClause */ ? undefined : p.parent.parent.kind === 219 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 275 /* CatchClause */ ? undefined : p.parent.parent.kind === 220 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -101774,13 +102744,13 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 253 /* ImportSpecifier */: + case 254 /* 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 250 /* ImportClause */: - case 251 /* NamespaceImport */: + case 251 /* ImportClause */: + case 252 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; default: @@ -101813,21 +102783,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 191 /* CallExpression */) { + if (node.kind === 192 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 284 /* SourceFile */) { + if (parent.kind === 285 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 245 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 246 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 244 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 245 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 259 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 260 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -101879,18 +102849,18 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 284 /* SourceFile */) { + if (node.kind === 285 /* 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 === 276 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 277 /* ShorthandPropertyAssignment */) { var result_1 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; } - else if (node.kind === 98 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { + else if (node.kind === 99 /* SuperKeyword */ || ts.isSuperProperty(node.parent)) { // References to and accesses on the super keyword only have one possible implementation, so no // need to "Find all References" var symbol = checker.getSymbolAtLocation(node); @@ -101970,7 +102940,7 @@ var ts; textSpan: textSpan, fileName: fileName, isWriteAccess: isWriteAccessForReference(node), - isDefinition: node.kind === 80 /* DefaultKeyword */ + isDefinition: node.kind === 81 /* DefaultKeyword */ || !!ts.getDeclarationFromName(node) || ts.isLiteralComputedPropertyDeclarationName(node), isInString: kind === 2 /* StringLiteral */ ? true : undefined, @@ -102027,13 +102997,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 188 /* ObjectLiteralExpression */) { + else if (node.kind === 189 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 209 /* ClassExpression */) { + else if (node.kind === 210 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -102076,7 +103046,7 @@ var ts; /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccessForReference(node) { var decl = ts.getDeclarationFromName(node); - return !!decl && declarationIsWriteAccess(decl) || node.kind === 80 /* DefaultKeyword */ || ts.isWriteAccess(node); + return !!decl && declarationIsWriteAccess(decl) || node.kind === 81 /* DefaultKeyword */ || ts.isWriteAccess(node); } /** * True if 'decl' provides a value, as in `function f() {}`; @@ -102087,46 +103057,46 @@ var ts; if (!!(decl.flags & 4194304 /* Ambient */)) return true; switch (decl.kind) { - case 204 /* BinaryExpression */: - case 186 /* BindingElement */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 80 /* DefaultKeyword */: - case 243 /* EnumDeclaration */: - case 278 /* EnumMember */: - case 257 /* ExportSpecifier */: - case 250 /* ImportClause */: // default import - case 248 /* ImportEqualsDeclaration */: - case 253 /* ImportSpecifier */: - case 241 /* InterfaceDeclaration */: - case 302 /* JSDocCallbackTag */: - case 309 /* JSDocTypedefTag */: - case 267 /* JsxAttribute */: - case 244 /* ModuleDeclaration */: - case 247 /* NamespaceExportDeclaration */: - case 251 /* NamespaceImport */: - case 151 /* Parameter */: - case 276 /* ShorthandPropertyAssignment */: - case 242 /* TypeAliasDeclaration */: - case 150 /* TypeParameter */: + case 205 /* BinaryExpression */: + case 187 /* BindingElement */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 81 /* DefaultKeyword */: + case 244 /* EnumDeclaration */: + case 279 /* EnumMember */: + case 258 /* ExportSpecifier */: + case 251 /* ImportClause */: // default import + case 249 /* ImportEqualsDeclaration */: + case 254 /* ImportSpecifier */: + case 242 /* InterfaceDeclaration */: + case 303 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: + case 268 /* JsxAttribute */: + case 245 /* ModuleDeclaration */: + case 248 /* NamespaceExportDeclaration */: + case 252 /* NamespaceImport */: + case 152 /* Parameter */: + case 277 /* ShorthandPropertyAssignment */: + case 243 /* TypeAliasDeclaration */: + case 151 /* TypeParameter */: return true; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return !!decl.body; - case 237 /* VariableDeclaration */: - case 154 /* PropertyDeclaration */: + case 238 /* VariableDeclaration */: + case 155 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 155 /* MethodSignature */: - case 153 /* PropertySignature */: - case 310 /* JSDocPropertyTag */: - case 304 /* JSDocParameterTag */: + case 156 /* MethodSignature */: + case 154 /* PropertySignature */: + case 311 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -102286,10 +103256,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 284 /* SourceFile */: + case 285 /* 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 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(FindAllReferences.nodeEntry(decl.name)); } @@ -102309,7 +103279,7 @@ var ts; var node = ts.isBinaryExpression(decl) && ts.isPropertyAccessExpression(decl.left) ? decl.left.expression : ts.isExportAssignment(decl) - ? ts.Debug.assertDefined(ts.findChildOfKind(decl, 85 /* ExportKeyword */, sourceFile)) + ? ts.Debug.assertDefined(ts.findChildOfKind(decl, 86 /* ExportKeyword */, sourceFile)) : ts.getNameOfDeclaration(decl) || decl; references.push(FindAllReferences.nodeEntry(node)); } @@ -102336,7 +103306,7 @@ var ts; if (ts.isThis(node)) { return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); } - if (node.kind === 98 /* SuperKeyword */) { + if (node.kind === 99 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } return undefined; @@ -102353,7 +103323,7 @@ var ts; // When renaming at an export specifier, rename the export and not the thing being exported. getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); } - else if (node && node.kind === 80 /* DefaultKeyword */) { + else if (node && node.kind === 81 /* DefaultKeyword */) { addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } @@ -102381,9 +103351,9 @@ var ts; } function getSpecialSearchKind(node) { switch (node.kind) { - case 124 /* ConstructorKeyword */: + case 125 /* ConstructorKeyword */: return 1 /* Constructor */; - case 72 /* Identifier */: + case 73 /* Identifier */: if (ts.isClassLike(node.parent)) { ts.Debug.assert(node.parent.name === node); return 2 /* Class */; @@ -102406,7 +103376,7 @@ var ts; if (symbol.flags & 33554432 /* Transient */) return undefined; // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. - ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol)); } return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) @@ -102511,8 +103481,8 @@ var ts; var sourceId = ts.getNodeId(sourceFile); var seenSymbols = this.sourceFileToSeenSymbols[sourceId] || (this.sourceFileToSeenSymbols[sourceId] = ts.createMap()); var anyNewSymbols = false; - for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { - var sym = symbols_2[_i]; + for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) { + var sym = symbols_3[_i]; anyNewSymbols = ts.addToSeen(seenSymbols, ts.getSymbolId(sym)) || anyNewSymbols; } return anyNewSymbols; @@ -102619,7 +103589,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 === 196 /* FunctionExpression */ || valueDeclaration.kind === 209 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 197 /* FunctionExpression */ || valueDeclaration.kind === 210 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -102629,7 +103599,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 240 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 241 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -102658,7 +103628,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 284 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 285 /* 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; @@ -102745,8 +103715,8 @@ var ts; // We found a match. Make sure it's not part of a larger word (i.e. the char // before and after it have to be a non-identifier char). var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 7 /* Latest */)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 7 /* Latest */))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 8 /* Latest */)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 8 /* Latest */))) { // Found a real match. Keep searching. positions.push(position); } @@ -102766,7 +103736,7 @@ var ts; function isValidReferencePosition(node, searchSymbolName) { // Compare the length so we filter out strict superstrings of the symbol we are looking for switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return node.text.length === searchSymbolName.length; case 10 /* StringLiteral */: { var str = node; @@ -102775,7 +103745,7 @@ var ts; } case 8 /* NumericLiteral */: return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length; - case 80 /* DefaultKeyword */: + case 81 /* DefaultKeyword */: return "default".length === searchSymbolName.length; default: return false; @@ -102839,7 +103809,7 @@ var ts; return; } if (ts.isExportSpecifier(parent)) { - ts.Debug.assert(referenceLocation.kind === 72 /* Identifier */); + ts.Debug.assert(referenceLocation.kind === 73 /* Identifier */); getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent, search, state, addReferencesHere); return; } @@ -102895,8 +103865,8 @@ var ts; } // For `export { foo as bar }`, rename `foo`, but not `bar`. if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - var isDefaultExport = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ - || exportSpecifier.name.originalKeywordKind === 80 /* DefaultKeyword */; + var isDefaultExport = referenceLocation.originalKeywordKind === 81 /* DefaultKeyword */ + || exportSpecifier.name.originalKeywordKind === 81 /* DefaultKeyword */; var exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */; var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); @@ -102975,7 +103945,7 @@ var ts; } var pusher = function () { return state.referenceAdder(search.symbol); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.kind === 80 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 81 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } @@ -103002,7 +103972,7 @@ var ts; } if (member.body) { member.body.forEachChild(function cb(node) { - if (node.kind === 100 /* ThisKeyword */) { + if (node.kind === 101 /* ThisKeyword */) { addRef(node); } else if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { @@ -103021,18 +103991,18 @@ var ts; if (constructorSymbol) { for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - var ctrKeyword = ts.findChildOfKind(decl, 124 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 157 /* Constructor */ && !!ctrKeyword); + var ctrKeyword = ts.findChildOfKind(decl, 125 /* ConstructorKeyword */, sourceFile); + ts.Debug.assert(decl.kind === 158 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 156 /* MethodDeclaration */) { + if (decl && decl.kind === 157 /* MethodDeclaration */) { var body = decl.body; if (body) { - forEachDescendantOfKind(body, 100 /* ThisKeyword */, function (thisKeyword) { + forEachDescendantOfKind(body, 101 /* ThisKeyword */, function (thisKeyword) { if (ts.isNewExpressionTarget(thisKeyword)) { addNode(thisKeyword); } @@ -103053,10 +104023,10 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 157 /* Constructor */); + ts.Debug.assert(decl.kind === 158 /* Constructor */); var body = decl.body; if (body) { - forEachDescendantOfKind(body, 98 /* SuperKeyword */, function (node) { + forEachDescendantOfKind(body, 99 /* SuperKeyword */, function (node) { if (ts.isCallExpressionTarget(node)) { addNode(node); } @@ -103080,10 +104050,10 @@ var ts; addReference(refNode); return; } - if (refNode.kind !== 72 /* Identifier */) { + if (refNode.kind !== 73 /* Identifier */) { return; } - if (refNode.parent.kind === 276 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 277 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -103103,7 +104073,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 218 /* Block */) { + if (body.kind === 219 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -103131,13 +104101,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 195 /* ParenthesizedExpression */: + case 196 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 197 /* ArrowFunction */: - case 196 /* FunctionExpression */: - case 188 /* ObjectLiteralExpression */: - case 209 /* ClassExpression */: - case 187 /* ArrayLiteralExpression */: + case 198 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 189 /* ObjectLiteralExpression */: + case 210 /* ClassExpression */: + case 188 /* ArrayLiteralExpression */: return true; default: return false; @@ -103190,13 +104160,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -103205,7 +104175,7 @@ var ts; } var sourceFile = searchSpaceNode.getSourceFile(); var references = ts.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "super", searchSpaceNode), function (node) { - if (node.kind !== 98 /* SuperKeyword */) { + if (node.kind !== 99 /* SuperKeyword */) { return; } var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); @@ -103217,41 +104187,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 72 /* Identifier */ && node.parent.kind === 151 /* Parameter */ && node.parent.name === node; + return node.kind === 73 /* Identifier */ && node.parent.kind === 152 /* 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 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 284 /* SourceFile */: + case 285 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 197 /* 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 === 284 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 285 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -103259,19 +104229,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 209 /* ClassExpression */: - case 240 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 241 /* 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.getModifierFlags(container) & 32 /* Static */) === staticFlag; - case 284 /* SourceFile */: - return container.kind === 284 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 285 /* SourceFile */: + return container.kind === 285 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return FindAllReferences.nodeEntry(n); }); @@ -103390,7 +104360,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 186 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 187 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -103749,7 +104719,7 @@ var ts; else { var defs = getDefinitionFromSymbol(typeChecker, symbol, node) || ts.emptyArray; // For a 'super()' call, put the signature first, else put the variable first. - return node.kind === 98 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]); + return node.kind === 99 /* SuperKeyword */ ? [sigInfo].concat(defs) : defs.concat([sigInfo]); } } // Because name in short-hand property assignment has two different meanings: property name and property value, @@ -103757,7 +104727,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 === 276 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 277 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -103910,18 +104880,18 @@ var ts; // (2) when the aliased symbol is originating from an import. // function shouldSkipAlias(node, declaration) { - if (node.kind !== 72 /* Identifier */) { + if (node.kind !== 73 /* Identifier */) { return false; } if (node.parent === declaration) { return true; } switch (declaration.kind) { - case 250 /* ImportClause */: - case 248 /* ImportEqualsDeclaration */: + case 251 /* ImportClause */: + case 249 /* ImportEqualsDeclaration */: return true; - case 253 /* ImportSpecifier */: - return declaration.parent.kind === 252 /* NamedImports */; + case 254 /* ImportSpecifier */: + return declaration.parent.kind === 253 /* NamedImports */; default: return false; } @@ -103931,7 +104901,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 124 /* ConstructorKeyword */)) { + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 125 /* ConstructorKeyword */)) { var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -104005,9 +104975,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 157 /* Constructor */: - case 166 /* ConstructorType */: - case 161 /* ConstructSignature */: + case 158 /* Constructor */: + case 167 /* ConstructorType */: + case 162 /* ConstructSignature */: return true; default: return false; @@ -104125,11 +105095,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 304 /* JSDocParameterTag */: - case 310 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: + case 311 /* JSDocPropertyTag */: return [declaration]; - case 302 /* JSDocCallbackTag */: - case 309 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: + case 310 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -104150,16 +105120,16 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 300 /* JSDocAugmentsTag */: + case 301 /* JSDocAugmentsTag */: return withNode(tag.class); - case 308 /* JSDocTemplateTag */: + case 309 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 307 /* JSDocTypeTag */: + case 308 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: - case 310 /* JSDocPropertyTag */: - case 304 /* JSDocParameterTag */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: + case 311 /* JSDocPropertyTag */: + case 305 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -104336,7 +105306,7 @@ var ts; function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) { return parameters.map(function (_a, i) { var name = _a.name, dotDotDotToken = _a.dotDotDotToken; - var paramName = name.kind === 72 /* Identifier */ ? name.text : "param" + i; + var paramName = name.kind === 73 /* Identifier */ ? name.text : "param" + i; var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : ""; return indentationStr + " * @param " + type + paramName + newLine; }).join(""); @@ -104346,23 +105316,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 157 /* Constructor */: - case 155 /* MethodSignature */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 158 /* Constructor */: + case 156 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 153 /* PropertySignature */: - case 243 /* EnumDeclaration */: - case 278 /* EnumMember */: - case 242 /* TypeAliasDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 154 /* PropertySignature */: + case 244 /* EnumDeclaration */: + case 279 /* EnumMember */: + case 243 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 219 /* VariableStatement */: { + case 220 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -104370,14 +105340,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 284 /* SourceFile */: + case 285 /* SourceFile */: return "quit"; - case 244 /* ModuleDeclaration */: + case 245 /* 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 === 244 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 204 /* BinaryExpression */: { + return commentOwner.parent.kind === 245 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 205 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -104396,14 +105366,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 195 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 196 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return rightHandSide.parameters; - case 209 /* ClassExpression */: { + case 210 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -104465,9 +105435,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 250 /* ImportClause */: - case 253 /* ImportSpecifier */: - case 248 /* ImportEqualsDeclaration */: + case 251 /* ImportClause */: + case 254 /* ImportSpecifier */: + case 249 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -104477,7 +105447,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 149 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 150 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -104494,7 +105464,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 === 149 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 150 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -104663,7 +105633,7 @@ var ts; return; } switch (node.kind) { - case 157 /* Constructor */: + case 158 /* 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); @@ -104675,21 +105645,21 @@ var ts; } } break; - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 155 /* MethodSignature */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 156 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 250 /* ImportClause */: + case 251 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -104701,7 +105671,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 251 /* NamespaceImport */) { + if (namedBindings.kind === 252 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -104712,8 +105682,8 @@ var ts; } } break; - case 186 /* BindingElement */: - case 237 /* VariableDeclaration */: + case 187 /* BindingElement */: + case 238 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -104734,12 +105704,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 197 /* ArrowFunction */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -104749,9 +105719,9 @@ var ts; } endNode(); break; - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -104759,18 +105729,18 @@ var ts; } endNode(); break; - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 257 /* ExportSpecifier */: - case 248 /* ImportEqualsDeclaration */: - case 162 /* IndexSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 242 /* TypeAliasDeclaration */: + case 258 /* ExportSpecifier */: + case 249 /* ImportEqualsDeclaration */: + case 163 /* IndexSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 243 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 204 /* BinaryExpression */: { + case 205 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -104852,12 +105822,12 @@ var ts; return false; } switch (a.kind) { - case 154 /* PropertyDeclaration */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 155 /* PropertyDeclaration */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -104873,7 +105843,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 !== 244 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 245 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -104903,7 +105873,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 244 /* ModuleDeclaration */) { + if (node.kind === 245 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -104911,16 +105881,16 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); // TODO: GH#18217 } switch (node.kind) { - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 209 /* ClassExpression */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 210 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 244 /* ModuleDeclaration */) { + if (node.kind === 245 /* ModuleDeclaration */) { return getModuleName(node); } if (name) { @@ -104930,16 +105900,16 @@ var ts; } } switch (node.kind) { - case 284 /* SourceFile */: + case 285 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : "<global>"; - case 197 /* ArrowFunction */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: + case 198 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -104947,13 +105917,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 157 /* Constructor */: + case 158 /* Constructor */: return "constructor"; - case 161 /* ConstructSignature */: + case 162 /* ConstructSignature */: return "new()"; - case 160 /* CallSignature */: + case 161 /* CallSignature */: return "()"; - case 162 /* IndexSignature */: + case 163 /* IndexSignature */: return "[]"; default: return "<unknown>"; @@ -104977,25 +105947,25 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 243 /* EnumDeclaration */: - case 241 /* InterfaceDeclaration */: - case 244 /* ModuleDeclaration */: - case 284 /* SourceFile */: - case 242 /* TypeAliasDeclaration */: - case 309 /* JSDocTypedefTag */: - case 302 /* JSDocCallbackTag */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 244 /* EnumDeclaration */: + case 242 /* InterfaceDeclaration */: + case 245 /* ModuleDeclaration */: + case 285 /* SourceFile */: + case 243 /* TypeAliasDeclaration */: + case 310 /* JSDocTypedefTag */: + case 303 /* JSDocCallbackTag */: return true; - case 157 /* Constructor */: - case 156 /* MethodDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 237 /* VariableDeclaration */: + case 158 /* Constructor */: + case 157 /* MethodDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 238 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 197 /* ArrowFunction */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -105005,10 +105975,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 245 /* ModuleBlock */: - case 284 /* SourceFile */: - case 156 /* MethodDeclaration */: - case 157 /* Constructor */: + case 246 /* ModuleBlock */: + case 285 /* SourceFile */: + case 157 /* MethodDeclaration */: + case 158 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -105017,7 +105987,7 @@ var ts; function hasSomeImportantChild(item) { return ts.some(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 237 /* VariableDeclaration */ && childKind !== 186 /* BindingElement */; + return childKind !== 238 /* VariableDeclaration */ && childKind !== 187 /* BindingElement */; }); } } @@ -105074,7 +106044,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 244 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 245 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -105088,13 +106058,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 149 /* ComputedPropertyName */; + return !member.name || member.name.kind === 150 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 284 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 285 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 237 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 238 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -105109,7 +106079,7 @@ var ts; return ts.declarationNameToString(parent.name); } // See if it is of the form "<expr> = function(){...}". If so, use the text from the left-hand side. - else if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === 59 /* EqualsToken */) { + else if (ts.isBinaryExpression(parent) && parent.operatorToken.kind === 60 /* EqualsToken */) { return nodeText(parent.left).replace(whiteSpaceRegex, ""); } // See if it is a property assignment, and if so use the property name @@ -105147,9 +106117,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 197 /* ArrowFunction */: - case 196 /* FunctionExpression */: - case 209 /* ClassExpression */: + case 198 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 210 /* ClassExpression */: return true; default: return false; @@ -105476,7 +106446,7 @@ var ts; } var lastImport = current - 1; if (lastImport !== firstImport) { - out.push(createOutliningSpanFromBounds(ts.findChildOfKind(statements[firstImport], 92 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */)); + out.push(createOutliningSpanFromBounds(ts.findChildOfKind(statements[firstImport], 93 /* ImportKeyword */, sourceFile).getStart(sourceFile), statements[lastImport].getEnd(), "imports" /* Imports */)); } } function visitNonImportNode(n) { @@ -105593,31 +106563,31 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 218 /* Block */: - if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 197 /* ArrowFunction */); + case 219 /* Block */: + if (ts.isFunctionLike(n.parent)) { + return functionSpan(n.parent, n, sourceFile); } // Check if the block is standalone, or 'attached' to some parent statement. // 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 223 /* DoStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 225 /* ForStatement */: - case 222 /* IfStatement */: - case 224 /* WhileStatement */: - case 231 /* WithStatement */: - case 274 /* CatchClause */: + case 224 /* DoStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 226 /* ForStatement */: + case 223 /* IfStatement */: + case 225 /* WhileStatement */: + case 232 /* WithStatement */: + case 275 /* CatchClause */: return spanForNode(n.parent); - case 235 /* TryStatement */: + case 236 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { return spanForNode(n.parent); } else if (tryStatement.finallyBlock === n) { - return spanForNode(ts.findChildOfKind(tryStatement, 88 /* FinallyKeyword */, sourceFile)); + return spanForNode(ts.findChildOfKind(tryStatement, 89 /* FinallyKeyword */, sourceFile)); } // falls through default: @@ -105625,22 +106595,22 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return spanForNode(n.parent); - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 246 /* CaseBlock */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 247 /* CaseBlock */: return spanForNode(n); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 260 /* JsxElement */: + case 261 /* JsxElement */: return spanForJSXElement(n); - case 261 /* JsxSelfClosingElement */: - case 262 /* JsxOpeningElement */: + case 262 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); } function spanForJSXElement(node) { @@ -105662,20 +106632,29 @@ var ts; // Otherwise, the collapsed section will include the end of the previous line. return spanForNode(node, /*autoCollapse*/ false, /*useFullStart*/ !ts.isArrayLiteralExpression(node.parent) && !ts.isCallExpression(node.parent), open); } - function spanForNode(hintSpanNode, autoCollapse, useFullStart, open) { + function spanForNode(hintSpanNode, autoCollapse, useFullStart, open, close) { if (autoCollapse === void 0) { autoCollapse = false; } if (useFullStart === void 0) { useFullStart = true; } if (open === void 0) { open = 18 /* OpenBraceToken */; } + if (close === void 0) { close = open === 18 /* OpenBraceToken */ ? 19 /* CloseBraceToken */ : 23 /* CloseBracketToken */; } var openToken = ts.findChildOfKind(n, open, sourceFile); - var close = open === 18 /* OpenBraceToken */ ? 19 /* CloseBraceToken */ : 23 /* CloseBracketToken */; var closeToken = ts.findChildOfKind(n, close, sourceFile); - if (!openToken || !closeToken) { - return undefined; - } - var textSpan = ts.createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd()); - return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); } } + function functionSpan(node, body, sourceFile) { + var openToken = ts.isNodeArrayMultiLine(node.parameters, sourceFile) + ? ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile) + : ts.findChildOfKind(body, 18 /* OpenBraceToken */, sourceFile); + var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 198 /* ArrowFunction */); + } + function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { + if (autoCollapse === void 0) { autoCollapse = false; } + if (useFullStart === void 0) { useFullStart = true; } + var textSpan = ts.createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd()); + return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse); + } function createOutliningSpan(textSpan, kind, hintSpan, autoCollapse, bannerText) { if (hintSpan === void 0) { hintSpan = textSpan; } if (autoCollapse === void 0) { autoCollapse = false; } @@ -105938,7 +106917,7 @@ var ts; if (ch >= 65 /* A */ && ch <= 90 /* Z */) { return true; } - if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 7 /* Latest */)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 8 /* Latest */)) { return false; } // TODO: find a way to determine this for any unicode characters in a @@ -105951,7 +106930,7 @@ var ts; if (ch >= 97 /* a */ && ch <= 122 /* z */) { return true; } - if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 7 /* Latest */)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 8 /* Latest */)) { return false; } // TODO: find a way to determine this for any unicode characters in a @@ -106203,10 +107182,10 @@ var ts; */ function tryConsumeDeclare() { var token = ts.scanner.getToken(); - if (token === 125 /* DeclareKeyword */) { + if (token === 126 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 130 /* ModuleKeyword */) { + if (token === 131 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -106224,7 +107203,7 @@ var ts; return false; } var token = ts.scanner.getToken(); - if (token === 92 /* ImportKeyword */) { + if (token === 93 /* ImportKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -106240,9 +107219,9 @@ var ts; return true; } else { - if (token === 72 /* Identifier */ || ts.isKeyword(token)) { + if (token === 73 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 144 /* FromKeyword */) { + if (token === 145 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -106250,7 +107229,7 @@ var ts; return true; } } - else if (token === 59 /* EqualsToken */) { + else if (token === 60 /* EqualsToken */) { if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } @@ -106273,7 +107252,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 144 /* FromKeyword */) { + if (token === 145 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -106285,11 +107264,11 @@ var ts; } else if (token === 40 /* AsteriskToken */) { token = nextToken(); - if (token === 119 /* AsKeyword */) { + if (token === 120 /* AsKeyword */) { token = nextToken(); - if (token === 72 /* Identifier */ || ts.isKeyword(token)) { + if (token === 73 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 144 /* FromKeyword */) { + if (token === 145 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -106307,7 +107286,7 @@ var ts; } function tryConsumeExport() { var token = ts.scanner.getToken(); - if (token === 85 /* ExportKeyword */) { + if (token === 86 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); if (token === 18 /* OpenBraceToken */) { @@ -106319,7 +107298,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 144 /* FromKeyword */) { + if (token === 145 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -106331,7 +107310,7 @@ var ts; } else if (token === 40 /* AsteriskToken */) { token = nextToken(); - if (token === 144 /* FromKeyword */) { + if (token === 145 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -106339,11 +107318,11 @@ var ts; } } } - else if (token === 92 /* ImportKeyword */) { + else if (token === 93 /* ImportKeyword */) { token = nextToken(); - if (token === 72 /* Identifier */ || ts.isKeyword(token)) { + if (token === 73 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 59 /* EqualsToken */) { + if (token === 60 /* EqualsToken */) { if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { return true; } @@ -106356,7 +107335,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 134 /* RequireKeyword */) { + if (token === 135 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -106371,7 +107350,7 @@ var ts; } function tryConsumeDefine() { var token = ts.scanner.getToken(); - if (token === 72 /* Identifier */ && ts.scanner.getTokenValue() === "define") { + if (token === 73 /* Identifier */ && ts.scanner.getTokenValue() === "define") { token = nextToken(); if (token !== 20 /* OpenParenToken */) { return true; @@ -106505,14 +107484,14 @@ var ts; return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (ts.isIdentifier(node) && node.originalKeywordKind === 80 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 81 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { return undefined; } if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node)) { 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 === 149 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 150 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -106568,9 +107547,9 @@ var ts; } function nodeIsEligibleForRename(node) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: case 10 /* StringLiteral */: - case 100 /* ThisKeyword */: + case 101 /* ThisKeyword */: return true; case 8 /* NumericLiteral */: return ts.isLiteralNameOfPropertyDeclarationOrIndexAccess(node); @@ -106582,6 +107561,275 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var SmartSelectionRange; + (function (SmartSelectionRange) { + function getSmartSelectionRange(pos, sourceFile) { + var selectionRange = { + textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) + }; + var parentNode = sourceFile; + outer: while (true) { + var children = getSelectionChildren(parentNode); + if (!children.length) + break; + for (var i = 0; i < children.length; i++) { + var prevNode = children[i - 1]; + var node = children[i]; + var nextNode = children[i + 1]; + if (node.getStart(sourceFile) > pos) { + break outer; + } + if (positionShouldSnapToNode(pos, node, nextNode)) { + // 1. Blocks are effectively redundant with SyntaxLists. + // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping + // 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) + || 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) { + parentNode = node; + break; + } + // Synthesize a stop for '${ ... }' since '${' and '}' actually belong to siblings. + if (ts.isTemplateSpan(parentNode) && nextNode && ts.isTemplateMiddleOrTemplateTail(nextNode)) { + var start_2 = node.getFullStart() - "${".length; + var end_2 = nextNode.getStart() + "}".length; + pushSelectionRange(start_2, end_2); + } + // 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) + && !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() : node.getEnd(); + if (ts.isNumber(jsDocCommentStart)) { + pushSelectionRange(jsDocCommentStart, end); + } + pushSelectionRange(start, end); + // String literals should have a stop both inside and outside their quotes. + if (ts.isStringLiteral(node) || ts.isTemplateLiteral(node)) { + pushSelectionRange(start + 1, end - 1); + } + parentNode = node; + break; + } + } + } + return selectionRange; + function pushSelectionRange(start, end) { + // Skip empty ranges + if (start !== end) { + // Skip ranges that are identical to the parent + var textSpan = ts.createTextSpanFromBounds(start, end); + if (!selectionRange || !ts.textSpansEqual(textSpan, selectionRange.textSpan)) { + selectionRange = __assign({ textSpan: textSpan }, selectionRange && { parent: selectionRange }); + } + } + } + } + SmartSelectionRange.getSmartSelectionRange = getSmartSelectionRange; + /** + * Like `ts.positionBelongsToNode`, except positions immediately after nodes + * count too, unless that position belongs to the next node. In effect, makes + * selections able to snap to preceding tokens when the cursor is on the tail + * end of them with only whitespace ahead. + * @param pos The position to check. + * @param node The candidate node to snap to. + * @param nextNode The next sibling node in the tree. + * @param sourceFile The source file containing the nodes. + */ + function positionShouldSnapToNode(pos, node, nextNode) { + // Can’t use 'ts.positionBelongsToNode()' here because it cleverly accounts + // for missing nodes, which can’t really be considered when deciding what + // to select. + ts.Debug.assert(node.pos <= pos); + if (pos < node.end) { + return true; + } + var nodeEnd = node.getEnd(); + var nextNodeStart = nextNode && nextNode.getStart(); + if (nodeEnd === pos) { + return pos !== nextNodeStart; + } + return false; + } + var isImport = ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration); + /** + * Gets the children of a node to be considered for selection ranging, + * transforming them into an artificial tree according to their intuitive + * grouping where no grouping actually exists in the parse tree. For example, + * top-level imports are grouped into their own SyntaxList so they can be + * selected all together, even though in the AST they’re just siblings of each + * other as well as of other top-level statements and declarations. + */ + function getSelectionChildren(node) { + // Group top-level imports + if (ts.isSourceFile(node)) { + return groupChildren(node.getChildAt(0).getChildren(), isImport); + } + // Mapped types _look_ like ObjectTypes with a single member, + // but in fact don’t contain a SyntaxList or a node containing + // the “key/value” pair like ObjectTypes do, but it seems intuitive + // that the selection would snap to those points. The philosophy + // of choosing a selection range is not so much about what the + // syntax currently _is_ as what the syntax might easily become + // if the user is making a selection; e.g., we synthesize a selection + // around the “key/value” pair not because there’s a node there, but + // because it allows the mapped type to become an object type with a + // few keystrokes. + if (ts.isMappedTypeNode(node)) { + var _a = node.getChildren(), openBraceToken = _a[0], children = _a.slice(1); + var closeBraceToken = ts.Debug.assertDefined(children.pop()); + ts.Debug.assertEqual(openBraceToken.kind, 18 /* OpenBraceToken */); + ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); + // Group `-/+readonly` and `-/+?` + var groupedWithPlusMinusTokens = groupChildren(children, function (child) { + return child === node.readonlyToken || child.kind === 134 /* ReadonlyKeyword */ || + child === node.questionToken || child.kind === 56 /* QuestionToken */; + }); + // Group type parameter with surrounding brackets + var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { + var kind = _a.kind; + return kind === 22 /* OpenBracketToken */ || + kind === 151 /* TypeParameter */ || + kind === 23 /* CloseBracketToken */; + }); + return [ + openBraceToken, + // Pivot on `:` + createSyntaxList(splitChildren(groupedWithBrackets, function (_a) { + var kind = _a.kind; + return kind === 57 /* ColonToken */; + })), + closeBraceToken, + ]; + } + // Group modifiers and property name, then pivot on `:`. + if (ts.isPropertySignature(node)) { + var children = groupChildren(node.getChildren(), function (child) { + return child === node.name || ts.contains(node.modifiers, child); + }); + return splitChildren(children, function (_a) { + var kind = _a.kind; + return kind === 57 /* ColonToken */; + }); + } + // Group the parameter name with its `...`, then that group with its `?`, then pivot on `=`. + if (ts.isParameter(node)) { + var groupedDotDotDotAndName_1 = groupChildren(node.getChildren(), function (child) { + return child === node.dotDotDotToken || child === node.name; + }); + var groupedWithQuestionToken = groupChildren(groupedDotDotDotAndName_1, function (child) { + return child === groupedDotDotDotAndName_1[0] || child === node.questionToken; + }); + return splitChildren(groupedWithQuestionToken, function (_a) { + var kind = _a.kind; + return kind === 60 /* EqualsToken */; + }); + } + // Pivot on '=' + if (ts.isBindingElement(node)) { + return splitChildren(node.getChildren(), function (_a) { + var kind = _a.kind; + return kind === 60 /* EqualsToken */; + }); + } + return node.getChildren(); + } + /** + * Groups sibling nodes together into their own SyntaxList if they + * a) are adjacent, AND b) match a predicate function. + */ + function groupChildren(children, groupOn) { + var result = []; + var group; + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + if (groupOn(child)) { + group = group || []; + group.push(child); + } + else { + if (group) { + result.push(createSyntaxList(group)); + group = undefined; + } + result.push(child); + } + } + if (group) { + result.push(createSyntaxList(group)); + } + return result; + } + /** + * Splits sibling nodes into up to four partitions: + * 1) everything left of the first node matched by `pivotOn`, + * 2) the first node matched by `pivotOn`, + * 3) everything right of the first node matched by `pivotOn`, + * 4) a trailing semicolon, if `separateTrailingSemicolon` is enabled. + * The left and right groups, if not empty, will each be grouped into their own containing SyntaxList. + * @param children The sibling nodes to split. + * @param pivotOn The predicate function to match the node to be the pivot. The first node that matches + * the predicate will be used; any others that may match will be included into the right-hand group. + * @param separateTrailingSemicolon If the last token is a semicolon, it will be returned as a separate + * child rather than be included in the right-hand group. + */ + function splitChildren(children, pivotOn, separateTrailingSemicolon) { + if (separateTrailingSemicolon === void 0) { separateTrailingSemicolon = true; } + if (children.length < 2) { + return children; + } + var splitTokenIndex = ts.findIndex(children, pivotOn); + if (splitTokenIndex === -1) { + return children; + } + var leftChildren = children.slice(0, splitTokenIndex); + var splitToken = children[splitTokenIndex]; + var lastToken = ts.last(children); + var separateLastToken = separateTrailingSemicolon && lastToken.kind === 26 /* SemicolonToken */; + var rightChildren = children.slice(splitTokenIndex + 1, separateLastToken ? children.length - 1 : undefined); + var result = ts.compact([ + leftChildren.length ? createSyntaxList(leftChildren) : undefined, + splitToken, + rightChildren.length ? createSyntaxList(rightChildren) : undefined, + ]); + return separateLastToken ? result.concat(lastToken) : result; + } + function createSyntaxList(children) { + ts.Debug.assertGreaterThanOrEqual(children.length, 1); + var syntaxList = ts.createNode(312 /* SyntaxList */, children[0].pos, ts.last(children).end); + syntaxList._children = children; + return syntaxList; + } + function isListOpener(token) { + var kind = token && token.kind; + return kind === 18 /* OpenBraceToken */ + || kind === 22 /* OpenBracketToken */ + || kind === 20 /* OpenParenToken */ + || kind === 263 /* JsxOpeningElement */; + } + function isListCloser(token) { + var kind = token && token.kind; + return kind === 19 /* CloseBraceToken */ + || kind === 23 /* CloseBracketToken */ + || kind === 21 /* CloseParenToken */ + || kind === 264 /* JsxClosingElement */; + } + })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var SignatureHelp; (function (SignatureHelp) { @@ -106693,8 +107941,21 @@ var ts; }); } function containsPrecedingToken(startingToken, sourceFile, container) { - var precedingToken = ts.Debug.assertDefined(ts.findPrecedingToken(startingToken.getFullStart(), sourceFile, startingToken.parent, /*excludeJsdoc*/ true)); - return ts.rangeContainsRange(container, precedingToken); + var pos = startingToken.getFullStart(); + // There’s a possibility that `startingToken.parent` contains only `startingToken` and + // missing nodes, none of which are valid to be returned by `findPrecedingToken`. In that + // case, the preceding token we want is actually higher up the tree—almost definitely the + // next parent, but theoretically the situation with missing nodes might be happening on + // multiple nested levels. + var currentParent = startingToken.parent; + while (currentParent) { + var precedingToken = ts.findPrecedingToken(pos, sourceFile, currentParent, /*excludeJsdoc*/ true); + if (precedingToken) { + return ts.rangeContainsRange(container, precedingToken); + } + currentParent = currentParent.parent; + } + return ts.Debug.fail("Could not find preceding token"); } function getArgumentInfoForCompletions(node, position, sourceFile) { var info = getImmediatelyContainingArgumentInfo(node, position, sourceFile); @@ -106768,10 +108029,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 193 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 194 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 206 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 207 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -106838,17 +108099,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 195 /* ParenthesizedExpression */: - case 156 /* MethodDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 196 /* ParenthesizedExpression */: + case 157 /* MethodDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* 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 204 /* BinaryExpression */: { + case 205 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -106972,7 +108233,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 === 206 /* TemplateExpression */) { + if (template.kind === 207 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -106984,7 +108245,7 @@ var ts; var _loop_7 = function (n) { // If the node is not a subspan of its parent, this is a big problem. // There have been crashes that might be caused by this violation. - ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.showSyntaxKind(n) + ", parent: " + ts.Debug.showSyntaxKind(n.parent); }); + ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); }); var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker); if (argumentInfo) { return { value: argumentInfo }; @@ -107284,7 +108545,7 @@ var ts; function check(node) { if (isJsFile) { switch (node.kind) { - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: var decl = ts.getDeclarationOfExpando(node); if (decl) { var symbol_1 = decl.symbol; @@ -107294,7 +108555,7 @@ var ts; } } // falls through if no diagnostic was created - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: var symbol = node.symbol; if (symbol.members && (symbol.members.size > 0)) { diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); @@ -107327,11 +108588,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 221 /* ExpressionStatement */: { + case 222 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -107348,12 +108609,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 251 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 252 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -107411,13 +108672,13 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); /* falls through */ - case 96 /* NullKeyword */: - case 72 /* Identifier */: // identifier includes undefined + case 97 /* NullKeyword */: + case 73 /* Identifier */: // identifier includes undefined return true; default: return false; @@ -107440,7 +108701,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 209 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 210 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -107477,7 +108738,7 @@ var ts; if (typeChecker.isArgumentsSymbol(symbol)) { return "local var" /* localVariableElement */; } - if (location.kind === 100 /* ThisKeyword */ && ts.isExpression(location)) { + if (location.kind === 101 /* ThisKeyword */ && ts.isExpression(location)) { return "parameter" /* parameterElement */; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); @@ -107528,11 +108789,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 262 /* JsxOpeningElement */: - case 260 /* JsxElement */: - case 261 /* JsxSelfClosingElement */: - return location.kind === 72 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 267 /* JsxAttribute */: + case 263 /* JsxOpeningElement */: + case 261 /* JsxElement */: + case 262 /* JsxSelfClosingElement */: + return location.kind === 73 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; + case 268 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -107559,13 +108820,13 @@ var ts; var symbolFlags = ts.getCombinedLocalAndExportSymbolFlags(symbol); var symbolKind = semanticMeaning & 1 /* Value */ ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location) : "" /* unknown */; var hasAddedSymbolInfo = false; - var isThisExpression = location.kind === 100 /* ThisKeyword */ && ts.isInExpressionContext(location); + var isThisExpression = location.kind === 101 /* ThisKeyword */ && ts.isInExpressionContext(location); var type; var printer; var documentationFromAlias; var tagsFromAlias; - if (location.kind === 100 /* ThisKeyword */ && !isThisExpression) { - return { displayParts: [ts.keywordPart(100 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: undefined }; + if (location.kind === 101 /* ThisKeyword */ && !isThisExpression) { + return { displayParts: [ts.keywordPart(101 /* ThisKeyword */)], documentation: [], symbolKind: "primitive type" /* primitiveType */, tags: undefined }; } // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { @@ -107575,7 +108836,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 189 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 190 /* 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)) { @@ -107594,9 +108855,8 @@ var ts; callExpressionLike = location.parent; } if (callExpressionLike) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 192 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 98 /* SuperKeyword */); + signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 + var useConstructSignatures = callExpressionLike.kind === 193 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 99 /* 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 @@ -107614,7 +108874,7 @@ var ts; pushSymbolKind(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(95 /* NewKeyword */)); + displayParts.push(ts.keywordPart(96 /* NewKeyword */)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -107638,7 +108898,7 @@ var ts; displayParts.push(ts.lineBreakPart()); } if (useConstructSignatures) { - displayParts.push(ts.keywordPart(95 /* NewKeyword */)); + displayParts.push(ts.keywordPart(96 /* NewKeyword */)); displayParts.push(ts.spacePart()); } addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */); @@ -107651,29 +108911,29 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 124 /* ConstructorKeyword */ && location.parent.kind === 157 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 125 /* ConstructorKeyword */ && location.parent.kind === 158 /* 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 var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { - return declaration === (location.kind === 124 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); + return declaration === (location.kind === 125 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 157 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 158 /* 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 === 157 /* Constructor */) { + if (functionDeclaration_1.kind === 158 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 160 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 161 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -107683,7 +108943,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 209 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 210 /* 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 <className> @@ -107691,7 +108951,7 @@ var ts; } else { // Class declaration has name which is not local. - displayParts.push(ts.keywordPart(76 /* ClassKeyword */)); + displayParts.push(ts.keywordPart(77 /* ClassKeyword */)); } displayParts.push(ts.spacePart()); addFullSymbolName(symbol); @@ -107699,37 +108959,37 @@ var ts; } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(110 /* InterfaceKeyword */)); + displayParts.push(ts.keywordPart(111 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(140 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(141 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(59 /* EqualsToken */)); + displayParts.push(ts.operatorPart(60 /* EqualsToken */)); displayParts.push(ts.spacePart()); ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); } if (symbolFlags & 384 /* Enum */) { prefixNextMeaning(); if (ts.some(symbol.declarations, function (d) { return ts.isEnumDeclaration(d) && ts.isEnumConst(d); })) { - displayParts.push(ts.keywordPart(77 /* ConstKeyword */)); + displayParts.push(ts.keywordPart(78 /* ConstKeyword */)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(84 /* EnumKeyword */)); + displayParts.push(ts.keywordPart(85 /* EnumKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 244 /* ModuleDeclaration */); - var isNamespace = declaration && declaration.name && declaration.name.kind === 72 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 131 /* NamespaceKeyword */ : 130 /* ModuleKeyword */)); + var declaration = ts.getDeclarationOfKind(symbol, 245 /* ModuleDeclaration */); + var isNamespace = declaration && declaration.name && declaration.name.kind === 73 /* Identifier */; + displayParts.push(ts.keywordPart(isNamespace ? 132 /* NamespaceKeyword */ : 131 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -107748,7 +109008,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 150 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 151 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -107756,21 +109016,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 161 /* ConstructSignature */) { - displayParts.push(ts.keywordPart(95 /* NewKeyword */)); + if (declaration.kind === 162 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(96 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 160 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 161 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 242 /* TypeAliasDeclaration */) { + else if (declaration.kind === 243 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list<T> = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(140 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(141 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -107782,11 +109042,11 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 278 /* EnumMember */) { + if (declaration.kind === 279 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(59 /* EqualsToken */)); + displayParts.push(ts.operatorPart(60 /* EqualsToken */)); displayParts.push(ts.spacePart()); displayParts.push(ts.displayPart(ts.getTextOfConstantValue(constantValue), typeof constantValue === "number" ? ts.SymbolDisplayPartKind.numericLiteral : ts.SymbolDisplayPartKind.stringLiteral)); } @@ -107812,32 +109072,32 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 247 /* NamespaceExportDeclaration */: - displayParts.push(ts.keywordPart(85 /* ExportKeyword */)); + case 248 /* NamespaceExportDeclaration */: + displayParts.push(ts.keywordPart(86 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(131 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(132 /* NamespaceKeyword */)); break; - case 254 /* ExportAssignment */: - displayParts.push(ts.keywordPart(85 /* ExportKeyword */)); + case 255 /* ExportAssignment */: + displayParts.push(ts.keywordPart(86 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 59 /* EqualsToken */ : 80 /* DefaultKeyword */)); + displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 60 /* EqualsToken */ : 81 /* DefaultKeyword */)); break; - case 257 /* ExportSpecifier */: - displayParts.push(ts.keywordPart(85 /* ExportKeyword */)); + case 258 /* ExportSpecifier */: + displayParts.push(ts.keywordPart(86 /* ExportKeyword */)); break; default: - displayParts.push(ts.keywordPart(92 /* ImportKeyword */)); + displayParts.push(ts.keywordPart(93 /* ImportKeyword */)); } displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 248 /* ImportEqualsDeclaration */) { + if (declaration.kind === 249 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(59 /* EqualsToken */)); + displayParts.push(ts.operatorPart(60 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(134 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(135 /* 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 */)); @@ -107846,7 +109106,7 @@ var ts; var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(59 /* EqualsToken */)); + displayParts.push(ts.operatorPart(60 /* EqualsToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -107860,7 +109120,7 @@ var ts; if (type) { if (isThisExpression) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(100 /* ThisKeyword */)); + displayParts.push(ts.keywordPart(101 /* ThisKeyword */)); } else { addPrefixForAnyFunctionOrVar(symbol, symbolKind); @@ -107909,10 +109169,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 === 284 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 285 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 204 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 205 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -107955,7 +109215,7 @@ var ts; } function addInPrefix() { displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(93 /* InKeyword */)); + displayParts.push(ts.keywordPart(94 /* InKeyword */)); displayParts.push(ts.spacePart()); } function addFullSymbolName(symbolToDisplay, enclosingDeclaration) { @@ -108025,16 +109285,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 196 /* FunctionExpression */) { + if (declaration.kind === 197 /* FunctionExpression */) { return true; } - if (declaration.kind !== 237 /* VariableDeclaration */ && declaration.kind !== 239 /* FunctionDeclaration */) { + if (declaration.kind !== 238 /* VariableDeclaration */ && declaration.kind !== 240 /* 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 === 284 /* SourceFile */ || parent.kind === 245 /* ModuleBlock */) { + if (parent.kind === 285 /* SourceFile */ || parent.kind === 246 /* ModuleBlock */) { return false; } } @@ -108263,8 +109523,8 @@ var ts; (function (ts) { var formatting; (function (formatting) { - var standardScanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ false, 0 /* Standard */); - var jsxScanner = ts.createScanner(7 /* Latest */, /*skipTrivia*/ false, 1 /* JSX */); + var standardScanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ false, 0 /* Standard */); + var jsxScanner = ts.createScanner(8 /* Latest */, /*skipTrivia*/ false, 1 /* JSX */); var ScanAction; (function (ScanAction) { ScanAction[ScanAction["Scan"] = 0] = "Scan"; @@ -108328,8 +109588,8 @@ var ts; function shouldRescanGreaterThanToken(node) { switch (node.kind) { case 32 /* GreaterThanEqualsToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: case 48 /* GreaterThanGreaterThanGreaterThanToken */: case 47 /* GreaterThanGreaterThanToken */: return true; @@ -108339,12 +109599,12 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 267 /* JsxAttribute */: - case 262 /* JsxOpeningElement */: - case 263 /* JsxClosingElement */: - case 261 /* JsxSelfClosingElement */: + case 268 /* JsxAttribute */: + case 263 /* JsxOpeningElement */: + case 264 /* JsxClosingElement */: + case 262 /* 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 === 72 /* Identifier */; + return ts.isKeyword(node.kind) || node.kind === 73 /* Identifier */; } } return false; @@ -108360,7 +109620,7 @@ var ts; container.kind === 17 /* TemplateTail */; } function startsWithSlashToken(t) { - return t === 42 /* SlashToken */ || t === 64 /* SlashEqualsToken */; + return t === 42 /* SlashToken */ || t === 65 /* SlashEqualsToken */; } function readTokenInfo(n) { ts.Debug.assert(isOnToken()); @@ -108519,7 +109779,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 147 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 148 /* LastToken */; token++) { allTokens.push(token); } function anyTokenExcept() { @@ -108531,27 +109791,27 @@ var ts; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(73 /* FirstKeyword */, 147 /* LastKeyword */); - var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 71 /* LastBinaryOperator */); - var binaryKeywordOperators = [93 /* InKeyword */, 94 /* InstanceOfKeyword */, 147 /* OfKeyword */, 119 /* AsKeyword */, 128 /* IsKeyword */]; + var keywords = tokenRangeFromRange(74 /* FirstKeyword */, 148 /* LastKeyword */); + var binaryOperators = tokenRangeFromRange(28 /* FirstBinaryOperator */, 72 /* LastBinaryOperator */); + var binaryKeywordOperators = [94 /* InKeyword */, 95 /* InstanceOfKeyword */, 148 /* OfKeyword */, 120 /* AsKeyword */, 129 /* IsKeyword */]; var unaryPrefixOperators = [44 /* PlusPlusToken */, 45 /* MinusMinusToken */, 53 /* TildeToken */, 52 /* ExclamationToken */]; var unaryPrefixExpressions = [ - 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 72 /* Identifier */, 20 /* OpenParenToken */, - 22 /* OpenBracketToken */, 18 /* OpenBraceToken */, 100 /* ThisKeyword */, 95 /* NewKeyword */ + 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 73 /* Identifier */, 20 /* OpenParenToken */, + 22 /* OpenBracketToken */, 18 /* OpenBraceToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */ ]; - var unaryPreincrementExpressions = [72 /* Identifier */, 20 /* OpenParenToken */, 100 /* ThisKeyword */, 95 /* NewKeyword */]; - var unaryPostincrementExpressions = [72 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 95 /* NewKeyword */]; - var unaryPredecrementExpressions = [72 /* Identifier */, 20 /* OpenParenToken */, 100 /* ThisKeyword */, 95 /* NewKeyword */]; - var unaryPostdecrementExpressions = [72 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 95 /* NewKeyword */]; + var unaryPreincrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */]; + var unaryPostincrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */]; + var unaryPredecrementExpressions = [73 /* Identifier */, 20 /* OpenParenToken */, 101 /* ThisKeyword */, 96 /* NewKeyword */]; + var unaryPostdecrementExpressions = [73 /* Identifier */, 21 /* CloseParenToken */, 23 /* CloseBracketToken */, 96 /* NewKeyword */]; var comments = [2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]; - var typeNames = [72 /* Identifier */].concat(ts.typeKeywords); + var typeNames = [73 /* Identifier */].concat(ts.typeKeywords); // Place a space before open brace in a function declaration // TypeScript: Function can have return types, which can be made of tons of different token kinds var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments; // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) - var typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([72 /* Identifier */, 3 /* MultiLineCommentTrivia */, 76 /* ClassKeyword */, 85 /* ExportKeyword */, 92 /* ImportKeyword */]); + var typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([73 /* Identifier */, 3 /* MultiLineCommentTrivia */, 77 /* ClassKeyword */, 86 /* ExportKeyword */, 93 /* ImportKeyword */]); // Place a space before open brace in a control flow construct - var controlOpenBraceLeftTokenRange = tokenRangeFrom([21 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 82 /* DoKeyword */, 103 /* TryKeyword */, 88 /* FinallyKeyword */, 83 /* ElseKeyword */]); + var controlOpenBraceLeftTokenRange = tokenRangeFrom([21 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 83 /* DoKeyword */, 104 /* TryKeyword */, 89 /* FinallyKeyword */, 84 /* ElseKeyword */]); // These rules are higher in priority than user-configurable var highPriorityCommonRules = [ // Leave comments alone @@ -108566,7 +109826,7 @@ var ts; rule("NoSpaceAfterQuestionMark", 56 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceBeforeDot", anyToken, 24 /* DotToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterDot", 24 /* DotToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("NoSpaceBetweenImportParenInImportType", 92 /* ImportKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 8 /* Delete */), + rule("NoSpaceBetweenImportParenInImportType", 93 /* ImportKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 8 /* Delete */), // Special handling of unary operators. // Prefix operators generally shouldn't have a space between // them and their target unary expression. @@ -108593,79 +109853,79 @@ var ts; rule("SpaceAfterCloseBrace", 19 /* CloseBraceToken */, anyTokenExcept(21 /* CloseParenToken */), [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], 2 /* Space */), // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied // Also should not apply to }) - rule("SpaceBetweenCloseBraceAndElse", 19 /* CloseBraceToken */, 83 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBetweenCloseBraceAndWhile", 19 /* CloseBraceToken */, 107 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBetweenCloseBraceAndElse", 19 /* CloseBraceToken */, 84 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBetweenCloseBraceAndWhile", 19 /* CloseBraceToken */, 108 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' rule("SpaceAfterConditionalClosingParen", 21 /* CloseParenToken */, 22 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), - rule("NoSpaceBetweenFunctionKeywordAndStar", 90 /* FunctionKeyword */, 40 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), - rule("SpaceAfterStarInGeneratorDeclaration", 40 /* AsteriskToken */, [72 /* Identifier */, 20 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), - rule("SpaceAfterFunctionInFuncDecl", 90 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), + rule("NoSpaceBetweenFunctionKeywordAndStar", 91 /* FunctionKeyword */, 40 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), + rule("SpaceAfterStarInGeneratorDeclaration", 40 /* AsteriskToken */, 73 /* Identifier */, [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), + rule("SpaceAfterFunctionInFuncDecl", 91 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), // Insert new line after { and before } in multi-line contexts. rule("NewLineAfterOpenBraceInBlockContext", 18 /* OpenBraceToken */, anyToken, [isMultilineBlockContext], 4 /* NewLine */), // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token. // 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", [126 /* GetKeyword */, 137 /* SetKeyword */], 72 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), - rule("NoSpaceBetweenYieldKeywordAndStar", 117 /* YieldKeyword */, 40 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), - rule("SpaceBetweenYieldOrYieldStarAndOperand", [117 /* YieldKeyword */, 40 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), - rule("NoSpaceBetweenReturnAndSemicolon", 97 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("SpaceAfterCertainKeywords", [105 /* VarKeyword */, 101 /* ThrowKeyword */, 95 /* NewKeyword */, 81 /* DeleteKeyword */, 97 /* ReturnKeyword */, 104 /* TypeOfKeyword */, 122 /* AwaitKeyword */], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceAfterLetConstInVariableDeclaration", [111 /* LetKeyword */, 77 /* ConstKeyword */], anyToken, [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [127 /* GetKeyword */, 138 /* SetKeyword */], 73 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("NoSpaceBetweenYieldKeywordAndStar", 118 /* YieldKeyword */, 40 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), + rule("SpaceBetweenYieldOrYieldStarAndOperand", [118 /* YieldKeyword */, 40 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), + rule("NoSpaceBetweenReturnAndSemicolon", 98 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("SpaceAfterCertainKeywords", [106 /* VarKeyword */, 102 /* ThrowKeyword */, 96 /* NewKeyword */, 82 /* DeleteKeyword */, 98 /* ReturnKeyword */, 105 /* TypeOfKeyword */, 123 /* AwaitKeyword */], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceAfterLetConstInVariableDeclaration", [112 /* LetKeyword */, 78 /* ConstKeyword */], anyToken, [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], 2 /* Space */), rule("NoSpaceBeforeOpenParenInFuncCall", anyToken, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isFunctionCallOrNewContext, isPreviousTokenNotComma], 8 /* Delete */), // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. rule("SpaceBeforeBinaryKeywordOperator", anyToken, binaryKeywordOperators, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterBinaryKeywordOperator", binaryKeywordOperators, anyToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), - rule("SpaceAfterVoidOperator", 106 /* VoidKeyword */, anyToken, [isNonJsxSameLineTokenContext, isVoidOpContext], 2 /* Space */), + rule("SpaceAfterVoidOperator", 107 /* VoidKeyword */, anyToken, [isNonJsxSameLineTokenContext, isVoidOpContext], 2 /* Space */), // Async-await - rule("SpaceBetweenAsyncAndOpenParen", 121 /* AsyncKeyword */, 20 /* OpenParenToken */, [isArrowFunctionContext, isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBetweenAsyncAndFunctionKeyword", 121 /* AsyncKeyword */, 90 /* FunctionKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBetweenAsyncAndOpenParen", 122 /* AsyncKeyword */, 20 /* OpenParenToken */, [isArrowFunctionContext, isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBetweenAsyncAndFunctionKeyword", 122 /* AsyncKeyword */, 91 /* FunctionKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Template string - rule("NoSpaceBetweenTagAndTemplateString", [72 /* Identifier */, 21 /* CloseParenToken */], [14 /* NoSubstitutionTemplateLiteral */, 15 /* TemplateHead */], [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceBetweenTagAndTemplateString", [73 /* Identifier */, 21 /* CloseParenToken */], [14 /* NoSubstitutionTemplateLiteral */, 15 /* TemplateHead */], [isNonJsxSameLineTokenContext], 8 /* Delete */), // JSX opening elements - rule("SpaceBeforeJsxAttribute", anyToken, 72 /* Identifier */, [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeJsxAttribute", anyToken, 73 /* Identifier */, [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBeforeSlashInJsxOpeningElement", anyToken, 42 /* SlashToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement", 42 /* SlashToken */, 30 /* GreaterThanToken */, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("NoSpaceBeforeEqualInJsxAttribute", anyToken, 59 /* EqualsToken */, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("NoSpaceAfterEqualInJsxAttribute", 59 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceBeforeEqualInJsxAttribute", anyToken, 60 /* EqualsToken */, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterEqualInJsxAttribute", 60 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [130 /* ModuleKeyword */, 134 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [131 /* ModuleKeyword */, 135 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ - 118 /* AbstractKeyword */, - 76 /* ClassKeyword */, - 125 /* DeclareKeyword */, - 80 /* DefaultKeyword */, - 84 /* EnumKeyword */, - 85 /* ExportKeyword */, - 86 /* ExtendsKeyword */, - 126 /* GetKeyword */, - 109 /* ImplementsKeyword */, - 92 /* ImportKeyword */, - 110 /* InterfaceKeyword */, - 130 /* ModuleKeyword */, - 131 /* NamespaceKeyword */, - 113 /* PrivateKeyword */, - 115 /* PublicKeyword */, - 114 /* ProtectedKeyword */, - 133 /* ReadonlyKeyword */, - 137 /* SetKeyword */, - 116 /* StaticKeyword */, - 140 /* TypeKeyword */, - 144 /* FromKeyword */, - 129 /* KeyOfKeyword */, - 127 /* InferKeyword */, + 119 /* AbstractKeyword */, + 77 /* ClassKeyword */, + 126 /* DeclareKeyword */, + 81 /* DefaultKeyword */, + 85 /* EnumKeyword */, + 86 /* ExportKeyword */, + 87 /* ExtendsKeyword */, + 127 /* GetKeyword */, + 110 /* ImplementsKeyword */, + 93 /* ImportKeyword */, + 111 /* InterfaceKeyword */, + 131 /* ModuleKeyword */, + 132 /* NamespaceKeyword */, + 114 /* PrivateKeyword */, + 116 /* PublicKeyword */, + 115 /* ProtectedKeyword */, + 134 /* ReadonlyKeyword */, + 138 /* SetKeyword */, + 117 /* StaticKeyword */, + 141 /* TypeKeyword */, + 145 /* FromKeyword */, + 130 /* KeyOfKeyword */, + 128 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [86 /* ExtendsKeyword */, 109 /* ImplementsKeyword */, 144 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [87 /* ExtendsKeyword */, 110 /* ImplementsKeyword */, 145 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // 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], 2 /* Space */), // Lambda expressions rule("SpaceBeforeArrow", anyToken, 37 /* EqualsGreaterThanToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceAfterArrow", 37 /* EqualsGreaterThanToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), // Optional parameters and let args - rule("NoSpaceAfterEllipsis", 25 /* DotDotDotToken */, 72 /* Identifier */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterEllipsis", 25 /* DotDotDotToken */, 73 /* Identifier */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterOptionalParameters", 56 /* QuestionToken */, [21 /* CloseParenToken */, 27 /* CommaToken */], [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), // Remove spaces in empty interface literals. e.g.: x: {} rule("NoSpaceBetweenEmptyInterfaceBraceBrackets", 18 /* OpenBraceToken */, 19 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectTypeContext], 8 /* Delete */), @@ -108676,37 +109936,37 @@ var ts; rule("NoSpaceBeforeCloseAngularBracket", anyToken, 30 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), rule("NoSpaceAfterCloseAngularBracket", 30 /* GreaterThanToken */, [20 /* OpenParenToken */, 22 /* OpenBracketToken */, 30 /* GreaterThanToken */, 27 /* CommaToken */], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext, isNotFunctionDeclContext /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/], 8 /* Delete */), // decorators - rule("SpaceBeforeAt", [21 /* CloseParenToken */, 72 /* Identifier */], 58 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeAt", [21 /* CloseParenToken */, 73 /* Identifier */], 58 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterAt", 58 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Insert space after @ in decorator rule("SpaceAfterDecorator", anyToken, [ - 118 /* AbstractKeyword */, - 72 /* Identifier */, - 85 /* ExportKeyword */, - 80 /* DefaultKeyword */, - 76 /* ClassKeyword */, - 116 /* StaticKeyword */, - 115 /* PublicKeyword */, - 113 /* PrivateKeyword */, - 114 /* ProtectedKeyword */, - 126 /* GetKeyword */, - 137 /* SetKeyword */, + 119 /* AbstractKeyword */, + 73 /* Identifier */, + 86 /* ExportKeyword */, + 81 /* DefaultKeyword */, + 77 /* ClassKeyword */, + 117 /* StaticKeyword */, + 116 /* PublicKeyword */, + 114 /* PrivateKeyword */, + 115 /* ProtectedKeyword */, + 127 /* GetKeyword */, + 138 /* SetKeyword */, 22 /* OpenBracketToken */, 40 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), rule("NoSpaceBeforeNonNullAssertionOperator", anyToken, 52 /* ExclamationToken */, [isNonJsxSameLineTokenContext, isNonNullAssertionContext], 8 /* Delete */), - rule("NoSpaceAfterNewKeywordOnConstructorSignature", 95 /* NewKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isConstructorSignatureContext], 8 /* Delete */), + rule("NoSpaceAfterNewKeywordOnConstructorSignature", 96 /* NewKeyword */, 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isConstructorSignatureContext], 8 /* Delete */), ]; // These rules are applied after high priority var userConfigurableRules = [ // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - rule("SpaceAfterConstructor", 124 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2 /* Space */), - rule("NoSpaceAfterConstructor", 124 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("SpaceAfterConstructor", 125 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2 /* Space */), + rule("NoSpaceAfterConstructor", 125 /* ConstructorKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8 /* Delete */), rule("SpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket], 2 /* Space */), rule("NoSpaceAfterComma", 27 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 8 /* Delete */), // Insert space after function keyword for anonymous functions - rule("SpaceAfterAnonymousFunctionKeyword", 90 /* FunctionKeyword */, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2 /* Space */), - rule("NoSpaceAfterAnonymousFunctionKeyword", 90 /* FunctionKeyword */, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8 /* Delete */), + rule("SpaceAfterAnonymousFunctionKeyword", [91 /* FunctionKeyword */, 40 /* AsteriskToken */], 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2 /* Space */), + rule("NoSpaceAfterAnonymousFunctionKeyword", [91 /* FunctionKeyword */, 40 /* AsteriskToken */], 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8 /* Delete */), // Insert space after keywords in control flow statements rule("SpaceAfterKeywordInControl", keywords, 20 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], 2 /* Space */), rule("NoSpaceAfterKeywordInControl", keywords, 20 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], 8 /* Delete */), @@ -108770,16 +110030,16 @@ var ts; rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 18 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("NoSpaceBeforeComma", anyToken, 27 /* CommaToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // No space before and after indexer `x[]` - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(121 /* AsyncKeyword */, 74 /* CaseKeyword */), 22 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceBeforeOpenBracket", anyTokenExcept(122 /* AsyncKeyword */, 75 /* CaseKeyword */), 22 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 23 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 26 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), // Remove extra space between for and await - rule("SpaceBetweenForAndAwaitKeyword", 89 /* ForKeyword */, 122 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBetweenForAndAwaitKeyword", 90 /* ForKeyword */, 123 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - rule("SpaceBetweenStatements", [21 /* CloseParenToken */, 82 /* DoKeyword */, 83 /* ElseKeyword */, 74 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), + rule("SpaceBetweenStatements", [21 /* CloseParenToken */, 83 /* DoKeyword */, 84 /* ElseKeyword */, 75 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. - rule("SpaceAfterTryFinally", [103 /* TryKeyword */, 88 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceAfterTryFinally", [104 /* TryKeyword */, 89 /* FinallyKeyword */], 18 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), ]; return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules); } @@ -108823,45 +110083,45 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 225 /* ForStatement */; + return context.contextNode.kind === 226 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 204 /* BinaryExpression */: - case 205 /* ConditionalExpression */: - case 175 /* ConditionalType */: - case 212 /* AsExpression */: - case 257 /* ExportSpecifier */: - case 253 /* ImportSpecifier */: - case 163 /* TypePredicate */: - case 173 /* UnionType */: - case 174 /* IntersectionType */: + case 205 /* BinaryExpression */: + case 206 /* ConditionalExpression */: + case 176 /* ConditionalType */: + case 213 /* AsExpression */: + case 258 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 164 /* TypePredicate */: + case 174 /* UnionType */: + case 175 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 186 /* BindingElement */: + case 187 /* BindingElement */: // equals in type X = ... - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: // equal in p = 0; - case 151 /* Parameter */: - case 278 /* EnumMember */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - return context.currentTokenSpan.kind === 59 /* EqualsToken */ || context.nextTokenSpan.kind === 59 /* EqualsToken */; + case 152 /* Parameter */: + case 279 /* EnumMember */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + return context.currentTokenSpan.kind === 60 /* EqualsToken */ || context.nextTokenSpan.kind === 60 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 150 /* TypeParameter */: - return context.currentTokenSpan.kind === 93 /* InKeyword */ || context.nextTokenSpan.kind === 93 /* InKeyword */ || context.currentTokenSpan.kind === 59 /* EqualsToken */ || context.nextTokenSpan.kind === 59 /* EqualsToken */; + case 151 /* TypeParameter */: + return context.currentTokenSpan.kind === 94 /* InKeyword */ || context.nextTokenSpan.kind === 94 /* InKeyword */ || context.currentTokenSpan.kind === 60 /* EqualsToken */ || context.nextTokenSpan.kind === 60 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 227 /* ForOfStatement */: - return context.currentTokenSpan.kind === 147 /* OfKeyword */ || context.nextTokenSpan.kind === 147 /* OfKeyword */; + case 228 /* ForOfStatement */: + return context.currentTokenSpan.kind === 148 /* OfKeyword */ || context.nextTokenSpan.kind === 148 /* OfKeyword */; } return false; } @@ -108873,22 +110133,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 154 /* PropertyDeclaration */ || - contextKind === 153 /* PropertySignature */ || - contextKind === 151 /* Parameter */ || - contextKind === 237 /* VariableDeclaration */ || + return contextKind === 155 /* PropertyDeclaration */ || + contextKind === 154 /* PropertySignature */ || + contextKind === 152 /* Parameter */ || + contextKind === 238 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 205 /* ConditionalExpression */ || - context.contextNode.kind === 175 /* ConditionalType */; + return context.contextNode.kind === 206 /* ConditionalExpression */ || + context.contextNode.kind === 176 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 184 /* ObjectBindingPattern */ || - context.contextNode.kind === 181 /* MappedType */ || + return context.contextNode.kind === 185 /* ObjectBindingPattern */ || + context.contextNode.kind === 182 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -108914,31 +110174,31 @@ var ts; return true; } switch (node.kind) { - case 218 /* Block */: - case 246 /* CaseBlock */: - case 188 /* ObjectLiteralExpression */: - case 245 /* ModuleBlock */: + case 219 /* Block */: + case 247 /* CaseBlock */: + case 189 /* ObjectLiteralExpression */: + case 246 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 160 /* CallSignature */: - case 196 /* FunctionExpression */: - case 157 /* Constructor */: - case 197 /* ArrowFunction */: + case 161 /* CallSignature */: + case 197 /* FunctionExpression */: + case 158 /* Constructor */: + case 198 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 241 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 242 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -108947,40 +110207,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 239 /* FunctionDeclaration */ || context.contextNode.kind === 196 /* FunctionExpression */; + return context.contextNode.kind === 240 /* FunctionDeclaration */ || context.contextNode.kind === 197 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 168 /* TypeLiteral */: - case 244 /* ModuleDeclaration */: - case 255 /* ExportDeclaration */: - case 256 /* NamedExports */: - case 249 /* ImportDeclaration */: - case 252 /* NamedImports */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 169 /* TypeLiteral */: + case 245 /* ModuleDeclaration */: + case 256 /* ExportDeclaration */: + case 257 /* NamedExports */: + case 250 /* ImportDeclaration */: + case 253 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 240 /* ClassDeclaration */: - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: - case 274 /* CatchClause */: - case 245 /* ModuleBlock */: - case 232 /* SwitchStatement */: + case 241 /* ClassDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 275 /* CatchClause */: + case 246 /* ModuleBlock */: + case 233 /* SwitchStatement */: return true; - case 218 /* Block */: { + case 219 /* 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 !== 197 /* ArrowFunction */ && blockParent.kind !== 196 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 198 /* ArrowFunction */ && blockParent.kind !== 197 /* FunctionExpression */) { return true; } } @@ -108989,31 +110249,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 222 /* IfStatement */: - case 232 /* SwitchStatement */: - case 225 /* ForStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 224 /* WhileStatement */: - case 235 /* TryStatement */: - case 223 /* DoStatement */: - case 231 /* WithStatement */: + case 223 /* IfStatement */: + case 233 /* SwitchStatement */: + case 226 /* ForStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 225 /* WhileStatement */: + case 236 /* TryStatement */: + case 224 /* DoStatement */: + case 232 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 274 /* CatchClause */: + case 275 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 188 /* ObjectLiteralExpression */; + return context.contextNode.kind === 189 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 191 /* CallExpression */; + return context.contextNode.kind === 192 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 192 /* NewExpression */; + return context.contextNode.kind === 193 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -109025,28 +110285,28 @@ var ts; return context.nextTokenSpan.kind !== 23 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 197 /* ArrowFunction */; + return context.contextNode.kind === 198 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 183 /* ImportType */; + return context.contextNode.kind === 184 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 260 /* JsxElement */ && context.contextNode.kind !== 264 /* JsxFragment */; + return context.contextNode.kind !== 261 /* JsxElement */ && context.contextNode.kind !== 265 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 270 /* JsxExpression */ || context.contextNode.kind === 269 /* JsxSpreadAttribute */; + return context.contextNode.kind === 271 /* JsxExpression */ || context.contextNode.kind === 270 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 267 /* JsxAttribute */; + return context.nextTokenParent.kind === 268 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 267 /* JsxAttribute */; + return context.contextNode.kind === 268 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 261 /* JsxSelfClosingElement */; + return context.contextNode.kind === 262 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -109061,45 +110321,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 152 /* Decorator */; + return node.kind === 153 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 238 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 239 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 244 /* ModuleDeclaration */; + return context.contextNode.kind === 245 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 168 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 169 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 161 /* ConstructSignature */; + return context.contextNode.kind === 162 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 28 /* LessThanToken */ && token.kind !== 30 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 164 /* TypeReference */: - case 194 /* TypeAssertionExpression */: - case 242 /* TypeAliasDeclaration */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 211 /* ExpressionWithTypeArguments */: + case 165 /* TypeReference */: + case 195 /* TypeAssertionExpression */: + case 243 /* TypeAliasDeclaration */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 212 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -109110,16 +110370,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 194 /* TypeAssertionExpression */; + return context.contextNode.kind === 195 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 106 /* VoidKeyword */ && context.currentTokenParent.kind === 200 /* VoidExpression */; + return context.currentTokenSpan.kind === 107 /* VoidKeyword */ && context.currentTokenParent.kind === 201 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 207 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 208 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 213 /* NonNullExpression */; + return context.contextNode.kind === 214 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -109170,12 +110430,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 147 /* LastKeyword */ && column <= 147 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 148 /* LastKeyword */ && column <= 148 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 147 /* LastToken */ + 1; + var mapRowLength = 148 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -109353,17 +110613,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 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 245 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 284 /* SourceFile */: - case 218 /* Block */: - case 245 /* ModuleBlock */: + return !!body && body.kind === 246 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 285 /* SourceFile */: + case 219 /* Block */: + case 246 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -109585,19 +110845,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 240 /* ClassDeclaration */: return 76 /* ClassKeyword */; - case 241 /* InterfaceDeclaration */: return 110 /* InterfaceKeyword */; - case 239 /* FunctionDeclaration */: return 90 /* FunctionKeyword */; - case 243 /* EnumDeclaration */: return 243 /* EnumDeclaration */; - case 158 /* GetAccessor */: return 126 /* GetKeyword */; - case 159 /* SetAccessor */: return 137 /* SetKeyword */; - case 156 /* MethodDeclaration */: + case 241 /* ClassDeclaration */: return 77 /* ClassKeyword */; + case 242 /* InterfaceDeclaration */: return 111 /* InterfaceKeyword */; + case 240 /* FunctionDeclaration */: return 91 /* FunctionKeyword */; + case 244 /* EnumDeclaration */: return 244 /* EnumDeclaration */; + case 159 /* GetAccessor */: return 127 /* GetKeyword */; + case 160 /* SetAccessor */: return 138 /* SetKeyword */; + case 157 /* MethodDeclaration */: if (node.asteriskToken) { return 40 /* AsteriskToken */; } // falls through - case 154 /* PropertyDeclaration */: - case 151 /* Parameter */: + case 155 /* PropertyDeclaration */: + case 152 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -109647,22 +110907,22 @@ var ts; case 18 /* OpenBraceToken */: case 19 /* CloseBraceToken */: case 21 /* CloseParenToken */: - case 83 /* ElseKeyword */: - case 107 /* WhileKeyword */: + case 84 /* ElseKeyword */: + case 108 /* WhileKeyword */: case 58 /* AtToken */: return false; case 42 /* SlashToken */: case 30 /* GreaterThanToken */: switch (container.kind) { - case 262 /* JsxOpeningElement */: - case 263 /* JsxClosingElement */: - case 261 /* JsxSelfClosingElement */: + case 263 /* JsxOpeningElement */: + case 264 /* JsxClosingElement */: + case 262 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 181 /* MappedType */) { + if (container.kind !== 182 /* MappedType */) { return false; } break; @@ -109754,7 +111014,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 152 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 153 /* 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 */) { @@ -109762,7 +111022,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 187 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 188 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -110180,12 +111440,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 157 /* Constructor */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 197 /* ArrowFunction */: + case 158 /* Constructor */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 198 /* ArrowFunction */: if (node.typeParameters === list) { return 28 /* LessThanToken */; } @@ -110193,8 +111453,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: if (node.typeArguments === list) { return 28 /* LessThanToken */; } @@ -110202,12 +111462,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 164 /* TypeReference */: + case 165 /* TypeReference */: if (node.typeArguments === list) { return 28 /* LessThanToken */; } break; - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -110324,7 +111584,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 204 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 205 /* 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 */) { @@ -110478,7 +111738,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 === 284 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 285 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -110526,8 +111786,8 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 222 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 83 /* ElseKeyword */, sourceFile); + if (parent.kind === 223 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 84 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -110544,40 +111804,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 164 /* TypeReference */: + case 165 /* TypeReference */: return getList(node.typeArguments); - case 188 /* ObjectLiteralExpression */: + case 189 /* ObjectLiteralExpression */: return getList(node.properties); - case 187 /* ArrayLiteralExpression */: + case 188 /* ArrayLiteralExpression */: return getList(node.elements); - case 168 /* TypeLiteral */: + case 169 /* TypeLiteral */: return getList(node.members); - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 157 /* Constructor */: - case 166 /* ConstructorType */: - case 161 /* ConstructSignature */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 158 /* Constructor */: + case 167 /* ConstructorType */: + case 162 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 308 /* JSDocTemplateTag */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 309 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 192 /* NewExpression */: - case 191 /* CallExpression */: + case 193 /* NewExpression */: + case 192 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 238 /* VariableDeclarationList */: + case 239 /* VariableDeclarationList */: return getList(node.declarations); - case 252 /* NamedImports */: - case 256 /* NamedExports */: + case 253 /* NamedImports */: + case 257 /* NamedExports */: return getList(node.elements); - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -110600,7 +111860,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 238 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 239 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -110673,83 +111933,83 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 221 /* ExpressionStatement */: - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 187 /* ArrayLiteralExpression */: - case 218 /* Block */: - case 245 /* ModuleBlock */: - case 188 /* ObjectLiteralExpression */: - case 168 /* TypeLiteral */: - case 181 /* MappedType */: - case 170 /* TupleType */: - case 246 /* CaseBlock */: - case 272 /* DefaultClause */: - case 271 /* CaseClause */: - case 195 /* ParenthesizedExpression */: - case 189 /* PropertyAccessExpression */: - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 219 /* VariableStatement */: - case 254 /* ExportAssignment */: - case 230 /* ReturnStatement */: - case 205 /* ConditionalExpression */: - case 185 /* ArrayBindingPattern */: - case 184 /* ObjectBindingPattern */: - case 262 /* JsxOpeningElement */: - case 265 /* JsxOpeningFragment */: - case 261 /* JsxSelfClosingElement */: - case 270 /* JsxExpression */: - case 155 /* MethodSignature */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 151 /* Parameter */: - case 165 /* FunctionType */: - case 166 /* ConstructorType */: - case 177 /* ParenthesizedType */: - case 193 /* TaggedTemplateExpression */: - case 201 /* AwaitExpression */: - case 256 /* NamedExports */: - case 252 /* NamedImports */: - case 257 /* ExportSpecifier */: - case 253 /* ImportSpecifier */: - case 154 /* PropertyDeclaration */: + case 222 /* ExpressionStatement */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 188 /* ArrayLiteralExpression */: + case 219 /* Block */: + case 246 /* ModuleBlock */: + case 189 /* ObjectLiteralExpression */: + case 169 /* TypeLiteral */: + case 182 /* MappedType */: + case 171 /* TupleType */: + case 247 /* CaseBlock */: + case 273 /* DefaultClause */: + case 272 /* CaseClause */: + case 196 /* ParenthesizedExpression */: + case 190 /* PropertyAccessExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 220 /* VariableStatement */: + case 255 /* ExportAssignment */: + case 231 /* ReturnStatement */: + case 206 /* ConditionalExpression */: + case 186 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 263 /* JsxOpeningElement */: + case 266 /* JsxOpeningFragment */: + case 262 /* JsxSelfClosingElement */: + case 271 /* JsxExpression */: + case 156 /* MethodSignature */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 152 /* Parameter */: + case 166 /* FunctionType */: + case 167 /* ConstructorType */: + case 178 /* ParenthesizedType */: + case 194 /* TaggedTemplateExpression */: + case 202 /* AwaitExpression */: + case 257 /* NamedExports */: + case 253 /* NamedImports */: + case 258 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 155 /* PropertyDeclaration */: return true; - case 237 /* VariableDeclaration */: - case 275 /* PropertyAssignment */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 188 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 238 /* VariableDeclaration */: + case 276 /* PropertyAssignment */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 189 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } return true; - case 223 /* DoStatement */: - case 224 /* WhileStatement */: - case 226 /* ForInStatement */: - case 227 /* ForOfStatement */: - case 225 /* ForStatement */: - case 222 /* IfStatement */: - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 197 /* ArrowFunction */: - case 157 /* Constructor */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - return childKind !== 218 /* Block */; - case 255 /* ExportDeclaration */: - return childKind !== 256 /* NamedExports */; - case 249 /* ImportDeclaration */: - return childKind !== 250 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 252 /* NamedImports */); - case 260 /* JsxElement */: - return childKind !== 263 /* JsxClosingElement */; - case 264 /* JsxFragment */: - return childKind !== 266 /* JsxClosingFragment */; - case 174 /* IntersectionType */: - case 173 /* UnionType */: - if (childKind === 168 /* TypeLiteral */) { + case 224 /* DoStatement */: + case 225 /* WhileStatement */: + case 227 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 226 /* ForStatement */: + case 223 /* IfStatement */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 198 /* ArrowFunction */: + case 158 /* Constructor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + return childKind !== 219 /* Block */; + case 256 /* ExportDeclaration */: + return childKind !== 257 /* NamedExports */; + case 250 /* ImportDeclaration */: + return childKind !== 251 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 253 /* NamedImports */); + case 261 /* JsxElement */: + return childKind !== 264 /* JsxClosingElement */; + case 265 /* JsxFragment */: + return childKind !== 267 /* JsxClosingFragment */; + case 175 /* IntersectionType */: + case 174 /* UnionType */: + if (childKind === 169 /* TypeLiteral */) { return false; } // falls through @@ -110760,11 +112020,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 230 /* ReturnStatement */: - case 234 /* ThrowStatement */: - case 228 /* ContinueStatement */: - case 229 /* BreakStatement */: - return parent.kind !== 218 /* Block */; + case 231 /* ReturnStatement */: + case 235 /* ThrowStatement */: + case 229 /* ContinueStatement */: + case 230 /* BreakStatement */: + return parent.kind !== 219 /* Block */; default: return false; } @@ -110906,7 +112166,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 === 188 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 189 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -111067,7 +112327,7 @@ var ts; } } else { - endNode = node.kind !== 237 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; + endNode = node.kind !== 238 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); }; @@ -111179,18 +112439,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 240 /* ClassDeclaration */: - case 244 /* ModuleDeclaration */: + case 241 /* ClassDeclaration */: + case 245 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: case 10 /* StringLiteral */: - case 72 /* Identifier */: + case 73 /* Identifier */: return { prefix: ", " }; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; - case 85 /* ExportKeyword */: + case 86 /* ExportKeyword */: return { prefix: " " }; - case 151 /* Parameter */: + case 152 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -111199,12 +112459,12 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 197 /* ArrowFunction */) { + if (node.kind === 198 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 37 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { // `() => {}` --> `function f() {}` - this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [ts.createToken(90 /* FunctionKeyword */), ts.createIdentifier(name)], { joiner: " " }); + this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [ts.createToken(91 /* FunctionKeyword */), ts.createIdentifier(name)], { joiner: " " }); deleteNode(this, sourceFile, arrow); } else { @@ -111213,14 +112473,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 218 /* Block */) { + if (node.body.kind !== 219 /* Block */) { // `() => 0` => `function f() { return 0; }` - this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(97 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); + this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(18 /* OpenBraceToken */), ts.createToken(98 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(26 /* SemicolonToken */), ts.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 196 /* FunctionExpression */ ? 90 /* FunctionKeyword */ : 76 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 197 /* FunctionExpression */ ? 91 /* FunctionKeyword */ : 77 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " }); } }; @@ -111447,7 +112707,7 @@ var ts; function newFileChangesWorker(oldFile, scriptKind, statements, newLineCharacter, formatContext) { // TODO: this emits the file, parses it back, then formats it that -- may be a less roundabout way to do this var nonFormattedText = statements.map(function (s) { return getNonformattedText(s, oldFile, newLineCharacter).text; }).join(newLineCharacter); - var sourceFile = ts.createSourceFile("any file name", nonFormattedText, 7 /* ESNext */, /*setParentNodes*/ true, scriptKind); + var sourceFile = ts.createSourceFile("any file name", nonFormattedText, 8 /* ESNext */, /*setParentNodes*/ true, scriptKind); var changes = ts.formatting.formatDocument(sourceFile, formatContext); return applyChanges(nonFormattedText, changes) + newLineCharacter; } @@ -111715,14 +112975,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 149 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 150 /* 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 151 /* Parameter */: { + case 152 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -111737,14 +112997,14 @@ var ts; } break; } - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: deleteNode(changes, sourceFile, node, // For first import, leave header comment in place node === sourceFile.imports[0].parent ? { leadingTriviaOption: LeadingTriviaOption.Exclude } : undefined); break; - case 186 /* BindingElement */: + case 187 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 185 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 186 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -111752,13 +113012,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 150 /* TypeParameter */: + case 151 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -111767,7 +113027,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 251 /* NamespaceImport */: + case 252 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; default: @@ -111814,13 +113074,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 249 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 250 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 274 /* CatchClause */) { + if (parent.kind === 275 /* 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; @@ -111831,14 +113091,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 227 /* ForOfStatement */: - case 226 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 227 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.createObjectLiteral()); break; - case 225 /* ForStatement */: + case 226 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: deleteNode(changes, sourceFile, gp); break; default: @@ -112001,8 +113261,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.assertDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertion(n); })); var replacement = ts.isAsExpression(assertion) - ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(143 /* UnknownKeyword */)) - : ts.createTypeAssertion(ts.createKeywordTypeNode(143 /* UnknownKeyword */), assertion.expression); + ? ts.createAsExpression(assertion.expression, ts.createKeywordTypeNode(144 /* UnknownKeyword */)) + : ts.createTypeAssertion(ts.createKeywordTypeNode(144 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -112051,11 +113311,11 @@ var ts; function makeChange(changeTracker, sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); if (!ts.isIdentifier(token)) { - return ts.Debug.fail("add-name-to-nameless-parameter operates on identifiers, but got a " + ts.formatSyntaxKind(token.kind)); + return ts.Debug.fail("add-name-to-nameless-parameter operates on identifiers, but got a " + ts.Debug.formatSyntaxKind(token.kind)); } var param = token.parent; if (!ts.isParameter(param)) { - return ts.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts.formatSyntaxKind(token.kind)); + return ts.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts.Debug.formatSyntaxKind(token.kind)); } var i = param.parent.parameters.indexOf(param); ts.Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); @@ -112137,26 +113397,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 237 /* VariableDeclaration */ || - node.kind === 153 /* PropertySignature */ || - node.kind === 154 /* PropertyDeclaration */; + node.kind === 238 /* VariableDeclaration */ || + node.kind === 154 /* PropertySignature */ || + node.kind === 155 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 289 /* JSDocAllType */: - case 290 /* JSDocUnknownType */: + case 290 /* JSDocAllType */: + case 291 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 293 /* JSDocOptionalType */: + case 294 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 292 /* JSDocNonNullableType */: + case 293 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 291 /* JSDocNullableType */: + case 292 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 295 /* JSDocVariadicType */: + case 296 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 294 /* JSDocFunctionType */: + case 295 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 164 /* TypeReference */: + case 165 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); // TODO: GH#18217 @@ -112178,7 +113438,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 295 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 296 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -112218,8 +113478,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 135 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 135 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 136 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 136 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -112319,7 +113579,7 @@ var ts; return errorCode; } function doChange(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host) { - if (!ts.isParameterPropertyModifier(token.kind) && token.kind !== 72 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 100 /* ThisKeyword */) { + if (!ts.isParameterPropertyModifier(token.kind) && token.kind !== 73 /* Identifier */ && token.kind !== 25 /* DotDotDotToken */ && token.kind !== 101 /* ThisKeyword */) { return undefined; } var parent = token.parent; @@ -112440,7 +113700,7 @@ var ts; function annotate(changes, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 153 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 154 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -112481,13 +113741,13 @@ var ts; return !!merged; }); }); var tag = ts.createJSDocComment(comments.join("\n"), ts.createNodeArray((oldTags || ts.emptyArray).concat(unmergedNewTags))); - var jsDocNode = parent.kind === 197 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 198 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 154 /* PropertyDeclaration */) { + if (signature.parent.kind === 155 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -112497,14 +113757,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 304 /* JSDocParameterTag */: { + case 305 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.createJSDocParamTag(newParam.name, newParam.isBracketed, newParam.typeExpression, oldParam.comment) : undefined; } - case 305 /* JSDocReturnTag */: + case 306 /* JSDocReturnTag */: return ts.createJSDocReturnTag(newTag.typeExpression, oldTag.comment); } } @@ -112523,18 +113783,18 @@ var ts; function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 157 /* Constructor */: - searchToken = ts.findChildOfKind(containingFunction, 124 /* ConstructorKeyword */, sourceFile); + case 158 /* Constructor */: + searchToken = ts.findChildOfKind(containingFunction, 125 /* ConstructorKeyword */, sourceFile); break; - case 197 /* ArrowFunction */: - case 196 /* FunctionExpression */: + case 198 /* ArrowFunction */: + case 197 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -112606,21 +113866,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 203 /* PostfixUnaryExpression */: + case 204 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 202 /* PrefixUnaryExpression */: + case 203 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 191 /* CallExpression */: - case 192 /* NewExpression */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -112628,13 +113888,13 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; - case 237 /* VariableDeclaration */: { + case 238 /* 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. @@ -112685,17 +113945,17 @@ var ts; case 50 /* BarToken */: case 51 /* CaretToken */: // CompoundAssignmentOperator - case 61 /* MinusEqualsToken */: - case 63 /* AsteriskAsteriskEqualsToken */: - case 62 /* AsteriskEqualsToken */: - case 64 /* SlashEqualsToken */: - case 65 /* PercentEqualsToken */: - case 69 /* AmpersandEqualsToken */: - case 70 /* BarEqualsToken */: - case 71 /* CaretEqualsToken */: - case 66 /* LessThanLessThanEqualsToken */: - case 68 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 67 /* GreaterThanGreaterThanEqualsToken */: + case 62 /* MinusEqualsToken */: + case 64 /* AsteriskAsteriskEqualsToken */: + case 63 /* AsteriskEqualsToken */: + case 65 /* SlashEqualsToken */: + case 66 /* PercentEqualsToken */: + case 70 /* AmpersandEqualsToken */: + case 71 /* BarEqualsToken */: + case 72 /* CaretEqualsToken */: + case 67 /* LessThanLessThanEqualsToken */: + case 69 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 68 /* GreaterThanGreaterThanEqualsToken */: // AdditiveOperator case 39 /* MinusToken */: // RelationalOperator @@ -112711,7 +113971,7 @@ var ts; usageContext.isNumber = true; } break; - case 60 /* PlusEqualsToken */: + case 61 /* PlusEqualsToken */: case 38 /* PlusToken */: var otherOperandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left); if (otherOperandType.flags & 1056 /* EnumLike */) { @@ -112728,14 +113988,14 @@ var ts; } break; // AssignmentOperators - case 59 /* EqualsToken */: + case 60 /* EqualsToken */: case 33 /* EqualsEqualsToken */: case 35 /* EqualsEqualsEqualsToken */: case 36 /* ExclamationEqualsEqualsToken */: case 34 /* ExclamationEqualsToken */: addCandidateType(usageContext, checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left)); break; - case 93 /* InKeyword */: + case 94 /* InKeyword */: if (node === parent.left) { usageContext.isString = true; } @@ -112743,7 +114003,7 @@ var ts; // LogicalOperator case 55 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 237 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 238 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -112751,7 +114011,7 @@ var ts; break; case 54 /* AmpersandAmpersandToken */: case 27 /* CommaToken */: - case 94 /* InstanceOfKeyword */: + case 95 /* InstanceOfKeyword */: // nothing to infer here break; } @@ -112771,7 +114031,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 191 /* CallExpression */) { + if (parent.kind === 192 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -113011,12 +114271,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: precedingNode = ctorDeclaration; changes.delete(sourceFile, ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); if (ctorDeclaration.parent.declarations.length === 1) { @@ -113048,7 +114308,7 @@ var ts; // all static members are stored in the "exports" array of symbol if (symbol.exports) { symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(116 /* StaticKeyword */)]); + var memberElement = createClassElement(member, [ts.createToken(117 /* StaticKeyword */)]); if (memberElement) { memberElements.push(memberElement); } @@ -113071,7 +114331,7 @@ var ts; return; } // 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 === 221 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 222 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -113079,27 +114339,27 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 196 /* FunctionExpression */: { + case 197 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 121 /* AsyncKeyword */)); + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 122 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); return method; } - case 197 /* ArrowFunction */: { + case 198 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 218 /* Block */) { + if (arrowFunctionBody.kind === 219 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] else { bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); } - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 121 /* AsyncKeyword */)); + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 122 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); ts.copyLeadingComments(assignmentBinaryExpression, method, sourceFile); @@ -113120,17 +114380,17 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 196 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 197 /* FunctionExpression */) { return undefined; } - if (node.name.kind !== 72 /* Identifier */) { + if (node.name.kind !== 73 /* Identifier */) { return undefined; } var memberElements = createClassElementsFromSymbol(node.symbol); if (initializer.body) { memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); } - var modifiers = getModifierKindFromSource(precedingNode, 85 /* ExportKeyword */); + var modifiers = getModifierKindFromSource(precedingNode, 86 /* ExportKeyword */); var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place @@ -113141,7 +114401,7 @@ var ts; if (node.body) { memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); } - var modifiers = getModifierKindFromSource(node, 85 /* ExportKeyword */); + var modifiers = getModifierKindFromSource(node, 86 /* ExportKeyword */); var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place @@ -113171,6 +114431,11 @@ var ts; fixIds: [fixId], getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, err) { return convertToAsyncFunction(changes, err.file, err.start, context.program.getTypeChecker(), context); }); }, }); + var SynthBindingNameKind; + (function (SynthBindingNameKind) { + SynthBindingNameKind[SynthBindingNameKind["Identifier"] = 0] = "Identifier"; + SynthBindingNameKind[SynthBindingNameKind["BindingPattern"] = 1] = "BindingPattern"; + })(SynthBindingNameKind || (SynthBindingNameKind = {})); function convertToAsyncFunction(changes, sourceFile, position, checker, context) { // get the function declaration - returns a promise var tokenAtPosition = ts.getTokenAtPosition(sourceFile, position); @@ -113199,7 +114464,7 @@ var ts; return; } // add the async keyword - changes.insertLastModifierBefore(sourceFile, 121 /* AsyncKeyword */, functionToConvert); + changes.insertLastModifierBefore(sourceFile, 122 /* AsyncKeyword */, functionToConvert); function startTransformation(node, nodeToReplace) { var newNodes = transformExpression(node, transformer, node); changes.replaceNodeWithNodes(sourceFile, nodeToReplace, newNodes); @@ -113307,8 +114572,8 @@ var ts; allVarNames.push({ identifier: synthName.identifier, symbol: symbol }); addNameToFrequencyMap(collidingSymbolMap, ident.text, symbol); } - // we only care about identifiers that are parameters and declarations (don't care about other uses) - else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent))) { + // we only care about identifiers that are parameters, declarations, or binding elements (don't care about other uses) + else if (node.parent && (ts.isParameter(node.parent) || ts.isVariableDeclaration(node.parent) || ts.isBindingElement(node.parent))) { var originalName = node.text; var collidingSymbols = collidingSymbolMap.get(originalName); // if the identifier name conflicts with a different identifier that we've already seen @@ -113322,7 +114587,7 @@ var ts; else { var identifier = ts.getSynthesizedDeepClone(node); identsToRenameMap.set(symbolIdString, identifier); - synthNamesMap.set(symbolIdString, { identifier: identifier, types: [], numberOfAssignmentsOriginal: allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/ }); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier, [], allVarNames.filter(function (elem) { return elem.identifier.text === node.text; }).length /*, numberOfAssignmentsSynthesized: 0*/)); if ((ts.isParameter(node.parent) && isExpressionOrCallOnTypePromise(node.parent.parent)) || ts.isVariableDeclaration(node.parent)) { allVarNames.push({ identifier: identifier, symbol: symbol }); addNameToFrequencyMap(collidingSymbolMap, originalName, symbol); @@ -113370,7 +114635,7 @@ var ts; var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; var numberOfAssignmentsOriginal = 0; var identifier = numVarsSameName === 0 ? name : ts.createIdentifier(name.text + "_" + numVarsSameName); - return { identifier: identifier, types: [], numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return createSynthIdentifier(identifier, [], numberOfAssignmentsOriginal); } // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts @@ -113397,68 +114662,90 @@ var ts; } function transformCatch(node, transformer, prevArgName) { var func = node.arguments[0]; - var argName = getArgName(func, transformer); + var argName = getArgBindingName(func, transformer); var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(node).toString()); + var possibleNameForVarDecl; /* If there is another call in the chain after the .catch() we are transforming, we will need to save the result of both paths (try block and catch block) To do this, we will need to synthesize a variable that we were not aware of while we were adding identifiers to the synthNamesMap We will use the prevArgName and then update the synthNamesMap with a new variable name for the next transformation step */ if (prevArgName && !shouldReturn) { - prevArgName.numberOfAssignmentsOriginal = 2; // Try block and catch block - transformer.synthNamesMap.forEach(function (val, key) { - if (val.identifier.text === prevArgName.identifier.text) { - var newSynthName = createUniqueSynthName(prevArgName); - transformer.synthNamesMap.set(key, newSynthName); - } - }); + if (isSynthIdentifier(prevArgName)) { + possibleNameForVarDecl = prevArgName; + transformer.synthNamesMap.forEach(function (val, key) { + if (val.identifier.text === prevArgName.identifier.text) { + var newSynthName = createUniqueSynthName(prevArgName); + transformer.synthNamesMap.set(key, newSynthName); + } + }); + } + else { + possibleNameForVarDecl = createSynthIdentifier(ts.createOptimisticUniqueName("result"), prevArgName.types); + } + possibleNameForVarDecl.numberOfAssignmentsOriginal = 2; // Try block and catch block // update the constIdentifiers list - if (transformer.constIdentifiers.some(function (elem) { return elem.text === prevArgName.identifier.text; })) { - transformer.constIdentifiers.push(createUniqueSynthName(prevArgName).identifier); + if (transformer.constIdentifiers.some(function (elem) { return elem.text === possibleNameForVarDecl.identifier.text; })) { + transformer.constIdentifiers.push(createUniqueSynthName(possibleNameForVarDecl).identifier); } } - var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, prevArgName)); - var transformationBody = getTransformationBody(func, prevArgName, argName, node, transformer); - var catchArg = argName ? argName.identifier.text : "e"; - var catchClause = ts.createCatchClause(catchArg, ts.createBlock(transformationBody)); + var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, possibleNameForVarDecl)); + var transformationBody = getTransformationBody(func, possibleNameForVarDecl, argName, node, transformer); + var catchArg = argName ? isSynthIdentifier(argName) ? argName.identifier.text : argName.bindingPattern : "e"; + var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); + var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody)); /* In order to avoid an implicit any, we will synthesize a type for the declaration using the unions of the types of both paths (try block and catch block) */ var varDeclList; - if (prevArgName && !shouldReturn) { - var typeArray = prevArgName.types; + var varDeclIdentifier; + if (possibleNameForVarDecl && !shouldReturn) { + varDeclIdentifier = ts.getSynthesizedDeepClone(possibleNameForVarDecl.identifier); + var typeArray = possibleNameForVarDecl.types; var unionType = transformer.checker.getUnionType(typeArray, 2 /* Subtype */); var unionTypeNode = transformer.isInJSFile ? undefined : transformer.checker.typeToTypeNode(unionType); - var varDecl = [ts.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.identifier), unionTypeNode)]; + var varDecl = [ts.createVariableDeclaration(varDeclIdentifier, unionTypeNode)]; varDeclList = ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList(varDecl, 1 /* Let */)); } var tryStatement = ts.createTry(tryBlock, catchClause, /*finallyBlock*/ undefined); - return varDeclList ? [varDeclList, tryStatement] : [tryStatement]; + var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName) + && ts.createVariableStatement(/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /* type */ undefined, varDeclIdentifier)], 2 /* Const */)); + return ts.compact([varDeclList, tryStatement, destructuredResult]); + } + function getIdentifierTextsFromBindingName(bindingName) { + if (ts.isIdentifier(bindingName)) + return [bindingName.text]; + return ts.flatMap(bindingName.elements, function (element) { + if (ts.isOmittedExpression(element)) + return []; + return getIdentifierTextsFromBindingName(element.name); + }); } function createUniqueSynthName(prevArgName) { var renamedPrevArg = ts.createOptimisticUniqueName(prevArgName.identifier.text); - var newSynthName = { identifier: renamedPrevArg, types: [], numberOfAssignmentsOriginal: 0 }; - return newSynthName; + return createSynthIdentifier(renamedPrevArg); } function transformThen(node, transformer, outermostParent, prevArgName) { var _a = node.arguments, res = _a[0], rej = _a[1]; if (!res) { return transformExpression(node.expression, transformer, outermostParent); } - var argNameRes = getArgName(res, transformer); + var argNameRes = getArgBindingName(res, transformer); var transformationBody = getTransformationBody(res, prevArgName, argNameRes, node, transformer); if (rej) { - var argNameRej = getArgName(rej, transformer); + var argNameRej = getArgBindingName(rej, transformer); var tryBlock = ts.createBlock(transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody)); var transformationBody2 = getTransformationBody(rej, prevArgName, argNameRej, node, transformer); - var catchArg = argNameRej ? argNameRej.identifier.text : "e"; - var catchClause = ts.createCatchClause(catchArg, ts.createBlock(transformationBody2)); + var catchArg = argNameRej ? isSynthIdentifier(argNameRej) ? argNameRej.identifier.text : argNameRej.bindingPattern : "e"; + var catchVariableDeclaration = ts.createVariableDeclaration(catchArg); + var catchClause = ts.createCatchClause(catchVariableDeclaration, ts.createBlock(transformationBody2)); return [ts.createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); } - function getFlagOfIdentifier(node, constIdentifiers) { - var inArr = constIdentifiers.some(function (elem) { return elem.text === node.text; }); + function getFlagOfBindingName(bindingName, constIdentifiers) { + var identifiers = getIdentifierTextsFromBindingName(getNode(bindingName)); + var inArr = constIdentifiers.some(function (elem) { return ts.contains(identifiers, elem.text); }); return inArr ? 2 /* Const */ : 1 /* Let */; } function transformPromiseCall(node, transformer, prevArgName) { @@ -113474,29 +114761,29 @@ var ts; return [ts.createReturn(ts.getSynthesizedDeepClone(node))]; } function createTransformedStatement(prevArgName, rightHandSide, transformer) { - if (!prevArgName || prevArgName.identifier.text.length === 0) { + if (!prevArgName || isEmpty(prevArgName)) { // if there's no argName to assign to, there still might be side effects return [ts.createStatement(rightHandSide)]; } - if (prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { + if (isSynthIdentifier(prevArgName) && prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { // if the variable has already been declared, we don't need "let" or "const" return [ts.createStatement(ts.createAssignment(ts.getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; } - return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.identifier), /*type*/ undefined, rightHandSide)], getFlagOfIdentifier(prevArgName.identifier, transformer.constIdentifiers))))]; + return [ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.getSynthesizedDeepClone(getNode(prevArgName)), /*type*/ undefined, rightHandSide)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { var shouldReturn = transformer.setOfExpressionsToReturn.get(ts.getNodeId(parent).toString()); switch (func.kind) { - case 96 /* NullKeyword */: + case 97 /* NullKeyword */: // do not produce a transformed statement for a null argument break; - case 72 /* Identifier */: // identifier includes undefined + case 73 /* Identifier */: // identifier includes undefined if (!argName) { // undefined was argument passed to promise handler break; } - var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, [argName.identifier]); + var synthCall = ts.createCall(ts.getSynthesizedDeepClone(func), /*typeArguments*/ undefined, isSynthIdentifier(argName) ? [argName.identifier] : []); if (shouldReturn) { return [ts.createReturn(synthCall)]; } @@ -113513,8 +114800,8 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: { + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: { var funcBody = func.body; // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { @@ -113533,7 +114820,7 @@ var ts; } } return shouldReturn ? refactoredStmts.map(function (s) { return ts.getSynthesizedDeepClone(s); }) : - removeReturns(refactoredStmts, prevArgName === undefined ? undefined : prevArgName.identifier, transformer, seenReturnStatement); + removeReturns(refactoredStmts, prevArgName, transformer, seenReturnStatement); } else { var innerRetStmts = ts.isFixablePromiseHandler(funcBody) ? [ts.createReturn(funcBody)] : ts.emptyArray; @@ -113579,7 +114866,7 @@ var ts; ret.push(ts.createExpressionStatement(possiblyAwaitedExpression)); } else { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(prevArgName, /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); } } } @@ -113589,7 +114876,7 @@ var ts; } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables if (!seenReturnStatement && prevArgName !== undefined) { - ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(prevArgName, /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); + ret.push(ts.createVariableStatement(/*modifiers*/ undefined, (ts.createVariableDeclarationList([ts.createVariableDeclaration(getNode(prevArgName), /*type*/ undefined, ts.createIdentifier("undefined"))], getFlagOfBindingName(prevArgName, transformer.constIdentifiers))))); } return ret; } @@ -113612,32 +114899,42 @@ var ts; } return innerCbBody; } - function getArgName(funcNode, transformer) { + function getArgBindingName(funcNode, transformer) { var numberOfAssignmentsOriginal = 0; var types = []; var name; if (ts.isFunctionLikeDeclaration(funcNode)) { if (funcNode.parameters.length > 0) { var param = funcNode.parameters[0].name; - name = getMapEntryOrDefault(param); + name = getMappedBindingNameOrDefault(param); } } else if (ts.isIdentifier(funcNode)) { name = getMapEntryOrDefault(funcNode); } // return undefined argName when arg is null or undefined - if (!name || name.identifier.text === "undefined") { + if (!name || "identifier" in name && name.identifier.text === "undefined") { return undefined; } return name; + function getMappedBindingNameOrDefault(bindingName) { + if (ts.isIdentifier(bindingName)) + return getMapEntryOrDefault(bindingName); + var elements = ts.flatMap(bindingName.elements, function (element) { + if (ts.isOmittedExpression(element)) + return []; + return [getMappedBindingNameOrDefault(element.name)]; + }); + return createSynthBindingPattern(bindingName, elements); + } function getMapEntryOrDefault(identifier) { var originalNode = getOriginalNode(identifier); var symbol = getSymbol(originalNode); if (!symbol) { - return { identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); } var mapEntry = transformer.synthNamesMap.get(ts.getSymbolId(symbol).toString()); - return mapEntry || { identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + return mapEntry || createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal); } function getSymbol(node) { return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); @@ -113646,6 +114943,34 @@ var ts; return node.original ? node.original : node; } } + function isEmpty(bindingName) { + if (!bindingName) { + return true; + } + if (isSynthIdentifier(bindingName)) { + return !bindingName.identifier.text; + } + return ts.every(bindingName.elements, isEmpty); + } + function getNode(bindingName) { + return isSynthIdentifier(bindingName) ? bindingName.identifier : bindingName.bindingPattern; + } + function createSynthIdentifier(identifier, types, numberOfAssignmentsOriginal) { + if (types === void 0) { types = []; } + if (numberOfAssignmentsOriginal === void 0) { numberOfAssignmentsOriginal = 0; } + return { kind: 0 /* Identifier */, identifier: identifier, types: types, numberOfAssignmentsOriginal: numberOfAssignmentsOriginal }; + } + function createSynthBindingPattern(bindingPattern, elements, types) { + if (elements === void 0) { elements = ts.emptyArray; } + if (types === void 0) { types = []; } + return { kind: 1 /* BindingPattern */, bindingPattern: bindingPattern, elements: elements, types: types }; + } + function isSynthIdentifier(bindingName) { + return bindingName.kind === 0 /* Identifier */; + } + function isSynthBindingPattern(bindingName) { + return bindingName.kind === 1 /* BindingPattern */; + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -113679,10 +115004,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 191 /* CallExpression */: + case 192 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -113728,29 +115053,29 @@ var ts; sourceFile.forEachChild(function recur(node) { if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { var parent = node.parent; - cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 59 /* EqualsToken */); + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 60 /* EqualsToken */); } node.forEachChild(recur); }); } function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 221 /* ExpressionStatement */: { + case 222 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 191 /* CallExpression */: { + case 192 /* 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 204 /* BinaryExpression */: { + case 205 /* BinaryExpression */: { var operatorToken = expression.operatorToken; - return operatorToken.kind === 59 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); + return operatorToken.kind === 60 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } } } @@ -113790,8 +115115,8 @@ var ts; /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: { + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); return [ @@ -113799,7 +115124,7 @@ var ts; makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), ]; } - case 72 /* Identifier */: + case 73 /* Identifier */: // `const a = require("b").c` --> `import { c as a } from "./b"; return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]; default: @@ -113842,16 +115167,16 @@ var ts; function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. - case 276 /* ShorthandPropertyAssignment */: - case 277 /* SpreadAssignment */: + case 277 /* ShorthandPropertyAssignment */: + case 278 /* SpreadAssignment */: return undefined; - case 275 /* PropertyAssignment */: + case 276 /* PropertyAssignment */: return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); - case 156 /* MethodDeclaration */: - return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(85 /* ExportKeyword */)], prop); + case 157 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(86 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop); } @@ -113900,7 +115225,7 @@ var ts; var name = left.name.text; if ((ts.isFunctionExpression(right) || ts.isArrowFunction(right) || ts.isClassExpression(right)) && (!right.name || right.name.text === name)) { // `exports.f = function() {}` -> `export function f() {}` -- Replace `exports.f = ` with `export `, and insert the name after `function`. - changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, ts.createToken(85 /* ExportKeyword */), { suffix: " " }); + changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, ts.createToken(86 /* ExportKeyword */), { suffix: " " }); if (!right.name) changes.insertName(sourceFile, right, name); var semi = ts.findChildOfKind(parent, 26 /* SemicolonToken */, sourceFile); @@ -113909,14 +115234,14 @@ var ts; } else { // `exports.f = function g() {}` -> `export const f = function g() {}` -- just replace `exports.` with `export const ` - changes.replaceNodeRangeWithNodes(sourceFile, left.expression, ts.findChildOfKind(left, 24 /* DotToken */, sourceFile), [ts.createToken(85 /* ExportKeyword */), ts.createToken(77 /* ConstKeyword */)], { joiner: " ", suffix: " " }); + changes.replaceNodeRangeWithNodes(sourceFile, left.expression, ts.findChildOfKind(left, 24 /* DotToken */, sourceFile), [ts.createToken(86 /* ExportKeyword */), ts.createToken(78 /* ConstKeyword */)], { joiner: " ", suffix: " " }); } } // 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) { - var modifiers = [ts.createToken(85 /* ExportKeyword */)]; + var modifiers = [ts.createToken(86 /* ExportKeyword */)]; switch (exported.kind) { - case 196 /* FunctionExpression */: { + case 197 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -113924,10 +115249,10 @@ var ts; } } // falls through - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` return functionExpressionToDeclaration(name, modifiers, exported); - case 209 /* ClassExpression */: + case 210 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` return classExpressionToDeclaration(name, modifiers, exported); default: @@ -113945,7 +115270,7 @@ var ts; */ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 184 /* ObjectBindingPattern */: { + case 185 /* 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 @@ -113956,7 +115281,7 @@ var ts; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 185 /* ArrayBindingPattern */: { + case 186 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; @@ -113967,7 +115292,7 @@ var ts; makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), ]; } - case 72 /* Identifier */: + case 73 /* Identifier */: return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference); default: return ts.Debug.assertNever(name); @@ -114039,11 +115364,11 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: return parent.name !== node; - case 186 /* BindingElement */: + case 187 /* BindingElement */: return parent.propertyName !== node; - case 253 /* ImportSpecifier */: + case 254 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; @@ -114382,21 +115707,21 @@ var ts; function tryAddToExistingImport(existingImports) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind !== 249 /* ImportDeclaration */) + if (declaration.kind !== 250 /* ImportDeclaration */) return undefined; var importClause = declaration.importClause; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 252 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 253 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClause: importClause, importKind: importKind } : undefined; }); } function getNamespaceImportName(declaration) { - if (declaration.kind === 249 /* ImportDeclaration */) { + if (declaration.kind === 250 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 251 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 252 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; @@ -114407,7 +115732,7 @@ var ts; // Can't use an es6 import for a type in JS. return exportedSymbolIsTypeOnly && ts.isSourceFileJS(sourceFile) ? ts.emptyArray : ts.mapDefined(sourceFile.imports, function (moduleSpecifier) { var i = ts.importFromModuleSpecifier(moduleSpecifier); - return (i.kind === 249 /* ImportDeclaration */ || i.kind === 248 /* ImportEqualsDeclaration */) + return (i.kind === 250 /* ImportDeclaration */ || i.kind === 249 /* ImportEqualsDeclaration */) && checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; }); } @@ -114430,9 +115755,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a) { var declaration = _a.declaration, importKind = _a.importKind; - var expression = declaration.kind === 249 /* ImportDeclaration */ + var expression = declaration.kind === 250 /* ImportDeclaration */ ? declaration.moduleSpecifier - : declaration.moduleReference.kind === 259 /* ExternalModuleReference */ + : declaration.moduleReference.kind === 260 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return expression && ts.isStringLiteral(expression) ? { kind: 3 /* AddNew */, moduleSpecifier: expression.text, importKind: importKind } : undefined; @@ -114760,12 +116085,12 @@ var ts; var checker = context.program.getTypeChecker(); var suggestion; if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) { - ts.Debug.assert(node.kind === 72 /* Identifier */); + ts.Debug.assert(node.kind === 73 /* Identifier */); var containingType = checker.getTypeAtLocation(node.parent.expression); suggestion = checker.getSuggestionForNonexistentProperty(node, containingType); } else if (ts.isImportSpecifier(node.parent) && node.parent.name === node) { - ts.Debug.assert(node.kind === 72 /* Identifier */); + ts.Debug.assert(node.kind === 73 /* Identifier */); var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration); var resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration); if (resolvedSourceFile && resolvedSourceFile.symbol) { @@ -114828,7 +116153,7 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker()); + var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker(), context.program); if (!info) return undefined; if (info.kind === 0 /* Enum */) { @@ -114851,7 +116176,7 @@ var ts; var typeDeclToMembers = new ts.NodeMap(); return codefix.createCombinedCodeActions(ts.textChanges.ChangeTracker.with(context, function (changes) { codefix.eachDiagnostic(context, errorCodes, function (diag) { - var info = getInfo(diag.file, diag.start, checker); + var info = getInfo(diag.file, diag.start, checker, context.program); if (!info || !ts.addToSeen(seen, ts.getNodeId(info.parentDeclaration) + "#" + info.token.text)) { return; } @@ -114919,7 +116244,7 @@ var ts; InfoKind[InfoKind["Enum"] = 0] = "Enum"; InfoKind[InfoKind["ClassOrInterface"] = 1] = "ClassOrInterface"; })(InfoKind || (InfoKind = {})); - function getInfo(tokenSourceFile, tokenPos, checker) { + function getInfo(tokenSourceFile, tokenPos, checker, program) { // The identifier of the missing property. eg: // this.missing = 1; // ^^^^^^^ @@ -114936,7 +116261,7 @@ var ts; return undefined; // Prefer to change the class instead of the interface if they are merged var classOrInterface = ts.find(symbol.declarations, ts.isClassLike) || ts.find(symbol.declarations, ts.isInterfaceDeclaration); - if (classOrInterface) { + if (classOrInterface && !program.isSourceFileFromExternalLibrary(classOrInterface.getSourceFile())) { var makeStatic = (leftExpressionType.target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol); var declSourceFile = classOrInterface.getSourceFile(); var inJs = ts.isSourceFileJS(declSourceFile); @@ -114944,7 +116269,7 @@ var ts; return { kind: 1 /* ClassOrInterface */, token: token, parentDeclaration: classOrInterface, makeStatic: makeStatic, declSourceFile: declSourceFile, inJs: inJs, call: call }; } var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration); - if (enumDeclaration) { + if (enumDeclaration && !program.isSourceFileFromExternalLibrary(enumDeclaration.getSourceFile())) { return { kind: 0 /* Enum */, token: token, parentDeclaration: enumDeclaration }; } return undefined; @@ -114956,7 +116281,7 @@ var ts; } function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, tokenName, makeStatic) { if (makeStatic) { - if (classDeclaration.kind === 209 /* ClassExpression */) { + if (classDeclaration.kind === 210 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -114982,7 +116307,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 204 /* BinaryExpression */) { + if (token.parent.parent.kind === 205 /* 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))); @@ -114992,7 +116317,7 @@ var ts; var contextualType = checker.getContextualType(token.parent); typeNode = contextualType ? checker.typeToTypeNode(contextualType) : undefined; } - return typeNode || ts.createKeywordTypeNode(120 /* AnyKeyword */); + return typeNode || ts.createKeywordTypeNode(121 /* AnyKeyword */); } function createAddPropertyDeclarationAction(context, declSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); @@ -115001,7 +116326,7 @@ var ts; function addPropertyDeclaration(changeTracker, declSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { var property = ts.createProperty( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(116 /* StaticKeyword */)] : undefined, tokenName, + /*modifiers*/ makeStatic ? [ts.createToken(117 /* StaticKeyword */)] : undefined, tokenName, /*questionToken*/ undefined, typeNode, /*initializer*/ undefined); var lastProp = getNodeToInsertPropertyAfter(classDeclaration); @@ -115025,7 +116350,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(138 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(139 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -115045,7 +116370,7 @@ var ts; } function addMethodDeclaration(context, changeTracker, declSourceFile, typeDecl, token, callExpression, makeStatic, inJs, preferences) { var methodDeclaration = codefix.createMethodFromCallExpression(context, callExpression, token.text, inJs, makeStatic, preferences, typeDecl); - var containingMethodDeclaration = ts.getAncestor(callExpression, 156 /* MethodDeclaration */); + var containingMethodDeclaration = ts.getAncestor(callExpression, 157 /* MethodDeclaration */); if (containingMethodDeclaration && containingMethodDeclaration.parent === typeDecl) { changeTracker.insertNodeAfter(declSourceFile, containingMethodDeclaration, methodDeclaration); } @@ -115109,7 +116434,6 @@ var ts; (function (codefix) { var fixName = "fixCannotFindModule"; var fixIdInstallTypesPackage = "installTypesPackage"; - var fixIdGenerateTypes = "generateTypes"; var errorCodeCannotFindModule = ts.Diagnostics.Cannot_find_module_0.code; var errorCodes = [ errorCodeCannotFindModule, @@ -115124,13 +116448,12 @@ var ts; return undefined; var typesPackageName = getTypesPackageNameToInstall(packageName, host, context.errorCode); return typesPackageName === undefined - ? ts.singleElementArray(tryGetGenerateTypesAction(context, packageName)) + ? [] : [codefix.createCodeFixAction(fixName, /*changes*/ [], [ts.Diagnostics.Install_0, typesPackageName], fixIdInstallTypesPackage, ts.Diagnostics.Install_all_missing_types_packages, getInstallCommand(sourceFile.fileName, typesPackageName))]; }, - fixIds: [fixIdInstallTypesPackage, fixIdGenerateTypes], + fixIds: [fixIdInstallTypesPackage], getAllCodeActions: function (context) { - var savedTypesDir = null; // tslint:disable-line no-null-keyword - return codefix.codeFixAll(context, errorCodes, function (changes, diag, commands) { + return codefix.codeFixAll(context, errorCodes, function (_changes, diag, commands) { var packageName = tryGetImportedPackageName(diag.file, diag.start); if (packageName === undefined) return undefined; @@ -115142,96 +116465,12 @@ var ts; } break; } - case fixIdGenerateTypes: { - var typesDir = savedTypesDir !== null ? savedTypesDir : savedTypesDir = getOrCreateTypesDirectory(changes, context); - var command = typesDir === undefined ? undefined : tryGenerateTypes(typesDir, packageName, context); - if (command) - commands.push(command); - break; - } default: ts.Debug.fail("Bad fixId: " + context.fixId); } }); }, }); - function tryGetGenerateTypesAction(context, packageName) { - var command; - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { - var typesDir = getOrCreateTypesDirectory(t, context); - command = typesDir === undefined ? undefined : tryGenerateTypes(typesDir, packageName, context); - }); - return command && codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Generate_types_for_0, packageName], fixIdGenerateTypes, ts.Diagnostics.Generate_types_for_all_packages_without_types, command); - } - function tryGenerateTypes(typesDir, packageName, context) { - var file = context.sourceFile.fileName; - var fileToGenerateTypesFor = ts.tryResolveJSModule(packageName, ts.getDirectoryPath(file), context.host); // TODO: GH#18217 - if (fileToGenerateTypesFor === undefined) - return undefined; - var outputFileName = ts.resolvePath(ts.getDirectoryPath(context.program.getCompilerOptions().configFile.fileName), typesDir, packageName + ".d.ts"); - if (context.host.fileExists(outputFileName)) - return undefined; - return { type: "generate types", file: file, fileToGenerateTypesFor: fileToGenerateTypesFor, outputFileName: outputFileName }; - } - // If no types directory exists yet, adds it to tsconfig.json - function getOrCreateTypesDirectory(changes, context) { - var configFile = context.program.getCompilerOptions().configFile; - if (!configFile) - return undefined; - var tsconfigObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile); - if (!tsconfigObjectLiteral) - return undefined; - var compilerOptionsProperty = codefix.findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); - if (!compilerOptionsProperty) { - var newCompilerOptions = ts.createObjectLiteral([makeDefaultBaseUrl(), makeDefaultPaths()]); - changes.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, codefix.createJsonPropertyAssignment("compilerOptions", newCompilerOptions)); - return defaultTypesDirectoryName; - } - var compilerOptions = compilerOptionsProperty.initializer; - if (!ts.isObjectLiteralExpression(compilerOptions)) - return defaultTypesDirectoryName; - var baseUrl = getOrAddBaseUrl(changes, configFile, compilerOptions); - var typesDirectoryFromPathMapping = getOrAddPathMapping(changes, configFile, compilerOptions); - return ts.combinePaths(baseUrl, typesDirectoryFromPathMapping); - } - var defaultBaseUrl = "."; - function makeDefaultBaseUrl() { - return codefix.createJsonPropertyAssignment("baseUrl", ts.createStringLiteral(defaultBaseUrl)); - } - function getOrAddBaseUrl(changes, tsconfig, compilerOptions) { - var baseUrlProp = codefix.findJsonProperty(compilerOptions, "baseUrl"); - if (baseUrlProp) { - return ts.isStringLiteral(baseUrlProp.initializer) ? baseUrlProp.initializer.text : defaultBaseUrl; - } - else { - changes.insertNodeAtObjectStart(tsconfig, compilerOptions, makeDefaultBaseUrl()); - return defaultBaseUrl; - } - } - var defaultTypesDirectoryName = "types"; - function makeDefaultPathMapping() { - return codefix.createJsonPropertyAssignment("*", ts.createArrayLiteral([ts.createStringLiteral(defaultTypesDirectoryName + "/*")])); - } - function makeDefaultPaths() { - return codefix.createJsonPropertyAssignment("paths", ts.createObjectLiteral([makeDefaultPathMapping()])); - } - function getOrAddPathMapping(changes, tsconfig, compilerOptions) { - var paths = codefix.findJsonProperty(compilerOptions, "paths"); - if (!paths || !ts.isObjectLiteralExpression(paths.initializer)) { - changes.insertNodeAtObjectStart(tsconfig, compilerOptions, makeDefaultPaths()); - return defaultTypesDirectoryName; - } - // Look for an existing path mapping. Should look like `"*": "foo/*"`. - var existing = ts.firstDefined(paths.initializer.properties, function (prop) { - return ts.isPropertyAssignment(prop) && ts.isStringLiteral(prop.name) && prop.name.text === "*" && ts.isArrayLiteralExpression(prop.initializer) - ? ts.firstDefined(prop.initializer.elements, function (value) { return ts.isStringLiteral(value) ? ts.tryRemoveSuffix(value.text, "/*") : undefined; }) - : undefined; - }); - if (existing) - return existing; - changes.insertNodeAtObjectStart(tsconfig, paths.initializer, makeDefaultPathMapping()); - return defaultTypesDirectoryName; - } function getInstallCommand(fileName, packageName) { return { type: "install package", file: fileName, packageName: packageName }; } @@ -115339,7 +116578,7 @@ var ts; } function getNodes(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - if (token.kind !== 100 /* ThisKeyword */) + if (token.kind !== 101 /* ThisKeyword */) return undefined; var constructor = ts.getContainingFunction(token); var superCall = findSuperCall(constructor.body); @@ -115378,7 +116617,7 @@ var ts; }); function getNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - ts.Debug.assert(token.kind === 124 /* ConstructorKeyword */); + ts.Debug.assert(token.kind === 125 /* ConstructorKeyword */); return token.parent; } function doChange(changes, sourceFile, ctr) { @@ -115394,7 +116633,7 @@ var ts; (function (codefix) { var fixId = "enableExperimentalDecorators"; var errorCodes = [ - ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning.code + 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.code ]; codefix.registerCodeFix({ errorCodes: errorCodes, @@ -115403,12 +116642,19 @@ var ts; if (configFile === undefined) { return undefined; } - var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) { return makeChange(changeTracker, configFile); }); + var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) { return doChange(changeTracker, configFile); }); return [codefix.createCodeFixActionNoFixId(fixId, changes, ts.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; }, fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes) { + var configFile = context.program.getCompilerOptions().configFile; + if (configFile === undefined) { + return undefined; + } + doChange(changes, configFile); + }); }, }); - function makeChange(changeTracker, configFile) { + function doChange(changeTracker, configFile) { codefix.setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", ts.createTrue()); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -115442,14 +116688,14 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var heritageClauses = ts.getContainingClass(token).heritageClauses; var extendsToken = heritageClauses[0].getFirstToken(); - return extendsToken.kind === 86 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; + return extendsToken.kind === 87 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; } function doChanges(changes, sourceFile, extendsToken, heritageClauses) { - changes.replaceNode(sourceFile, extendsToken, ts.createToken(109 /* ImplementsKeyword */)); + changes.replaceNode(sourceFile, extendsToken, ts.createToken(110 /* ImplementsKeyword */)); // If there is already an implements clause, replace the implements keyword with a comma. if (heritageClauses.length === 2 && - heritageClauses[0].token === 86 /* ExtendsKeyword */ && - heritageClauses[1].token === 109 /* ImplementsKeyword */) { + heritageClauses[0].token === 87 /* ExtendsKeyword */ && + heritageClauses[1].token === 110 /* ImplementsKeyword */) { var implementsToken = heritageClauses[1].getFirstToken(); var implementsFullStart = implementsToken.getFullStart(); changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.createToken(27 /* CommaToken */)); @@ -115556,7 +116802,7 @@ var ts; return [createDeleteFix(delVar, ts.Diagnostics.Remove_variable_statement)]; } var result = []; - if (token.kind === 127 /* InferKeyword */) { + if (token.kind === 128 /* InferKeyword */) { var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return changeInferToUnknown(t, sourceFile, token); }); var name = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name.text; result.push(codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, ts.Diagnostics.Replace_all_unused_infer_with_unknown)); @@ -115588,7 +116834,7 @@ var ts; tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { - if (token.kind === 127 /* InferKeyword */) + if (token.kind === 128 /* InferKeyword */) break; // Can't delete var importDecl = tryGetFullImport(token); if (importDecl) { @@ -115607,7 +116853,7 @@ var ts; break; } case fixIdInfer: - if (token.kind === 127 /* InferKeyword */) { + if (token.kind === 128 /* InferKeyword */) { changeInferToUnknown(changes, sourceFile, token); } break; @@ -115618,7 +116864,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(143 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.createKeywordTypeNode(144 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -115628,13 +116874,13 @@ var ts; } // Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing. function tryGetFullImport(token) { - return token.kind === 92 /* ImportKeyword */ ? ts.tryCast(token.parent, ts.isImportDeclaration) : undefined; + return token.kind === 93 /* ImportKeyword */ ? ts.tryCast(token.parent, ts.isImportDeclaration) : undefined; } function tryDeleteFullDestructure(token, changes, sourceFile, checker, sourceFiles, isFixAll) { if (token.kind !== 18 /* OpenBraceToken */ || !ts.isObjectBindingPattern(token.parent)) return false; var decl = token.parent.parent; - if (decl.kind === 151 /* Parameter */) { + if (decl.kind === 152 /* Parameter */) { tryDeleteParameter(changes, sourceFile, decl, checker, sourceFiles, isFixAll); } else { @@ -115645,7 +116891,7 @@ var ts; function tryDeleteFullVariableStatement(sourceFile, token, changes) { var declarationList = ts.tryCast(token.parent, ts.isVariableDeclarationList); if (declarationList && declarationList.getChildren(sourceFile)[0] === token) { - changes.delete(sourceFile, declarationList.parent.kind === 219 /* VariableStatement */ ? declarationList.parent : declarationList); + changes.delete(sourceFile, declarationList.parent.kind === 220 /* VariableStatement */ ? declarationList.parent : declarationList); return true; } return false; @@ -115654,7 +116900,7 @@ var ts; // Don't offer to prefix a property. if (errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; - if (token.kind === 127 /* InferKeyword */) { + if (token.kind === 128 /* InferKeyword */) { token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name; } if (ts.isIdentifier(token) && canPrefix(token)) { @@ -115663,14 +116909,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 151 /* Parameter */: - case 150 /* TypeParameter */: + case 152 /* Parameter */: + case 151 /* TypeParameter */: return true; - case 237 /* VariableDeclaration */: { + case 238 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 227 /* ForOfStatement */: - case 226 /* ForInStatement */: + case 228 /* ForOfStatement */: + case 227 /* ForInStatement */: return true; } } @@ -115717,26 +116963,26 @@ var ts; function mayDeleteParameter(p, checker, isFixAll) { var parent = p.parent; switch (parent.kind) { - case 156 /* MethodDeclaration */: + case 157 /* 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 157 /* Constructor */: - case 239 /* FunctionDeclaration */: + case 158 /* Constructor */: + case 240 /* FunctionDeclaration */: return true; - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: { + case 197 /* FunctionExpression */: + case 198 /* 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. var parameters = parent.parameters; var index = parameters.indexOf(p); ts.Debug.assert(index !== -1); return isFixAll - ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 72 /* Identifier */ && !p.symbol.isReferenced; }) + ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 73 /* Identifier */ && !p.symbol.isReferenced; }) : index === parameters.length - 1; } - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -115776,7 +117022,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 222 /* IfStatement */: + case 223 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -115787,15 +117033,15 @@ var ts; return; } // falls through - case 224 /* WhileStatement */: - case 225 /* ForStatement */: + case 225 /* WhileStatement */: + case 226 /* ForStatement */: changes.delete(sourceFile, container); return; } } if (ts.isBlock(statement.parent)) { - var end_2 = start + length; - var lastStatement = ts.Debug.assertDefined(lastWhere(ts.sliceAfter(statement.parent.statements, statement), function (s) { return s.pos < end_2; })); + var end_3 = start + length; + var lastStatement = ts.Debug.assertDefined(lastWhere(ts.sliceAfter(statement.parent.statements, statement), function (s) { return s.pos < end_3; })); changes.deleteNodeRange(sourceFile, statement, lastStatement); } else { @@ -115861,7 +117107,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 === 291 /* JSDocNullableType */) { + if (typeNode.kind === 292 /* 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)); @@ -115881,7 +117127,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 291 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 292 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -115898,22 +117144,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 212 /* AsExpression */: - case 160 /* CallSignature */: - case 161 /* ConstructSignature */: - case 239 /* FunctionDeclaration */: - case 158 /* GetAccessor */: - case 162 /* IndexSignature */: - case 181 /* MappedType */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 151 /* Parameter */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: - case 159 /* SetAccessor */: - case 242 /* TypeAliasDeclaration */: - case 194 /* TypeAssertionExpression */: - case 237 /* VariableDeclaration */: + case 213 /* AsExpression */: + case 161 /* CallSignature */: + case 162 /* ConstructSignature */: + case 240 /* FunctionDeclaration */: + case 159 /* GetAccessor */: + case 163 /* IndexSignature */: + case 182 /* MappedType */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 152 /* Parameter */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: + case 160 /* SetAccessor */: + case 243 /* TypeAliasDeclaration */: + case 195 /* TypeAssertionExpression */: + case 238 /* VariableDeclaration */: return true; default: return false; @@ -115967,14 +117213,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - insertBefore = ts.findChildOfKind(containingFunction, 90 /* FunctionKeyword */, sourceFile); + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + insertBefore = ts.findChildOfKind(containingFunction, 91 /* FunctionKeyword */, sourceFile); break; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -115989,11 +117235,11 @@ var ts; var insertBefore = _a.insertBefore, returnType = _a.returnType; if (returnType) { var entityName = ts.getEntityNameFromTypeNode(returnType); - if (!entityName || entityName.kind !== 72 /* Identifier */ || entityName.text !== "Promise") { + if (!entityName || entityName.kind !== 73 /* Identifier */ || entityName.text !== "Promise") { changes.replaceNode(sourceFile, returnType, ts.createTypeReferenceNode("Promise", ts.createNodeArray([returnType]))); } } - changes.insertModifierBefore(sourceFile, 121 /* AsyncKeyword */, insertBefore); + changes.insertModifierBefore(sourceFile, 122 /* AsyncKeyword */, insertBefore); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -116102,17 +117348,17 @@ var ts; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 153 /* PropertySignature */: - case 154 /* PropertyDeclaration */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 154 /* PropertySignature */: + case 155 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(56 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 155 /* MethodSignature */: - case 156 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 157 /* 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 @@ -116153,7 +117399,7 @@ var ts; } function signatureToMethodDeclaration(context, signature, enclosingDeclaration, modifiers, name, optional, body) { var program = context.program; - var signatureDeclaration = program.getTypeChecker().signatureToSignatureDeclaration(signature, 156 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = program.getTypeChecker().signatureToSignatureDeclaration(signature, 157 /* MethodDeclaration */, enclosingDeclaration, 1 /* NoTruncation */ | 256 /* SuppressAnyReturnType */, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -116181,7 +117427,7 @@ var ts; var returnType = (inJs || !contextualType) ? undefined : checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker); return ts.createMethod( /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(116 /* StaticKeyword */)] : undefined, + /*modifiers*/ makeStatic ? [ts.createToken(117 /* StaticKeyword */)] : undefined, /*asteriskToken*/ ts.isYieldExpression(parent) ? ts.createToken(40 /* AsteriskToken */) : undefined, methodName, /*questionToken*/ undefined, /*typeParameters*/ inJs ? undefined : ts.map(typeArguments, function (_, i) { @@ -116200,7 +117446,7 @@ var ts; /*dotDotDotToken*/ undefined, /*name*/ names && names[i] || "arg" + i, /*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(56 /* QuestionToken */) : undefined, - /*type*/ inJs ? undefined : types && types[i] || ts.createKeywordTypeNode(120 /* AnyKeyword */), + /*type*/ inJs ? undefined : types && types[i] || ts.createKeywordTypeNode(121 /* AnyKeyword */), /*initializer*/ undefined); parameters.push(newParameter); } @@ -116228,7 +117474,7 @@ var ts; var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; }); var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, /* types */ undefined, minArgumentCount, /*inJs*/ false); if (someSigHasRestParameter) { - var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(120 /* AnyKeyword */)); + var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(121 /* AnyKeyword */)); var restParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createToken(25 /* DotDotDotToken */), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", @@ -116254,10 +117500,10 @@ var ts; } function createVisibilityModifier(flags) { if (flags & 4 /* Public */) { - return ts.createToken(115 /* PublicKeyword */); + return ts.createToken(116 /* PublicKeyword */); } else if (flags & 16 /* Protected */) { - return ts.createToken(114 /* ProtectedKeyword */); + return ts.createToken(115 /* ProtectedKeyword */); } return undefined; } @@ -116329,7 +117575,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 191 /* CallExpression */ : 192 /* NewExpression */; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 192 /* CallExpression */ : 193 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); if (!node) { return []; @@ -116448,7 +117694,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.createKeywordTypeNode(141 /* UndefinedKeyword */); + var undefinedTypeNode = ts.createKeywordTypeNode(142 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types)); @@ -116494,235 +117740,6 @@ var ts; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); -var ts; -(function (ts) { - function generateTypesForModule(name, moduleValue, formatSettings) { - return generateTypesForModuleOrGlobal(name, moduleValue, formatSettings, 0 /* ExportEquals */); - } - ts.generateTypesForModule = generateTypesForModule; - function generateTypesForGlobal(name, globalValue, formatSettings) { - return generateTypesForModuleOrGlobal(name, globalValue, formatSettings, 3 /* Global */); - } - ts.generateTypesForGlobal = generateTypesForGlobal; - function generateTypesForModuleOrGlobal(name, globalValue, formatSettings, outputKind) { - return valueInfoToDeclarationFileText(ts.inspectValue(name, globalValue), formatSettings, outputKind); - } - /* @internal */ - function valueInfoToDeclarationFileText(valueInfo, formatSettings, outputKind) { - if (outputKind === void 0) { outputKind = 0 /* ExportEquals */; } - return ts.textChanges.getNewFileText(toStatements(valueInfo, outputKind), 3 /* TS */, formatSettings.newLineCharacter || "\n", ts.formatting.getFormatContext(formatSettings)); - } - ts.valueInfoToDeclarationFileText = valueInfoToDeclarationFileText; - /* @internal */ - var OutputKind; - (function (OutputKind) { - OutputKind[OutputKind["ExportEquals"] = 0] = "ExportEquals"; - OutputKind[OutputKind["NamedExport"] = 1] = "NamedExport"; - OutputKind[OutputKind["NamespaceMember"] = 2] = "NamespaceMember"; - OutputKind[OutputKind["Global"] = 3] = "Global"; - })(OutputKind || (OutputKind = {})); - function toNamespaceMemberStatements(info) { - return toStatements(info, 2 /* NamespaceMember */); - } - function toStatements(info, kind) { - var isDefault = info.name === "default" /* Default */; - var name = isDefault ? "_default" : info.name; - if (!isValidIdentifier(name) || isDefault && kind !== 1 /* NamedExport */) - return ts.emptyArray; - var modifiers = isDefault && info.kind === 2 /* FunctionOrClass */ ? [ts.createModifier(85 /* ExportKeyword */), ts.createModifier(80 /* DefaultKeyword */)] - : kind === 3 /* Global */ || kind === 0 /* ExportEquals */ ? [ts.createModifier(125 /* DeclareKeyword */)] - : kind === 1 /* NamedExport */ ? [ts.createModifier(85 /* ExportKeyword */)] - : undefined; - var exportEquals = function () { return kind === 0 /* ExportEquals */ ? [exportEqualsOrDefault(info.name, /*isExportEquals*/ true)] : ts.emptyArray; }; - var exportDefault = function () { return isDefault ? [exportEqualsOrDefault("_default", /*isExportEquals*/ false)] : ts.emptyArray; }; - switch (info.kind) { - case 2 /* FunctionOrClass */: - return exportEquals().concat(functionOrClassToStatements(modifiers, name, info)); - case 3 /* Object */: - var members = info.members, hasNontrivialPrototype = info.hasNontrivialPrototype; - if (!hasNontrivialPrototype) { - if (kind === 0 /* ExportEquals */) { - return ts.flatMap(members, function (v) { return toStatements(v, 1 /* NamedExport */); }); - } - if (members.some(function (m) { return m.kind === 2 /* FunctionOrClass */; })) { - // If some member is a function, use a namespace so it gets a FunctionDeclaration or ClassDeclaration. - return exportDefault().concat([createNamespace(modifiers, name, ts.flatMap(members, toNamespaceMemberStatements))]); - } - } - // falls through - case 0 /* Const */: - case 1 /* Array */: { - var comment = info.kind === 0 /* Const */ ? info.comment : undefined; - var constVar = ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, toType(info))], 2 /* Const */)); - return exportEquals().concat(exportDefault(), [addComment(constVar, comment)]); - } - default: - return ts.Debug.assertNever(info); - } - } - function exportEqualsOrDefault(name, isExportEquals) { - return ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.createIdentifier(name)); - } - function functionOrClassToStatements(modifiers, name, _a) { - var source = _a.source, prototypeMembers = _a.prototypeMembers, namespaceMembers = _a.namespaceMembers; - var fnAst = parseClassOrFunctionBody(source); - var _b = fnAst === undefined ? { parameters: ts.emptyArray, returnType: anyType() } : getParametersAndReturnType(fnAst), parameters = _b.parameters, returnType = _b.returnType; - var protoOrInstanceMembers = ts.createMap(); - if (typeof fnAst === "object") - getConstructorFunctionInstanceProperties(fnAst, protoOrInstanceMembers); - for (var _i = 0, prototypeMembers_1 = prototypeMembers; _i < prototypeMembers_1.length; _i++) { - var p = prototypeMembers_1[_i]; - // ignore non-functions on the prototype - if (p.kind === 2 /* FunctionOrClass */) { - var m = tryGetMethod(p); - if (m) { - protoOrInstanceMembers.set(p.name, m); - } - } - } - var classStaticMembers = protoOrInstanceMembers.size !== 0 || fnAst === undefined || typeof fnAst !== "number" && fnAst.kind === 157 /* Constructor */ ? [] : undefined; - var namespaceStatements = ts.flatMap(namespaceMembers, function (info) { - if (!isValidIdentifier(info.name)) - return undefined; - if (classStaticMembers) { - switch (info.kind) { - case 3 /* Object */: - if (info.members.some(function (m) { return m.kind === 2 /* FunctionOrClass */; })) { - break; - } - // falls through - case 1 /* Array */: - case 0 /* Const */: - classStaticMembers.push(addComment(ts.createProperty(/*decorators*/ undefined, [ts.createModifier(116 /* StaticKeyword */)], info.name, /*questionOrExclamationToken*/ undefined, toType(info), /*initializer*/ undefined), info.kind === 0 /* Const */ ? info.comment : undefined)); - return undefined; - case 2 /* FunctionOrClass */: - if (!info.namespaceMembers.length) { // Else, can't merge a static method with a namespace. Must make it a function on the namespace. - var sig = tryGetMethod(info, [ts.createModifier(116 /* StaticKeyword */)]); - if (sig) { - classStaticMembers.push(sig); - return undefined; - } - } - break; - default: - ts.Debug.assertNever(info); - } - } - return toStatements(info, 2 /* NamespaceMember */); - }); - var decl = classStaticMembers - ? ts.createClassDeclaration( - /*decorators*/ undefined, modifiers, name, - /*typeParameters*/ undefined, - /*heritageClauses*/ undefined, classStaticMembers.concat((parameters.length ? [ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, parameters, /*body*/ undefined)] : ts.emptyArray), ts.arrayFrom(protoOrInstanceMembers.values()))) - : ts.createFunctionDeclaration(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, name, /*typeParameters*/ undefined, parameters, returnType, /*body*/ undefined); - return [decl].concat((namespaceStatements.length === 0 ? ts.emptyArray : [createNamespace(modifiers && modifiers.map(function (m) { return ts.getSynthesizedDeepClone(m); }), name, namespaceStatements)])); - } - function tryGetMethod(_a, modifiers) { - var name = _a.name, source = _a.source; - if (!isValidIdentifier(name)) - return undefined; - var fnAst = parseClassOrFunctionBody(source); - if (fnAst === undefined || (typeof fnAst !== "number" && fnAst.kind === 157 /* Constructor */)) - return undefined; - var sig = getParametersAndReturnType(fnAst); - return sig && ts.createMethod( - /*decorators*/ undefined, modifiers, - /*asteriskToken*/ undefined, name, - /*questionToken*/ undefined, - /*typeParameters*/ undefined, sig.parameters, sig.returnType, - /*body*/ undefined); - } - function toType(info) { - switch (info.kind) { - case 0 /* Const */: - return ts.createTypeReferenceNode(info.typeName, /*typeArguments*/ undefined); - case 1 /* Array */: - return ts.createArrayTypeNode(toType(info.inner)); - case 2 /* FunctionOrClass */: - return ts.createTypeReferenceNode("Function", /*typeArguments*/ undefined); // Normally we create a FunctionDeclaration, but this can happen for a function in an array. - case 3 /* Object */: - return ts.createTypeLiteralNode(info.members.map(function (m) { return ts.createPropertySignature(/*modifiers*/ undefined, toPropertyName(m.name), /*questionToken*/ undefined, toType(m), /*initializer*/ undefined); })); - default: - return ts.Debug.assertNever(info); - } - } - function toPropertyName(name) { - return ts.isIdentifierText(name, 7 /* ESNext */) ? ts.createIdentifier(name) : ts.createStringLiteral(name); - } - // Parses assignments to "this.x" in the constructor into class property declarations - function getConstructorFunctionInstanceProperties(fnAst, members) { - forEachOwnNodeOfFunction(fnAst, function (node) { - if (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && - ts.isPropertyAccessExpression(node.left) && node.left.expression.kind === 100 /* ThisKeyword */) { - var name_4 = node.left.name.text; - if (!ts.isJsPrivate(name_4)) { - ts.getOrUpdate(members, name_4, function () { return ts.createProperty(/*decorators*/ undefined, /*modifiers*/ undefined, name_4, /*questionOrExclamationToken*/ undefined, anyType(), /*initializer*/ undefined); }); - } - } - }); - } - function getParametersAndReturnType(fnAst) { - if (typeof fnAst === "number") { - return { parameters: ts.fill(fnAst, function (i) { return makeParameter("p" + i, anyType()); }), returnType: anyType() }; - } - var usedArguments = false, hasReturn = false; - forEachOwnNodeOfFunction(fnAst, function (node) { - usedArguments = usedArguments || ts.isIdentifier(node) && node.text === "arguments"; - hasReturn = hasReturn || ts.isReturnStatement(node) && !!node.expression && node.expression.kind !== 200 /* VoidExpression */; - }); - var parameters = fnAst.parameters.map(function (p) { return makeParameter("" + p.name.getText(), inferParameterType(fnAst, p)); }).concat((usedArguments ? [makeRestParameter()] : ts.emptyArray)); - return { parameters: parameters, returnType: hasReturn ? anyType() : ts.createKeywordTypeNode(106 /* VoidKeyword */) }; - } - function makeParameter(name, type) { - return ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name, /*questionToken*/ undefined, type); - } - function makeRestParameter() { - return ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createToken(25 /* DotDotDotToken */), "args", /*questionToken*/ undefined, ts.createArrayTypeNode(anyType())); - } - /** Returns 'undefined' for class with no declared constructor */ - function parseClassOrFunctionBody(source) { - if (typeof source === "number") - return source; - var classOrFunction = ts.tryCast(parseExpression(source), function (node) { return ts.isFunctionExpression(node) || ts.isArrowFunction(node) || ts.isClassExpression(node); }); - return classOrFunction - ? ts.isClassExpression(classOrFunction) ? ts.find(classOrFunction.members, ts.isConstructorDeclaration) : classOrFunction - // If that didn't parse, it's a method `m() {}`. Parse again inside of an object literal. - : ts.cast(ts.first(ts.cast(parseExpression("{ " + source + " }"), ts.isObjectLiteralExpression).properties), ts.isMethodDeclaration); - } - function parseExpression(expr) { - var text = "const _ = " + expr; - var srcFile = ts.createSourceFile("test.ts", text, 7 /* Latest */, /*setParentNodes*/ true); - return ts.first(ts.cast(ts.first(srcFile.statements), ts.isVariableStatement).declarationList.declarations).initializer; - } - function inferParameterType(_fn, _param) { - // TODO: Inspect function body for clues (see inferFromUsage.ts) - return anyType(); - } - // Descends through all nodes in a function, but not in nested functions. - function forEachOwnNodeOfFunction(fnAst, cb) { - fnAst.body.forEachChild(function recur(node) { - cb(node); - if (!ts.isFunctionLike(node)) - node.forEachChild(recur); - }); - } - function isValidIdentifier(name) { - var keyword = ts.stringToToken(name); - return !(keyword && ts.isNonContextualKeyword(keyword)) && ts.isIdentifierText(name, 7 /* ESNext */); - } - function addComment(node, comment) { - if (comment !== undefined) - ts.addSyntheticLeadingComment(node, 2 /* SingleLineCommentTrivia */, comment); - return node; - } - function anyType() { - return ts.createKeywordTypeNode(120 /* AnyKeyword */); - } - function createNamespace(modifiers, name, statements) { - return ts.createModuleDeclaration(/*decorators*/ undefined, modifiers, ts.createIdentifier(name), ts.createModuleBlock(statements), 16 /* Namespace */); - } -})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -116819,8 +117836,8 @@ var ts; }); function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - ts.Debug.assert(token.kind === 92 /* ImportKeyword */); - ts.Debug.assert(token.parent.kind === 183 /* ImportType */); + ts.Debug.assert(token.kind === 93 /* ImportKeyword */); + ts.Debug.assert(token.parent.kind === 184 /* ImportType */); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -116872,7 +117889,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(133 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.createMappedTypeNode(ts.hasReadonlyModifier(indexSignature) ? ts.createModifier(134 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([ mappedIntersectionType ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -116919,16 +117936,16 @@ var ts; return undefined; } switch (exportNode.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 244 /* ModuleDeclaration */: { + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 245 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } : undefined; } - case 219 /* VariableStatement */: { + case 220 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -116951,17 +117968,17 @@ var ts; function changeExport(exportingSourceFile, _a, changes, checker) { var wasDefault = _a.wasDefault, exportNode = _a.exportNode, exportName = _a.exportName; if (wasDefault) { - changes.delete(exportingSourceFile, ts.Debug.assertDefined(ts.findModifier(exportNode, 80 /* DefaultKeyword */))); + changes.delete(exportingSourceFile, ts.Debug.assertDefined(ts.findModifier(exportNode, 81 /* DefaultKeyword */))); } else { - var exportKeyword = ts.Debug.assertDefined(ts.findModifier(exportNode, 85 /* ExportKeyword */)); + var exportKeyword = ts.Debug.assertDefined(ts.findModifier(exportNode, 86 /* ExportKeyword */)); switch (exportNode.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 241 /* InterfaceDeclaration */: - changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(80 /* DefaultKeyword */)); + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 242 /* InterfaceDeclaration */: + changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.createToken(81 /* DefaultKeyword */)); break; - case 219 /* VariableStatement */: + case 220 /* 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. @@ -116969,9 +117986,9 @@ var ts; break; } // falls through - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 244 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 245 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.createExportDefault(ts.createIdentifier(exportName.text))); @@ -116998,18 +118015,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier(exportName)); break; - case 253 /* ImportSpecifier */: - case 257 /* ExportSpecifier */: { + case 254 /* ImportSpecifier */: + case 258 /* 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 250 /* ImportClause */: { + case 251 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref); var spec = makeImportSpecifier(exportName, ref.text); @@ -117018,7 +118035,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.createNamedImports([spec])); } - else if (namedBindings.kind === 251 /* NamespaceImport */) { + else if (namedBindings.kind === 252 /* 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 */; @@ -117039,11 +118056,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.createIdentifier("default")); break; - case 253 /* ImportSpecifier */: { + case 254 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.createIdentifier(parent.name.text); @@ -117056,7 +118073,7 @@ var ts; } break; } - case 257 /* ExportSpecifier */: { + case 258 /* 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";` @@ -117089,8 +118106,8 @@ var ts; var i = getImportToConvert(context); if (!i) return ts.emptyArray; - var description = i.kind === 251 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.kind === 251 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.kind === 252 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.kind === 252 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; }, getEditsForAction: function (context, actionName) { @@ -117112,7 +118129,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 251 /* NamespaceImport */) { + if (toConvert.kind === 252 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -117164,7 +118181,7 @@ var ts; function doChangeNamedToNamespace(sourceFile, checker, changes, toConvert) { var importDecl = toConvert.parent.parent; var moduleSpecifier = importDecl.moduleSpecifier; - var preferredName = moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, 7 /* ESNext */) : "module"; + var preferredName = moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, 8 /* ESNext */) : "module"; var namespaceNameConflicts = toConvert.elements.some(function (element) { return ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) { return !!checker.resolveName(preferredName, id, 67108863 /* All */, /*excludeGlobals*/ true); @@ -117455,20 +118472,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 154 /* PropertyDeclaration */) { + if (current.kind === 155 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 151 /* Parameter */) { + else if (current.kind === 152 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 157 /* Constructor */) { + if (ctorOrMethod.kind === 158 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 156 /* MethodDeclaration */) { + else if (current.kind === 157 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -117511,7 +118528,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 237 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 238 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(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`! @@ -117523,13 +118540,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; - case 98 /* SuperKeyword */: + case 99 /* 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 === 191 /* CallExpression */) { + if (node.parent.kind === 192 /* 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)) { @@ -117544,8 +118561,8 @@ var ts; } if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); @@ -117557,20 +118574,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 222 /* IfStatement */: + case 223 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 235 /* TryStatement */: + case 236 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 218 /* Block */: - if (node.parent && node.parent.kind === 235 /* TryStatement */ && node.parent.finallyBlock === node) { + case 219 /* Block */: + if (node.parent && node.parent.kind === 236 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 271 /* CaseClause */: + case 272 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -117582,19 +118599,19 @@ var ts; break; } switch (node.kind) { - case 178 /* ThisType */: - case 100 /* ThisKeyword */: + case 179 /* ThisType */: + case 101 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 233 /* LabeledStatement */: { + case 234 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: { + case 230 /* BreakStatement */: + case 229 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -117603,20 +118620,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 229 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 230 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 201 /* AwaitExpression */: + case 202 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 207 /* YieldExpression */: + case 208 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -117670,7 +118687,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 === 151 /* Parameter */) { + if (current.kind === 152 /* 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; } @@ -117681,7 +118698,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 284 /* SourceFile */) { + if (current.kind === 285 /* SourceFile */) { return scopes; } } @@ -117771,32 +118788,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 157 /* Constructor */: + case 158 /* Constructor */: return "constructor"; - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return "arrow function"; - case 156 /* MethodDeclaration */: + case 157 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 158 /* GetAccessor */: + case 159 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 159 /* SetAccessor */: + case 160 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 240 /* ClassDeclaration */ + return scope.kind === 241 /* 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 === 245 /* ModuleBlock */ + return scope.kind === 246 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -117862,12 +118879,12 @@ var ts; var newFunction; if (ts.isClassLike(scope)) { // always create private method in TypeScript files - var modifiers = isJS ? [] : [ts.createToken(113 /* PrivateKeyword */)]; + var modifiers = isJS ? [] : [ts.createToken(114 /* PrivateKeyword */)]; if (range.facts & RangeFacts.InStaticRegion) { - modifiers.push(ts.createToken(116 /* StaticKeyword */)); + modifiers.push(ts.createToken(117 /* StaticKeyword */)); } if (range.facts & RangeFacts.IsAsyncFunction) { - modifiers.push(ts.createToken(121 /* AsyncKeyword */)); + modifiers.push(ts.createToken(122 /* AsyncKeyword */)); } newFunction = ts.createMethod( /*decorators*/ undefined, modifiers.length ? modifiers : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(40 /* AsteriskToken */) : undefined, functionName, @@ -117875,7 +118892,7 @@ var ts; } else { newFunction = ts.createFunctionDeclaration( - /*decorators*/ undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(121 /* AsyncKeyword */)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(40 /* AsteriskToken */) : undefined, functionName, typeParameters, parameters, returnType, body); + /*decorators*/ undefined, range.facts & RangeFacts.IsAsyncFunction ? [ts.createToken(122 /* AsyncKeyword */)] : undefined, range.facts & RangeFacts.IsGenerator ? ts.createToken(40 /* AsteriskToken */) : undefined, functionName, typeParameters, parameters, returnType, body); } var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end; @@ -118016,9 +119033,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 141 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 142 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(141 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(142 /* UndefinedKeyword */)]); } } /** @@ -118041,11 +119058,11 @@ var ts; if (ts.isClassLike(scope)) { ts.Debug.assert(!isJS); // See CannotExtractToJSClass var modifiers = []; - modifiers.push(ts.createToken(113 /* PrivateKeyword */)); + modifiers.push(ts.createToken(114 /* PrivateKeyword */)); if (rangeFacts & RangeFacts.InStaticRegion) { - modifiers.push(ts.createToken(116 /* StaticKeyword */)); + modifiers.push(ts.createToken(117 /* StaticKeyword */)); } - modifiers.push(ts.createToken(133 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(134 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -118074,7 +119091,7 @@ var ts; var localReference = ts.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 221 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 222 /* 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.createVariableStatement( @@ -118093,7 +119110,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 221 /* ExpressionStatement */) { + if (node.parent.kind === 222 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -118180,7 +119197,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 230 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 231 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -118358,7 +119375,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 239 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 240 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -118674,30 +119691,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 278 /* EnumMember */: + case 279 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 249 /* ImportDeclaration */ && - parent.kind !== 253 /* ImportSpecifier */; - case 208 /* SpreadElement */: - case 184 /* ObjectBindingPattern */: - case 186 /* BindingElement */: + return parent.kind !== 250 /* ImportDeclaration */ && + parent.kind !== 254 /* ImportSpecifier */; + case 209 /* SpreadElement */: + case 185 /* ObjectBindingPattern */: + case 187 /* BindingElement */: return false; - case 72 /* Identifier */: - return parent.kind !== 186 /* BindingElement */ && - parent.kind !== 253 /* ImportSpecifier */ && - parent.kind !== 257 /* ExportSpecifier */; + case 73 /* Identifier */: + return parent.kind !== 187 /* BindingElement */ && + parent.kind !== 254 /* ImportSpecifier */ && + parent.kind !== 258 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 218 /* Block */: - case 284 /* SourceFile */: - case 245 /* ModuleBlock */: - case 271 /* CaseClause */: + case 219 /* Block */: + case 285 /* SourceFile */: + case 246 /* ModuleBlock */: + case 272 /* CaseClause */: return true; default: return false; @@ -118708,6 +119725,136 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var refactor; + (function (refactor) { + var refactorName = "Extract type"; + var extractToTypeAlias = "Extract to type alias"; + var extractToTypeDef = "Extract to typedef"; + refactor.registerRefactor(refactorName, { + getAvailableActions: function (context) { + var info = getRangeToExtract(context); + if (!info) + return ts.emptyArray; + return [{ + name: refactorName, + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_type), + actions: [info.isJS ? { + name: extractToTypeDef, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_typedef) + } : { + name: extractToTypeAlias, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_to_type_alias) + }] + }]; + }, + getEditsForAction: function (context, actionName) { + ts.Debug.assert(actionName === extractToTypeAlias || actionName === extractToTypeDef); + var file = context.file; + var info = ts.Debug.assertDefined(getRangeToExtract(context)); + ts.Debug.assert(actionName === extractToTypeAlias && !info.isJS || actionName === extractToTypeDef && info.isJS); + var name = ts.getUniqueName("NewType", file); + var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { return info.isJS ? + doTypedefChange(changes, file, name, info.firstStatement, info.selection, info.typeParameters) : + doTypeAliasChange(changes, file, name, info.firstStatement, info.selection, info.typeParameters); }); + var renameFilename = file.fileName; + var renameLocation = ts.getRenameLocation(edits, renameFilename, name, /*preferLastLocation*/ false); + return { edits: edits, renameFilename: renameFilename, renameLocation: renameLocation }; + } + }); + function getRangeToExtract(context) { + var file = context.file, startPosition = context.startPosition; + var isJS = ts.isSourceFileJS(file); + var current = ts.getTokenAtPosition(file, startPosition); + var range = ts.createTextRangeFromSpan(ts.getRefactorContextSpan(context)); + var selection = ts.findAncestor(current, (function (node) { return node.parent && rangeContainsSkipTrivia(range, node, file) && !rangeContainsSkipTrivia(range, node.parent, file); })); + if (!selection || !ts.isTypeNode(selection)) + return undefined; + var checker = context.program.getTypeChecker(); + var firstStatement = ts.Debug.assertDefined(isJS ? ts.findAncestor(selection, isStatementAndHasJSDoc) : ts.findAncestor(selection, ts.isStatement)); + var typeParameters = collectTypeParameters(checker, selection, firstStatement, file); + if (!typeParameters) + return undefined; + return { isJS: isJS, selection: selection, firstStatement: firstStatement, typeParameters: typeParameters }; + } + function isStatementAndHasJSDoc(n) { + return ts.isStatement(n) && ts.hasJSDocNodes(n); + } + function rangeContainsSkipTrivia(r1, node, file) { + return ts.rangeContainsStartEnd(r1, ts.skipTrivia(file.text, node.pos), node.end); + } + function collectTypeParameters(checker, selection, statement, file) { + var result = []; + return visitor(selection) ? undefined : result; + function visitor(node) { + if (ts.isTypeReferenceNode(node)) { + if (ts.isIdentifier(node.typeName)) { + var symbol = checker.resolveName(node.typeName.text, node.typeName, 262144 /* TypeParameter */, /* excludeGlobals */ true); + if (symbol) { + var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration); + if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) { + result.push(declaration); + } + } + } + } + else if (ts.isInferTypeNode(node)) { + var conditionalTypeNode = ts.findAncestor(node, function (n) { return ts.isConditionalTypeNode(n) && rangeContainsSkipTrivia(n.extendsType, node, file); }); + if (!conditionalTypeNode || !rangeContainsSkipTrivia(selection, conditionalTypeNode, file)) { + return true; + } + } + else if ((ts.isTypePredicateNode(node) || ts.isThisTypeNode(node))) { + var functionLikeNode = ts.findAncestor(node.parent, ts.isFunctionLike); + if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selection, functionLikeNode, file)) { + return true; + } + } + else if (ts.isTypeQueryNode(node)) { + if (ts.isIdentifier(node.exprName)) { + var symbol = checker.resolveName(node.exprName.text, node.exprName, 67220415 /* Value */, /* excludeGlobals */ false); + if (symbol && rangeContainsSkipTrivia(statement, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selection, symbol.valueDeclaration, file)) { + return true; + } + } + else { + if (ts.isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selection, node.parent, file)) { + return true; + } + } + } + return ts.forEachChild(node, visitor); + } + } + function doTypeAliasChange(changes, file, name, firstStatement, selection, typeParameters) { + var newTypeNode = ts.createTypeAliasDeclaration( + /* decorators */ undefined, + /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection); + changes.insertNodeBefore(file, firstStatement, newTypeNode, /* blankLineBetween */ true); + changes.replaceNode(file, selection, ts.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); + } + function doTypedefChange(changes, file, name, firstStatement, selection, typeParameters) { + var node = ts.createNode(310 /* JSDocTypedefTag */); + node.tagName = ts.createIdentifier("typedef"); // TODO: jsdoc factory https://github.com/Microsoft/TypeScript/pull/29539 + node.fullName = ts.createIdentifier(name); + node.name = node.fullName; + node.typeExpression = ts.createJSDocTypeExpression(selection); + var templates = []; + ts.forEach(typeParameters, function (typeParameter) { + var constraint = ts.getEffectiveConstraintOfTypeParameter(typeParameter); + var template = ts.createNode(309 /* JSDocTemplateTag */); + template.tagName = ts.createIdentifier("template"); + template.constraint = constraint && ts.cast(constraint, ts.isJSDocTypeExpression); + var parameter = ts.createNode(151 /* TypeParameter */); + parameter.name = typeParameter.name; + template.typeParameters = ts.createNodeArray([parameter]); + templates.push(template); + }); + changes.insertNodeBefore(file, firstStatement, ts.createJSDocComment(/* comment */ undefined, ts.createNodeArray(ts.concatenate(templates, [node]))), /* blankLineBetween */ true); + changes.replaceNode(file, selection, ts.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); + } + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var refactor; (function (refactor) { @@ -118746,10 +119893,10 @@ var ts; var modifierFlags = ts.getModifierFlags(declaration) & ~64 /* Readonly */; var accessorModifiers = isInClassLike ? !modifierFlags || modifierFlags & 8 /* Private */ - ? getModifiers(isJS, isStatic, 115 /* PublicKeyword */) + ? getModifiers(isJS, isStatic, 116 /* PublicKeyword */) : ts.createNodeArray(ts.createModifiersFromModifierFlags(modifierFlags)) : undefined; - var fieldModifiers = isInClassLike ? getModifiers(isJS, isStatic, 113 /* PrivateKeyword */) : undefined; + var fieldModifiers = isInClassLike ? getModifiers(isJS, isStatic, 114 /* PrivateKeyword */) : undefined; updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container); ts.suppressLeadingAndTrailingTrivia(getAccessor); @@ -118787,7 +119934,7 @@ var ts; return ts.isIdentifier(fieldName) ? ts.createPropertyAccess(leftHead, fieldName) : ts.createElementAccess(leftHead, ts.createLiteral(fieldName)); } function getModifiers(isJS, isStatic, accessModifier) { - var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(116 /* StaticKeyword */) : undefined); + var modifiers = ts.append(!isJS ? [ts.createToken(accessModifier)] : undefined, isStatic ? ts.createToken(117 /* StaticKeyword */) : undefined); return modifiers && ts.createNodeArray(modifiers); } function startsWithUnderscore(name) { @@ -118810,7 +119957,7 @@ var ts; isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), - container: declaration.kind === 151 /* Parameter */ ? declaration.parent.parent : declaration.parent, + container: declaration.kind === 152 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -118867,13 +120014,13 @@ var ts; return; constructor.body.forEachChild(function recur(node) { if (ts.isElementAccessExpression(node) && - node.expression.kind === 100 /* ThisKeyword */ && + node.expression.kind === 101 /* ThisKeyword */ && ts.isStringLiteral(node.argumentExpression) && node.argumentExpression.text === originalName && ts.isWriteAccess(node)) { changeTracker.replaceNode(file, node.argumentExpression, ts.createStringLiteral(fieldName)); } - if (ts.isPropertyAccessExpression(node) && node.expression.kind === 100 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { + if (ts.isPropertyAccessExpression(node) && node.expression.kind === 101 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { changeTracker.replaceNode(file, node.name, ts.createIdentifier(fieldName)); } if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { @@ -118955,11 +120102,11 @@ var ts; } function isPureImport(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return true; - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return !ts.hasModifier(node, 1 /* Export */); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -119047,19 +120194,19 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 249 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 251 /* NamespaceImport */ ? + case 250 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 252 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return node.name; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node); } } function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) { - var preferredNewNamespaceName = ts.codefix.moduleSpecifierToValidIdentifier(newModuleName, 7 /* ESNext */); + var preferredNewNamespaceName = ts.codefix.moduleSpecifierToValidIdentifier(newModuleName, 8 /* ESNext */); var needUniqueName = false; var toChange = []; ts.FindAllReferences.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, function (ref) { @@ -119083,20 +120230,20 @@ var ts; var newNamespaceId = ts.createIdentifier(newNamespaceName); var newModuleString = ts.createLiteral(newModuleSpecifier); switch (node.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: return ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return ts.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString)); - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return ts.createVariableDeclaration(newNamespaceId, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node); } } function moduleSpecifierFromImport(i) { - return (i.kind === 249 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 248 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 250 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 249 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -119166,15 +120313,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -119187,7 +120334,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 251 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 252 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -119199,7 +120346,7 @@ var ts; if (namedBindingsUnused) { changes.delete(sourceFile, namedBindings); } - else if (namedBindings.kind === 252 /* NamedImports */) { + else if (namedBindings.kind === 253 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -119212,14 +120359,14 @@ var ts; function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes, isUnused) { var name = varDecl.name; switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: if (isUnused(name)) { changes.delete(sourceFile, name); } break; - case 185 /* ArrayBindingPattern */: + case 186 /* ArrayBindingPattern */: break; - case 184 /* ObjectBindingPattern */: + case 185 /* 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); } @@ -119346,13 +120493,13 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 248 /* ImportEqualsDeclaration */: - case 253 /* ImportSpecifier */: - case 250 /* ImportClause */: + case 249 /* ImportEqualsDeclaration */: + case 254 /* ImportSpecifier */: + case 251 /* ImportClause */: return true; - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 186 /* BindingElement */: + case 187 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -119364,7 +120511,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 249 /* ImportDeclaration */: { + case 250 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -119374,9 +120521,9 @@ var ts; ? ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 237 /* VariableDeclaration */: { + case 238 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -119385,7 +120532,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 251 /* NamespaceImport */) { + if (namedBindings.kind === 252 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -119395,11 +120542,11 @@ var ts; } function filterBindingName(name, keep) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return keep(name) ? name : undefined; - case 185 /* ArrayBindingPattern */: + case 186 /* ArrayBindingPattern */: return name; - case 184 /* ObjectBindingPattern */: { + case 185 /* 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.createObjectBindingPattern(newElements) : undefined; @@ -119456,13 +120603,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 241 /* InterfaceDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 249 /* ImportEqualsDeclaration */: return true; default: return false; @@ -119470,17 +120617,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 241 /* InterfaceDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 249 /* ImportEqualsDeclaration */: return cb(statement); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 221 /* ExpressionStatement */: { + case 222 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -119490,10 +120637,10 @@ var ts; } function forEachTopLevelDeclarationInBindingName(name, cb) { switch (name.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 185 /* ArrayBindingPattern */: - case 184 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name); @@ -119504,9 +120651,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 237 /* VariableDeclaration */: + case 238 /* VariableDeclaration */: return d.parent.parent; - case 186 /* BindingElement */: + case 187 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -119537,25 +120684,25 @@ var ts; return useEs6Exports ? [addEs6Export(decl)] : addCommonjsExport(decl); } function addEs6Export(d) { - var modifiers = ts.concatenate([ts.createModifier(85 /* ExportKeyword */)], d.modifiers); + var modifiers = ts.concatenate([ts.createModifier(86 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 239 /* FunctionDeclaration */: + case 240 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return ts.updateVariableStatement(d, modifiers, d.declarationList); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 242 /* TypeAliasDeclaration */: + case 243 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 241 /* InterfaceDeclaration */: + case 242 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d); @@ -119566,18 +120713,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 239 /* FunctionDeclaration */: - case 240 /* ClassDeclaration */: + case 240 /* FunctionDeclaration */: + case 241 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 244 /* ModuleDeclaration */: - case 243 /* EnumDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 241 /* InterfaceDeclaration */: - case 248 /* ImportEqualsDeclaration */: + case 245 /* ModuleDeclaration */: + case 244 /* EnumDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 249 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl); @@ -119585,7 +120732,7 @@ var ts; } /** Creates `exports.x = x;` */ function createExportAssignment(name) { - return ts.createExpressionStatement(ts.createBinary(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.createIdentifier(name)), 59 /* EqualsToken */, ts.createIdentifier(name))); + return ts.createExpressionStatement(ts.createBinary(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.createIdentifier(name)), 60 /* EqualsToken */, ts.createIdentifier(name))); } })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); @@ -119751,8 +120898,8 @@ var ts; function groupReferences(referenceEntries) { var classReferences = { accessExpressions: [], typeUsages: [] }; var groupedReferences = { functionCalls: [], declarations: [], classReferences: classReferences, valid: true }; - var functionSymbols = ts.map(functionNames, checker.getSymbolAtLocation); - var classSymbols = ts.map(classNames, checker.getSymbolAtLocation); + var functionSymbols = ts.map(functionNames, getSymbolTargetAtLocation); + var classSymbols = ts.map(classNames, getSymbolTargetAtLocation); var isConstructor = ts.isConstructorDeclaration(functionDeclaration); for (var _i = 0, referenceEntries_1 = referenceEntries; _i < referenceEntries_1.length; _i++) { var entry = referenceEntries_1[_i]; @@ -119771,7 +120918,11 @@ var ts; So we need to add a special case for this because when calling a constructor of a class through one of its subclasses, the symbols are going to be different. */ - if (ts.contains(functionSymbols, checker.getSymbolAtLocation(entry.node), symbolComparer) || ts.isNewExpressionTarget(entry.node)) { + if (ts.contains(functionSymbols, getSymbolTargetAtLocation(entry.node)) || ts.isNewExpressionTarget(entry.node)) { + var importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } var decl = entryToDeclaration(entry); if (decl) { groupedReferences.declarations.push(decl); @@ -119784,7 +120935,11 @@ var ts; } } // if the refactored function is a constructor, we must also check if the references to its class are valid - if (isConstructor && ts.contains(classSymbols, checker.getSymbolAtLocation(entry.node), symbolComparer)) { + if (isConstructor && ts.contains(classSymbols, getSymbolTargetAtLocation(entry.node))) { + var importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } var decl = entryToDeclaration(entry); if (decl) { groupedReferences.declarations.push(decl); @@ -119809,9 +120964,23 @@ var ts; } return groupedReferences; } + function getSymbolTargetAtLocation(node) { + var symbol = checker.getSymbolAtLocation(node); + return symbol && ts.getSymbolTarget(symbol, checker); + } } - function symbolComparer(a, b) { - return ts.getSymbolTarget(a) === ts.getSymbolTarget(b); + function entryToImportOrExport(entry) { + var node = entry.node; + if (ts.isImportSpecifier(node.parent) + || ts.isImportClause(node.parent) + || ts.isImportEqualsDeclaration(node.parent) + || ts.isNamespaceImport(node.parent)) { + return node; + } + if (ts.isExportSpecifier(node.parent) || ts.isExportAssignment(node.parent)) { + return node; + } + return undefined; } function entryToDeclaration(entry) { if (ts.isDeclaration(entry.node.parent)) { @@ -119824,37 +120993,31 @@ var ts; var functionReference = entry.node; var parent = functionReference.parent; switch (parent.kind) { - // Function call (foo(...) or super(...)) - case 191 /* CallExpression */: - var callExpression = ts.tryCast(parent, ts.isCallExpression); - if (callExpression && callExpression.expression === functionReference) { - return callExpression; - } - break; - // Constructor call (new Foo(...)) - case 192 /* NewExpression */: - var newExpression = ts.tryCast(parent, ts.isNewExpression); - if (newExpression && newExpression.expression === functionReference) { - return newExpression; + // foo(...) or super(...) or new Foo(...) + case 192 /* CallExpression */: + case 193 /* NewExpression */: + var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); + if (callOrNewExpression && callOrNewExpression.expression === functionReference) { + return callOrNewExpression; } break; - // Method call (x.foo(...)) - case 189 /* PropertyAccessExpression */: + // x.foo(...) + case 190 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { - var callExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallExpression); - if (callExpression_1 && callExpression_1.expression === propertyAccessExpression) { - return callExpression_1; + var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); + if (callOrNewExpression_1 && callOrNewExpression_1.expression === propertyAccessExpression) { + return callOrNewExpression_1; } } break; - // Method call (x["foo"](...)) - case 190 /* ElementAccessExpression */: + // x["foo"](...) + case 191 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { - var callExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallExpression); - if (callExpression_2 && callExpression_2.expression === elementAccessExpression) { - return callExpression_2; + var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); + if (callOrNewExpression_2 && callOrNewExpression_2.expression === elementAccessExpression) { + return callOrNewExpression_2; } } break; @@ -119868,14 +121031,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 189 /* PropertyAccessExpression */: + case 190 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 190 /* ElementAccessExpression */: + case 191 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -119894,7 +121057,7 @@ var ts; } function getFunctionDeclarationAtPosition(file, startPosition, checker) { var node = ts.getTouchingToken(file, startPosition); - var functionDeclaration = ts.getContainingFunction(node); + var functionDeclaration = ts.getContainingFunctionDeclaration(node); // don't offer refactor on top-level JSDoc if (isTopLevelJSDoc(node)) return undefined; @@ -119917,28 +121080,34 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - return !!functionDeclaration.name - && !!functionDeclaration.body - && !checker.isImplementationOfOverload(functionDeclaration); - case 157 /* Constructor */: + case 240 /* FunctionDeclaration */: + return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); + case 157 /* MethodDeclaration */: + return isSingleImplementation(functionDeclaration, checker); + case 158 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { - return !!functionDeclaration.body - && !!functionDeclaration.parent.name - && !checker.isImplementationOfOverload(functionDeclaration); + return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } else { return isValidVariableDeclaration(functionDeclaration.parent.parent) - && !!functionDeclaration.body - && !checker.isImplementationOfOverload(functionDeclaration); + && isSingleImplementation(functionDeclaration, checker); } - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; } + function isSingleImplementation(functionDeclaration, checker) { + return !!functionDeclaration.body && !checker.isImplementationOfOverload(functionDeclaration); + } + function hasNameOrDefault(functionOrClassDeclaration) { + if (!functionOrClassDeclaration.name) { + var defaultKeyword = ts.findModifier(functionOrClassDeclaration, 81 /* DefaultKeyword */); + return !!defaultKeyword; + } + return true; + } function isValidParameterNodeArray(parameters, checker) { return getRefactorableParametersLength(parameters) >= minimumParameterLength && ts.every(parameters, /*callback*/ function (/*callback*/ paramDecl) { return isValidParameterDeclaration(paramDecl, checker); }); @@ -120095,10 +121264,15 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; - return [classDeclaration.name]; - case 209 /* ClassExpression */: + if (classDeclaration.name) + return [classDeclaration.name]; + // If the class declaration doesn't have a name, it should have a default modifier. + // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` + var defaultModifier = ts.Debug.assertDefined(ts.findModifier(classDeclaration, 81 /* DefaultKeyword */), "Nameless class declaration should be a default export"); + return [defaultModifier]; + case 210 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -120109,19 +121283,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: + case 240 /* 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.assertDefined(ts.findModifier(functionDeclaration, 81 /* DefaultKeyword */), "Nameless function declaration should be a default export"); + return [defaultModifier]; + case 157 /* MethodDeclaration */: return [functionDeclaration.name]; - case 157 /* Constructor */: - var ctrKeyword = ts.findChildOfKind(functionDeclaration, 124 /* ConstructorKeyword */, functionDeclaration.getSourceFile()); - if (functionDeclaration.parent.kind === 209 /* ClassExpression */) { + case 158 /* Constructor */: + var ctrKeyword = ts.Debug.assertDefined(ts.findChildOfKind(functionDeclaration, 125 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 210 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 196 /* FunctionExpression */: + case 197 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -120138,7 +121318,7 @@ var ts; ts.servicesVersion = "0.8"; function createNode(kind, pos, end, parent) { var node = ts.isNodeKind(kind) ? new NodeObject(kind, pos, end) : - kind === 72 /* Identifier */ ? new IdentifierObject(72 /* Identifier */, pos, end) : + kind === 73 /* Identifier */ ? new IdentifierObject(73 /* Identifier */, pos, end) : new TokenObject(kind, pos, end); node.parent = parent; node.flags = parent.flags & 12679168 /* ContextFlags */; @@ -120212,8 +121392,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 288 /* FirstJSDocNode */ || kid.kind > 310 /* LastJSDocNode */; }); - return child.kind < 148 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 289 /* FirstJSDocNode */ || kid.kind > 311 /* LastJSDocNode */; }); + return child.kind < 149 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -120224,7 +121404,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 148 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 149 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -120270,8 +121450,8 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { - if (token === 72 /* Identifier */) { - ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(parent) + " to have an Identifier in its trivia"); + if (token === 73 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia"); } nodes.push(createNode(token, pos, textPos, parent)); } @@ -120282,7 +121462,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(311 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(312 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -120416,7 +121596,7 @@ var ts; }); return IdentifierObject; }(TokenOrIdentifierObject)); - IdentifierObject.prototype.kind = 72 /* Identifier */; + IdentifierObject.prototype.kind = 73 /* Identifier */; var TypeObject = /** @class */ (function () { function TypeObject(checker, flags) { this.checker = checker; @@ -120617,10 +121797,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 239 /* FunctionDeclaration */: - case 196 /* FunctionExpression */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: + case 240 /* FunctionDeclaration */: + case 197 /* FunctionExpression */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -120640,31 +121820,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 240 /* ClassDeclaration */: - case 209 /* ClassExpression */: - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: - case 243 /* EnumDeclaration */: - case 244 /* ModuleDeclaration */: - case 248 /* ImportEqualsDeclaration */: - case 257 /* ExportSpecifier */: - case 253 /* ImportSpecifier */: - case 250 /* ImportClause */: - case 251 /* NamespaceImport */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 168 /* TypeLiteral */: + case 241 /* ClassDeclaration */: + case 210 /* ClassExpression */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: + case 244 /* EnumDeclaration */: + case 245 /* ModuleDeclaration */: + case 249 /* ImportEqualsDeclaration */: + case 258 /* ExportSpecifier */: + case 254 /* ImportSpecifier */: + case 251 /* ImportClause */: + case 252 /* NamespaceImport */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 169 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 151 /* Parameter */: + case 152 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 237 /* VariableDeclaration */: - case 186 /* BindingElement */: { + case 238 /* VariableDeclaration */: + case 187 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -120675,19 +121855,19 @@ var ts; } } // falls through - case 278 /* EnumMember */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 279 /* EnumMember */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: addDeclaration(node); break; - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -120699,7 +121879,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 251 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 252 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -120708,7 +121888,7 @@ var ts; } } break; - case 204 /* BinaryExpression */: + case 205 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -120877,7 +122057,7 @@ var ts; var sourceFile; if (this.currentFileName !== fileName) { // This is a new file, just parse it - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 7 /* Latest */, version, /*setNodeParents*/ true, scriptKind); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 8 /* Latest */, version, /*setNodeParents*/ true, scriptKind); } else if (this.currentFileVersion !== version) { // This is the same file, just a newer version. Incrementally parse the file. @@ -121281,41 +122461,48 @@ var ts; return undefined; } var typeChecker = program.getTypeChecker(); - var symbol = getSymbolAtLocationForQuickInfo(node, typeChecker); + var nodeForQuickInfo = getNodeForQuickInfo(node); + var symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker); if (!symbol || typeChecker.isUnknownSymbol(symbol)) { - var type_2 = shouldGetType(sourceFile, node, position) ? typeChecker.getTypeAtLocation(node) : undefined; + var type_2 = shouldGetType(sourceFile, nodeForQuickInfo, position) ? typeChecker.getTypeAtLocation(nodeForQuickInfo) : undefined; return type_2 && { kind: "" /* unknown */, kindModifiers: "" /* none */, - textSpan: ts.createTextSpanFromNode(node, sourceFile), - displayParts: typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return ts.typeToDisplayParts(typeChecker, type_2, ts.getContainerNode(node)); }), + textSpan: ts.createTextSpanFromNode(nodeForQuickInfo, sourceFile), + displayParts: typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return ts.typeToDisplayParts(typeChecker, type_2, ts.getContainerNode(nodeForQuickInfo)); }), documentation: type_2.symbol ? type_2.symbol.getDocumentationComment(typeChecker) : undefined, tags: type_2.symbol ? type_2.symbol.getJsDocTags() : undefined }; } var _a = typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { - return ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(node), node); + return ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(nodeForQuickInfo), nodeForQuickInfo); }), symbolKind = _a.symbolKind, displayParts = _a.displayParts, documentation = _a.documentation, tags = _a.tags; return { kind: symbolKind, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - textSpan: ts.createTextSpanFromNode(node, sourceFile), + textSpan: ts.createTextSpanFromNode(nodeForQuickInfo, sourceFile), displayParts: displayParts, documentation: documentation, tags: tags, }; } + function getNodeForQuickInfo(node) { + if (ts.isNewExpression(node.parent) && node.pos === node.parent.pos) { + return node.parent.expression; + } + return node; + } function shouldGetType(sourceFile, node, position) { switch (node.kind) { - case 72 /* Identifier */: + case 73 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 189 /* PropertyAccessExpression */: - case 148 /* QualifiedName */: + case 190 /* PropertyAccessExpression */: + case 149 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); - case 100 /* ThisKeyword */: - case 178 /* ThisType */: - case 98 /* SuperKeyword */: + case 101 /* ThisKeyword */: + case 179 /* ThisType */: + case 99 /* SuperKeyword */: return true; default: return false; @@ -121422,16 +122609,16 @@ var ts; return undefined; } switch (node.kind) { - case 189 /* PropertyAccessExpression */: - case 148 /* QualifiedName */: + case 190 /* PropertyAccessExpression */: + case 149 /* QualifiedName */: case 10 /* StringLiteral */: - case 87 /* FalseKeyword */: - case 102 /* TrueKeyword */: - case 96 /* NullKeyword */: - case 98 /* SuperKeyword */: - case 100 /* ThisKeyword */: - case 178 /* ThisType */: - case 72 /* Identifier */: + case 88 /* FalseKeyword */: + case 103 /* TrueKeyword */: + case 97 /* NullKeyword */: + case 99 /* SuperKeyword */: + case 101 /* ThisKeyword */: + case 179 /* ThisType */: + case 73 /* Identifier */: break; // Cant create the text span default: @@ -121447,7 +122634,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 === 244 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 245 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -121590,30 +122777,14 @@ var ts; } function applyCodeActionCommand(fileName, actionOrFormatSettingsOrUndefined) { var action = typeof fileName === "string" ? actionOrFormatSettingsOrUndefined : fileName; - var formatSettings = typeof fileName !== "string" ? actionOrFormatSettingsOrUndefined : undefined; - return ts.isArray(action) ? Promise.all(action.map(function (a) { return applySingleCodeActionCommand(a, formatSettings); })) : applySingleCodeActionCommand(action, formatSettings); + return ts.isArray(action) ? Promise.all(action.map(function (a) { return applySingleCodeActionCommand(a); })) : applySingleCodeActionCommand(action); } - function applySingleCodeActionCommand(action, formatSettings) { + function applySingleCodeActionCommand(action) { var getPath = function (path) { return ts.toPath(path, currentDirectory, getCanonicalFileName); }; - switch (action.type) { - case "install package": - return host.installPackage - ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) - : Promise.reject("Host does not implement `installPackage`"); - case "generate types": { - var fileToGenerateTypesFor = action.fileToGenerateTypesFor, outputFileName_1 = action.outputFileName; - if (!host.inspectValue) - return Promise.reject("Host does not implement `installPackage`"); - var valueInfoPromise = host.inspectValue({ fileNameToRequire: fileToGenerateTypesFor }); - return valueInfoPromise.then(function (valueInfo) { - var fullOut = getPath(outputFileName_1); - host.writeFile(fullOut, ts.valueInfoToDeclarationFileText(valueInfo, formatSettings || ts.testFormatSettings)); // TODO: GH#18217 - return { successMessage: "Wrote types to '" + fullOut + "'" }; - }); - } - default: - return ts.Debug.assertNever(action); - } + ts.Debug.assertEqual(action.type, "install package"); + return host.installPackage + ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) + : Promise.reject("Host does not implement `installPackage`"); } function getDocCommentTemplateAtPosition(fileName, position) { return ts.JsDoc.getDocCommentTemplateAtPosition(ts.getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position); @@ -121809,6 +122980,9 @@ var ts; preferences: preferences, }; } + function getSmartSelectionRange(fileName, position) { + return ts.SmartSelectionRange.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName)); + } function getApplicableRefactors(fileName, positionOrRange, preferences) { if (preferences === void 0) { preferences = ts.emptyOptions; } synchronizeHostData(); @@ -121849,6 +123023,7 @@ var ts; getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, getRenameInfo: getRenameInfo, + getSmartSelectionRange: getSmartSelectionRange, findRenameLocations: findRenameLocations, getNavigationBarItems: getNavigationBarItems, getNavigationTree: getNavigationTree, @@ -121911,7 +123086,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 259 /* ExternalModuleReference */ || + node.parent.kind === 260 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -121928,13 +123103,13 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 149 /* ComputedPropertyName */) { + if (node.parent.kind === 150 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through - case 72 /* Identifier */: + case 73 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 188 /* ObjectLiteralExpression */ || node.parent.parent.kind === 268 /* JsxAttributes */) && + (node.parent.parent.kind === 189 /* ObjectLiteralExpression */ || node.parent.parent.kind === 269 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -121976,7 +123151,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 190 /* ElementAccessExpression */ && + node.parent.kind === 191 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -122056,114 +123231,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 219 /* VariableStatement */: + case 220 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 237 /* VariableDeclaration */: - case 154 /* PropertyDeclaration */: - case 153 /* PropertySignature */: + case 238 /* VariableDeclaration */: + case 155 /* PropertyDeclaration */: + case 154 /* PropertySignature */: return spanInVariableDeclaration(node); - case 151 /* Parameter */: + case 152 /* Parameter */: return spanInParameterDeclaration(node); - case 239 /* FunctionDeclaration */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 157 /* Constructor */: - case 196 /* FunctionExpression */: - case 197 /* ArrowFunction */: + case 240 /* FunctionDeclaration */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 158 /* Constructor */: + case 197 /* FunctionExpression */: + case 198 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 218 /* Block */: + case 219 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 245 /* ModuleBlock */: + case 246 /* ModuleBlock */: return spanInBlock(node); - case 274 /* CatchClause */: + case 275 /* CatchClause */: return spanInBlock(node.block); - case 221 /* ExpressionStatement */: + case 222 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 230 /* ReturnStatement */: + case 231 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 224 /* WhileStatement */: + case 225 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 223 /* DoStatement */: + case 224 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 236 /* DebuggerStatement */: + case 237 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 222 /* IfStatement */: + case 223 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 233 /* LabeledStatement */: + case 234 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 229 /* BreakStatement */: - case 228 /* ContinueStatement */: + case 230 /* BreakStatement */: + case 229 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 225 /* ForStatement */: + case 226 /* ForStatement */: return spanInForStatement(node); - case 226 /* ForInStatement */: + case 227 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 227 /* ForOfStatement */: + case 228 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 232 /* SwitchStatement */: + case 233 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 271 /* CaseClause */: - case 272 /* DefaultClause */: + case 272 /* CaseClause */: + case 273 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 235 /* TryStatement */: + case 236 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 234 /* ThrowStatement */: + case 235 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 254 /* ExportAssignment */: + case 255 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 248 /* ImportEqualsDeclaration */: + case 249 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 249 /* ImportDeclaration */: + case 250 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 255 /* ExportDeclaration */: + case 256 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 240 /* ClassDeclaration */: - case 243 /* EnumDeclaration */: - case 278 /* EnumMember */: - case 186 /* BindingElement */: + case 241 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: + case 279 /* EnumMember */: + case 187 /* BindingElement */: // span on complete node return textSpan(node); - case 231 /* WithStatement */: + case 232 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 152 /* Decorator */: + case 153 /* Decorator */: return spanInNodeArray(parent.decorators); - case 184 /* ObjectBindingPattern */: - case 185 /* ArrayBindingPattern */: + case 185 /* ObjectBindingPattern */: + case 186 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 241 /* InterfaceDeclaration */: - case 242 /* TypeAliasDeclaration */: + case 242 /* InterfaceDeclaration */: + case 243 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -122187,13 +123362,13 @@ var ts; case 28 /* LessThanToken */: return spanInGreaterThanOrLessThanToken(node); // Keywords: - case 107 /* WhileKeyword */: + case 108 /* WhileKeyword */: return spanInWhileKeyword(node); - case 83 /* ElseKeyword */: - case 75 /* CatchKeyword */: - case 88 /* FinallyKeyword */: + case 84 /* ElseKeyword */: + case 76 /* CatchKeyword */: + case 89 /* FinallyKeyword */: return spanInNextNode(node); - case 147 /* OfKeyword */: + case 148 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -122205,14 +123380,14 @@ var ts; // Set breakpoint on identifier element of destructuring pattern // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern - if ((node.kind === 72 /* Identifier */ || - node.kind === 208 /* SpreadElement */ || - node.kind === 275 /* PropertyAssignment */ || - node.kind === 276 /* ShorthandPropertyAssignment */) && + if ((node.kind === 73 /* Identifier */ || + node.kind === 209 /* SpreadElement */ || + node.kind === 276 /* PropertyAssignment */ || + node.kind === 277 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 204 /* BinaryExpression */) { + if (node.kind === 205 /* 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 @@ -122221,7 +123396,7 @@ var ts; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left); } - if (operatorToken.kind === 59 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + if (operatorToken.kind === 60 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { // Set breakpoint on assignment expression element of destructuring pattern // a = expression of // [a = expression, b, c] = someExpression or @@ -122234,22 +123409,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 223 /* DoStatement */: + case 224 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 152 /* Decorator */: + case 153 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 225 /* ForStatement */: - case 227 /* ForOfStatement */: + case 226 /* ForStatement */: + case 228 /* ForOfStatement */: return textSpan(node); - case 204 /* BinaryExpression */: + case 205 /* 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 197 /* ArrowFunction */: + case 198 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -122258,21 +123433,21 @@ var ts; } } switch (node.parent.kind) { - case 275 /* PropertyAssignment */: + case 276 /* 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 194 /* TypeAssertionExpression */: + case 195 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 237 /* VariableDeclaration */: - case 151 /* Parameter */: { + case 238 /* VariableDeclaration */: + case 152 /* 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)) { @@ -122280,7 +123455,7 @@ var ts; } break; } - case 204 /* BinaryExpression */: { + case 205 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -122310,7 +123485,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 226 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 227 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -122322,7 +123497,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 227 /* ForOfStatement */) { + parent.parent.kind === 228 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -122363,7 +123538,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 240 /* ClassDeclaration */ && functionDeclaration.kind !== 157 /* Constructor */); + (functionDeclaration.parent.kind === 241 /* ClassDeclaration */ && functionDeclaration.kind !== 158 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -122386,26 +123561,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 244 /* ModuleDeclaration */: + case 245 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 224 /* WhileStatement */: - case 222 /* IfStatement */: - case 226 /* ForInStatement */: + case 225 /* WhileStatement */: + case 223 /* IfStatement */: + case 227 /* 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 225 /* ForStatement */: - case 227 /* ForOfStatement */: + case 226 /* ForStatement */: + case 228 /* 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 === 238 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 239 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -122430,21 +123605,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 210 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 211 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 186 /* BindingElement */) { + if (bindingPattern.parent.kind === 187 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 185 /* ArrayBindingPattern */ && node.kind !== 184 /* ObjectBindingPattern */); - var elements = node.kind === 187 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 210 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 186 /* ArrayBindingPattern */ && node.kind !== 185 /* ObjectBindingPattern */); + var elements = node.kind === 188 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 211 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -122452,18 +123627,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 === 204 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 205 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 243 /* EnumDeclaration */: + case 244 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 240 /* ClassDeclaration */: + case 241 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -122471,25 +123646,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 245 /* ModuleBlock */: + case 246 /* 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 243 /* EnumDeclaration */: - case 240 /* ClassDeclaration */: + case 244 /* EnumDeclaration */: + case 241 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 218 /* Block */: + case 219 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 274 /* CatchClause */: + case 275 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 246 /* CaseBlock */: + case 247 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -122497,7 +123672,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 184 /* ObjectBindingPattern */: + case 185 /* 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); @@ -122513,7 +123688,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 185 /* ArrayBindingPattern */: + case 186 /* 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); @@ -122528,12 +123703,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 223 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 191 /* CallExpression */ || - node.parent.kind === 192 /* NewExpression */) { + if (node.parent.kind === 224 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 192 /* CallExpression */ || + node.parent.kind === 193 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 195 /* ParenthesizedExpression */) { + if (node.parent.kind === 196 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -122542,21 +123717,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 196 /* FunctionExpression */: - case 239 /* FunctionDeclaration */: - case 197 /* ArrowFunction */: - case 156 /* MethodDeclaration */: - case 155 /* MethodSignature */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - case 157 /* Constructor */: - case 224 /* WhileStatement */: - case 223 /* DoStatement */: - case 225 /* ForStatement */: - case 227 /* ForOfStatement */: - case 191 /* CallExpression */: - case 192 /* NewExpression */: - case 195 /* ParenthesizedExpression */: + case 197 /* FunctionExpression */: + case 240 /* FunctionDeclaration */: + case 198 /* ArrowFunction */: + case 157 /* MethodDeclaration */: + case 156 /* MethodSignature */: + case 159 /* GetAccessor */: + case 160 /* SetAccessor */: + case 158 /* Constructor */: + case 225 /* WhileStatement */: + case 224 /* DoStatement */: + case 226 /* ForStatement */: + case 228 /* ForOfStatement */: + case 192 /* CallExpression */: + case 193 /* NewExpression */: + case 196 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -122566,20 +123741,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 275 /* PropertyAssignment */ || - node.parent.kind === 151 /* Parameter */) { + node.parent.kind === 276 /* PropertyAssignment */ || + node.parent.kind === 152 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 194 /* TypeAssertionExpression */) { + if (node.parent.kind === 195 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 223 /* DoStatement */) { + if (node.parent.kind === 224 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -122587,7 +123762,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 227 /* ForOfStatement */) { + if (node.parent.kind === 228 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -123056,6 +124231,10 @@ var ts; var _this = this; return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); }); }; + LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) { + var _this = this; + return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); }); + }; LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { var _this = this; return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); }); diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 3f1016dbb2be..a1c89fd7c6f1 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -8,11 +8,11 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. - Angular: '~8.2.0-next.2', + Angular: '~8.2.0-rc.0', RxJs: '~6.4.0', ZoneJs: '~0.9.1', - TypeScript: '~3.4.3', - TsLib: '^1.9.0', + TypeScript: '~3.5.3', + TsLib: '^1.10.0', // The versions below must be manually updated when making a new devkit release. DevkitBuildAngular: '~0.802.0-next.2', @@ -20,6 +20,6 @@ export const latestVersions = { DevkitBuildWebpack: '~0.802.0-next.2', AngularPWA: '~0.802.0-next.2', - tsickle: '^0.35.0', - ngPackagr: '^5.1.0', + tsickle: '^0.36.0', + ngPackagr: '^5.3.0', }; diff --git a/packages/schematics/schematics/blank/project-files/package.json.template b/packages/schematics/schematics/blank/project-files/package.json.template index ca350c4d8679..2f6937d0987e 100644 --- a/packages/schematics/schematics/blank/project-files/package.json.template +++ b/packages/schematics/schematics/blank/project-files/package.json.template @@ -18,6 +18,6 @@ "@types/jasmine": "^3.3.9", "@types/node": "^8.0.31", "jasmine": "^3.3.1", - "typescript": "~3.4.3" + "typescript": "~3.5.3" } } diff --git a/packages/schematics/schematics/schematic/files/package.json b/packages/schematics/schematics/schematic/files/package.json index 29db628a2212..4c6c6be6b4bb 100644 --- a/packages/schematics/schematics/schematic/files/package.json +++ b/packages/schematics/schematics/schematic/files/package.json @@ -18,6 +18,6 @@ "@types/jasmine": "^3.3.9", "@types/node": "^8.0.31", "jasmine": "^3.3.1", - "typescript": "3.4.5" + "typescript": "3.5.3" } } diff --git a/tests/legacy-cli/e2e/assets/webpack/test-app-weird/package.json b/tests/legacy-cli/e2e/assets/webpack/test-app-weird/package.json index 71c49f7b9fa7..084987d33cdc 100644 --- a/tests/legacy-cli/e2e/assets/webpack/test-app-weird/package.json +++ b/tests/legacy-cli/e2e/assets/webpack/test-app-weird/package.json @@ -21,7 +21,7 @@ "preprocess-loader": "^0.2.2", "raw-loader": "^0.5.1", "sass-loader": "^6.0.0", - "typescript": "~3.4.5", + "typescript": "~3.5.3", "webpack": "~4.0.1", "webpack-cli": "~2.0.9" } diff --git a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json index 11ea587ef4da..ad8926ad672e 100644 --- a/tests/legacy-cli/e2e/assets/webpack/test-app/package.json +++ b/tests/legacy-cli/e2e/assets/webpack/test-app/package.json @@ -2,14 +2,14 @@ "name": "test", "license": "MIT", "dependencies": { - "@angular/common": "^8.0.0-rc.0", - "@angular/compiler": "^8.0.0-rc.0", - "@angular/compiler-cli": "^8.0.0-rc.0", - "@angular/core": "^8.0.0-rc.0", - "@angular/platform-browser": "^8.0.0-rc.0", - "@angular/platform-browser-dynamic": "^8.0.0-rc.0", - "@angular/platform-server": "^8.0.0-rc.0", - "@angular/router": "^8.0.0-rc.0", + "@angular/common": "^8.2.0-rc.0", + "@angular/compiler": "^8.2.0-rc.0", + "@angular/compiler-cli": "^8.2.0-rc.0", + "@angular/core": "^8.2.0-rc.0", + "@angular/platform-browser": "^8.2.0-rc.0", + "@angular/platform-browser-dynamic": "^8.2.0-rc.0", + "@angular/platform-server": "^8.2.0-rc.0", + "@angular/router": "^8.2.0-rc.0", "@ngtools/webpack": "0.0.0", "core-js": "^3.0.0", "rxjs": "^6.4.0", @@ -20,7 +20,7 @@ "performance-now": "^0.2.0", "raw-loader": "^0.5.1", "sass-loader": "^6.0.0", - "typescript": "~3.4.5", + "typescript": "~3.5.3", "webpack": "~4.0.1", "webpack-cli": "~2.0.9" } diff --git a/tests/legacy-cli/e2e/assets/webpack/test-server-app/package.json b/tests/legacy-cli/e2e/assets/webpack/test-server-app/package.json index 5f30c3cb4556..cd1f314e91a1 100644 --- a/tests/legacy-cli/e2e/assets/webpack/test-server-app/package.json +++ b/tests/legacy-cli/e2e/assets/webpack/test-server-app/package.json @@ -21,7 +21,7 @@ "performance-now": "^0.2.0", "raw-loader": "^0.5.1", "sass-loader": "^6.0.3", - "typescript": "~3.4.5", + "typescript": "~3.5.3", "webpack": "~4.0.1", "webpack-cli": "~2.0.9" } diff --git a/yarn.lock b/yarn.lock index 8fe6d4366c2a..f40e733b0a1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/animations@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-8.1.0.tgz#acc6716df47599e48c715c7ec24dfc1e340256e2" - integrity sha512-v1paXrWQGsD+E4QBpwNUZ8dPj8hEn0b2kDVzYX6l/e9flUX6W2BWYx+BRuC4QBnNtTV9jiGsHT8FmQq/WztgWw== +"@angular/animations@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-8.2.0-rc.0.tgz#290466ddd7c93ba875cb13a053054334281f71d9" + integrity sha512-Uq6xORBq117KeD9iVXYu2Vkz55+zm3NngAkxyzlhZkbYRz8ByQxFAtfMhWVVcHlqW5GnLhyqX/lN5Nav0jdcIw== dependencies: tslib "^1.9.0" @@ -18,17 +18,17 @@ optionalDependencies: parse5 "^5.0.0" -"@angular/common@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-8.1.0.tgz#aeb34e52e7f808e49d045eee36b97c802152c8fb" - integrity sha512-m5oEBPSy5nE+4SZTu3XchJhKT/u73NnJIS3+41xRsF5aX/1p8uNHkhJR7kcJmlVa7BZNr4byl8bGsYjX0CCpVg== +"@angular/common@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-8.2.0-rc.0.tgz#58b4fdc85d7db9667d9f9d28e8cb6356923c5e92" + integrity sha512-aOTXW2KRGhX/y5v6NUFFxxoTi1HlMwGv9XaxH1I9qj+YnlHO+oVqyHB4MS+gvb2eLqbyxKTKzUYWsMDblX8nVA== dependencies: tslib "^1.9.0" -"@angular/compiler-cli@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-8.1.0.tgz#a42376cc42d34d04a9d7f1238b5d7ef535a218f6" - integrity sha512-WqEWjUTkvkp4rYDwYKo9XVXK1sbUHihwiZDOZrBEiGdw08TvZ+3qZs/mnYwRUYCzoN99RVG5rxJDg8Sf2VTY+w== +"@angular/compiler-cli@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-8.2.0-rc.0.tgz#a5b290d5c92d0f9a6de5d17c63ea7740169845e3" + integrity sha512-w4KSp2cSYpg2qcONZeVaeCGB0JkiXdXVIPO9PdkCp8tU7KYVOAt/ZbN91zBKunSD4EbzlaF7pr290J094CH04w== dependencies: canonical-path "1.0.0" chokidar "^2.1.1" @@ -37,22 +37,28 @@ magic-string "^0.25.0" minimist "^1.2.0" reflect-metadata "^0.1.2" - shelljs "^0.8.1" source-map "^0.6.1" tslib "^1.9.0" yargs "13.1.0" -"@angular/compiler@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-8.1.0.tgz#8d94ad49d5388b2f2f0e369233a224f649619be9" - integrity sha512-+o4jR7WfqR39zgGk7gwpxZfd2hS3X2qgr17mUCeqQkKj0gh+GYWj7OlSuYXG63OS9S4iLsKQiVUYYgqdNSK5mg== +"@angular/compiler@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-8.2.0-rc.0.tgz#3c288d33717e3a687333a5e7de533f871a5e5fca" + integrity sha512-fS2/5MTUtYy38kCwToltqBku6aq0hq90jn0p37TSRoYsNm7Ae2NU3nkM36A5G1wzetBn6R92updswbR62OVD1w== dependencies: tslib "^1.9.0" -"@angular/core@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-8.1.0.tgz#68bc170b4c041e3c19b9a17c0fff74b88fb37aae" - integrity sha512-GviWJjOu6LJMYNbukdSK35VaXvSrp5LTNd0FbXoBQF+mhVVV/8cG4hTKKjxG1xwWXI5E1t5U4aUKXrKUNJ1sQg== +"@angular/core@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-8.2.0-rc.0.tgz#97a028fb2871abed3aa5fd04b5c4237818a5adb8" + integrity sha512-G7vdTjNCxhpLlOaAcQ/xWt9kFLs1PkNkMzyRsiGUe/k5Mlr+xcmUDb1e5N3bLHJmIDFIUO1fXp/KHp1dysqB7g== + dependencies: + tslib "^1.9.0" + +"@angular/forms@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-8.2.0-rc.0.tgz#999970f6e5d37bafd91dffaba7057fc1f801f4fe" + integrity sha512-HjUjdqAu8XfI29+CXC8qDGYsGkFFonLMRwuDhWn2KpF7MXvFhERlxsFUNYNIYd29+HcoJcg/PRHTzqqJ2TPJLg== dependencies: tslib "^1.9.0" @@ -63,40 +69,40 @@ dependencies: tslib "^1.7.1" -"@angular/platform-browser-dynamic@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.1.0.tgz#407fae89fc7294783b8d27c19c1f96e36a3fdabd" - integrity sha512-By9I9hXqg538UzhlYDrF1dW7cDaF2JPjoFCE9jZZQxVRhOdjVoYVuIxIa5qPuGWfmMITO2G9rfMMrDiRHMyEDg== +"@angular/platform-browser-dynamic@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.2.0-rc.0.tgz#4d231e1091502792ef1bd02a49f94a54f12503d0" + integrity sha512-4LOE9pbcEM+dsXPBqIcHDglsizUYU4n23N+J6jsud3GM7VYx7KKd70e1KF+TTNEnNqE1gv7aCz5vZ3J3cYlWTQ== dependencies: tslib "^1.9.0" -"@angular/platform-browser@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-8.1.0.tgz#186ce714304d2f72c4a3bf50a1607e03c8de6abd" - integrity sha512-qH6bH6DSRGvgx5iD7BbufsdeMxhh7lL1zN47LkrLGa8hojF+yxwtdE+go+WJ160ArACyX/FrPmPDSWT20YilUQ== +"@angular/platform-browser@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-8.2.0-rc.0.tgz#69ae708dfc74fcc03e8cd1cdb296e1a828b433b9" + integrity sha512-Vk9Zdv6kHm3hwPvhc6FG0AnMxWOkNXfdAoXTLDY4vbo367ym1xxcDUmUf+mou/HODpnGdoHKSTLj5SEua2SSMw== dependencies: tslib "^1.9.0" -"@angular/platform-server@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-8.1.0.tgz#e0f9e69cbe87ab8538c5256be748e0718a480718" - integrity sha512-bFsbYnbsXl178pOYxppfpTAxGcOaAz1kjTWQr/zVcMOthtu/M08oGXMke2l7Fx4Bt3MM7DXd93Qjebv7N4ECRQ== +"@angular/platform-server@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-8.2.0-rc.0.tgz#7d54506a01f25a927f68716027f231947f293350" + integrity sha512-acMb95y5vKp5b/CbqDLbb5ZrS99nl4WedAv1FDfQH8kEWR/RtHfxB+Q3w3LwNBDC+Pivy3Ce+E8dZSpVTt4bUA== dependencies: domino "^2.1.2" tslib "^1.9.0" xhr2 "^0.1.4" -"@angular/router@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-8.1.0.tgz#e8e0d146a489abcc7b8aed0f9efe10922e467db6" - integrity sha512-LeJOmiFdsXVf0KlN/jzA5NgWY1V4Ty5TDcfNd01s/ckZlzZd+p5hFhRFc75qwENTb8UwClTLsYQLmvmphnB4dA== +"@angular/router@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-8.2.0-rc.0.tgz#8a5eba78917d45485fc5001592e690d9ed4e4ad8" + integrity sha512-hpidAfvDpIaWBccogRNck1cFO/STgN/KinF/VkMWeYMlt9IFwefEOWwY/d1V71L3wjTwV+NMhuUTguE8OptT3w== dependencies: tslib "^1.9.0" -"@angular/service-worker@~8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-8.1.0.tgz#bd7d41863526441e4ea2b93ac19e69255c52ca6e" - integrity sha512-O4vUqrTPoCeRRnbUYBk+5Dx2zj/nc6UxZS/WZ1HKEGJZvYvuXf3SMfi1cHdzKPedCUj8PMt6yLpiP0qkyxV+Ww== +"@angular/service-worker@~8.2.0-rc.0": + version "8.2.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-8.2.0-rc.0.tgz#9bfc4da356c177264448185b0a8d0be80853154f" + integrity sha512-9RKJyjruUGY+caJ532J58umsR10R/eW2gU60cndDBPanopoqLsXMstss+bUZOgrtMnO7HaV72aypVZS6sBrbQA== dependencies: tslib "^1.9.0" @@ -282,6 +288,13 @@ dependencies: defer-to-connect "^1.0.1" +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + "@types/bluebird@*": version "3.5.26" resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.26.tgz#a38c438ae84fa02431d6892edf86e46edcbca291" @@ -454,10 +467,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.4.tgz#0f4cb2dc7c1de6096055357f70179043c33e9897" integrity sha512-fCHV45gS+m3hH17zgkgADUSi2RR1Vht6wOZ0jyHP8rjiQra9f+mIcgwPQHllmDocYOstIEbKlxbFDYlgrTPYqw== -"@types/node@^11.11.6": - version "11.12.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.12.0.tgz#ec5594728811dc2797e42396cfcdf786f2052c12" - integrity sha512-Lg00egj78gM+4aE0Erw05cuDbvX9sLJbaaPwwRtdCdAMnIudqrQZ0oZX98Ek0yiSK/A2nubHgJfvII/rTT2Dwg== +"@types/node@^12.6.2": + version "12.6.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" + integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== "@types/node@^6.0.46": version "6.14.0" @@ -491,6 +504,13 @@ "@types/node" "*" "@types/tough-cookie" "*" +"@types/[email protected]": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + "@types/rx-core-binding@*": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/rx-core-binding/-/rx-core-binding-4.0.4.tgz#d969d32f15a62b89e2862c17b3ee78fe329818d3" @@ -1039,12 +1059,12 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= -ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" - integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= +ansi-align@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== dependencies: - string-width "^2.0.0" + string-width "^3.0.0" [email protected]: version "3.2.4" @@ -1336,7 +1356,7 @@ atob@^2.1.1: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== [email protected]: [email protected], autoprefixer@^9.6.0: version "9.6.1" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47" integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== @@ -1349,18 +1369,6 @@ [email protected]: postcss "^7.0.17" postcss-value-parser "^4.0.0" -autoprefixer@^9.0.0: - version "9.3.1" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.3.1.tgz#71b622174de2b783d5fd99f9ad617b7a3c78443e" - integrity sha512-DY9gOh8z3tnCbJ13JIWaeQsoYncTGdsrgCceBaQSIL4nvdrLxgbRSBPevg2XbX7u4QCSfLheSJEEIUUSlkbx6Q== - dependencies: - browserslist "^4.3.3" - caniuse-lite "^1.0.30000898" - normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^7.0.5" - postcss-value-parser "^3.3.1" - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -1620,17 +1628,18 @@ bootstrap@^4.0.0: resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be" integrity sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w== -boxen@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" - integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== +boxen@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-3.2.0.tgz#fbdff0de93636ab4450886b6ff45b92d098f45eb" + integrity sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A== dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^2.0.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" + ansi-align "^3.0.0" + camelcase "^5.3.1" + chalk "^2.4.2" + cli-boxes "^2.2.0" + string-width "^3.0.0" term-size "^1.2.0" + type-fest "^0.3.0" widest-line "^2.0.0" brace-expansion@^1.1.7: @@ -1761,7 +1770,7 @@ [email protected]: electron-to-chromium "^1.3.191" node-releases "^1.1.25" -browserslist@^4.0.0, browserslist@^4.3.3: +browserslist@^4.0.0: version "4.5.5" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.5.tgz#fe1a352330d2490d5735574c149a85bc18ef9b82" integrity sha512-0QFO1r/2c792Ohkit5XI8Cm8pDtZxgNl2H6HU4mHrpYz7314pEYcsAVVatM0l/YmxPnEzh9VygXouj4gkFUTKA== @@ -1843,10 +1852,10 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= -builtin-modules@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.0.0.tgz#1e587d44b006620d90286cc7a9238bbc6129cab1" - integrity sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg== +builtin-modules@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" + integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== builtin-status-codes@^3.0.0: version "3.0.0" @@ -1993,6 +2002,19 @@ cacheable-request@^5.1.0: normalize-url "^3.1.0" responselike "^1.0.2" +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -2039,12 +2061,12 @@ camelcase@^2.0.0, camelcase@^2.0.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= -camelcase@^4.0.0, camelcase@^4.1.0: +camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -camelcase@^5.0.0: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -2054,11 +2076,6 @@ [email protected]: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000985.tgz#0eb40f6c8a8c219155cbe43c4975c0efb4a0f77f" integrity sha512-1ngiwkgqAYPG0JSSUp3PUDGPKKY59EK7NrGGX+VOxaKCNzRbNc7uXMny+c3VJfZxtoK3wSImTvG9T9sXiTw2+w== -caniuse-lite@^1.0.30000898: - version "1.0.30000903" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000903.tgz#86d46227759279b3db345ddbe778335dbba9e858" - integrity sha512-T1XVJEpGCoaq7MDw7/6hCdYUukmSaS+1l/OQJkLtw7Cr2+/+d67tNGKEbyiqf7Ck8x6EhNFUxjYFXXka0N/w5g== - caniuse-lite@^1.0.30000960: version "1.0.30000960" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000960.tgz#ec48297037e5607f582f246ae7b12bee66a78999" @@ -2084,11 +2101,6 @@ [email protected]: resolved "https://registry.yarnpkg.com/canonical-path/-/canonical-path-1.0.0.tgz#fcb470c23958def85081856be7a86e904f180d1d" integrity sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg== -capture-stack-trace@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" - integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -2234,11 +2246,6 @@ chrome-trace-event@^1.0.0: dependencies: tslib "^1.9.0" -ci-info@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.5.1.tgz#17e8eb5de6f8b2b6038f0cbb714d410bfa9f3030" - integrity sha512-fKFIKXaYiL1exImwJ0AhR/6jxFPSKQBk2ayV5NiNoruUs2+rxC2kNw0EG+1Z9dugZRdCrppskQ8DN2cyaUM1Hw== - ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -2279,10 +2286,10 @@ [email protected], clean-css@^4.1.11: dependencies: source-map "~0.6.0" -cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= +cli-boxes@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.0.tgz#538ecae8f9c6ca508e3c3c95b453fe93cb4c168d" + integrity sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w== cli-cursor@^2.1.0: version "2.1.0" @@ -2557,10 +2564,10 @@ [email protected], concat-stream@^1.5.0, concat-stream@^1.5.2, concat-stream@~ readable-stream "^2.2.2" typedarray "^0.0.6" -configstore@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" - integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== +configstore@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-4.0.0.tgz#5933311e95d3687efb592c528b922d9262d227e7" + integrity sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ== dependencies: dot-prop "^4.1.0" graceful-fs "^4.1.2" @@ -2901,13 +2908,6 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" -create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= - dependencies: - capture-stack-trace "^1.0.0" - create-hash@^1.1.0, create-hash@^1.1.2: version "1.2.0" resolved "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -3782,6 +3782,11 @@ estree-walker@^0.6.0: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.0.tgz#5d865327c44a618dde5699f763891ae31f257dae" integrity sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw== +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -4359,6 +4364,15 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -4469,6 +4483,13 @@ get-stream@^4.0.0, get-stream@^4.1.0: dependencies: pump "^3.0.0" +get-stream@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4609,7 +4630,7 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -4673,23 +4694,6 @@ globby@^7.1.1: pify "^3.0.0" slash "^1.0.0" -got@^6.7.1: - version "6.7.1" - resolved "http://registry.npmjs.org/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= - dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" - got@^9.1.0: version "9.5.0" resolved "https://registry.yarnpkg.com/got/-/got-9.5.0.tgz#6fd0312c6b694c0a11d9119d95fd7daed174eb49" @@ -4707,6 +4711,23 @@ got@^9.1.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -4717,6 +4738,11 @@ graceful-fs@^4.1.15: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== +graceful-fs@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== + handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" @@ -4840,6 +4866,11 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" +has-yarn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" + integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== + has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -5209,11 +5240,6 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= - invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -5311,13 +5337,6 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -5461,10 +5480,10 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= +is-npm@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-3.0.0.tgz#ec9147bfb629c43f494cf67936a961edec7e8053" + integrity sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA== is-number@^2.1.0: version "2.1.0" @@ -5553,10 +5572,12 @@ is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= +is-reference@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.1.3.tgz#e99059204b66fdbe09305cfca715a29caa5c8a51" + integrity sha512-W1iHHv/oyBb2pPxkBxtaewxa1BC58Pn5J0hogyCdefwUIvb6R+TGbAcIa4qPNYLqLhb3EnOgUf2MQkkF76BcKw== + dependencies: + "@types/estree" "0.0.39" is-regex@^1.0.4: version "1.0.4" @@ -5565,12 +5586,7 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-retry-allowed@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= - -is-stream@^1.0.0, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -5614,6 +5630,11 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= +is-yarn-global@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" + integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== + [email protected]: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -6206,12 +6227,12 @@ [email protected]: dependencies: colornames "^1.1.1" -latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" - integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= +latest-version@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== dependencies: - package-json "^4.0.0" + package-json "^6.3.0" lcid@^1.0.0: version "1.0.0" @@ -6546,6 +6567,11 @@ lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + [email protected], lru-cache@^4.0.1, lru-cache@^4.1.2, lru-cache@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" @@ -6573,7 +6599,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.6.tgz#f278beee7ffd56ad86e6e478ce02ab2b98c78dd5" integrity sha512-swStvEyDqQ85MGpABCMBclZcLI/pBIlu8FFDtmX197+oEgKloJ67QnB+Tidh0340HmLMs39c4GrkPY3cmkXp6Q== [email protected]: [email protected], magic-string@^0.25.2: version "0.25.3" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" integrity sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA== @@ -6594,13 +6620,6 @@ magic-string@^0.25.0: dependencies: sourcemap-codec "^1.4.1" -magic-string@^0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e" - integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg== - dependencies: - sourcemap-codec "^1.4.1" - make-dir@^1.0.0, make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -7142,39 +7161,38 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== -ng-packagr@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/ng-packagr/-/ng-packagr-5.1.0.tgz#4262775f29f7da72b3e5492c480a6857065d712e" - integrity sha512-sBQrn3jy0S2T8nN1gnptO3Dd55X6oNPSFlCckfHPp7G3T3eNUfo3o9dqeZc58PFiY1WOAi4z43LI7kFFeSrTTA== +ng-packagr@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ng-packagr/-/ng-packagr-5.3.0.tgz#92434ca05ecbd1e01fe961a66c8a9a66b095f6fa" + integrity sha512-i+964lzZC7VVzatDCLDZndiXTog1XGozY7K1Bs78+uBF8O1YHNQP9wB9C5fR4uEaSKVhCWEBYekoS69flCugMA== dependencies: "@ngtools/json-schema" "^1.1.0" - autoprefixer "^9.0.0" + autoprefixer "^9.6.0" browserslist "^4.0.0" chalk "^2.3.1" - chokidar "^2.0.3" + chokidar "^3.0.0" clean-css "^4.1.11" commander "^2.12.0" - fs-extra "^7.0.0" + fs-extra "^8.0.0" glob "^7.1.2" injection-js "^2.2.1" less "^3.8.0" less-plugin-npm-import "^2.1.0" node-sass-tilde-importer "^1.0.0" - opencollective-postinstall "^2.0.1" postcss "^7.0.0" postcss-url "^8.0.0" read-pkg-up "^5.0.0" rimraf "^2.6.1" - rollup "^1.6.0" - rollup-plugin-commonjs "^9.1.3" + rollup "^1.12.1" + rollup-plugin-commonjs "^10.0.0" rollup-plugin-json "^4.0.0" - rollup-plugin-node-resolve "^4.0.1" + rollup-plugin-node-resolve "^5.0.0" rollup-plugin-sourcemaps "^0.4.2" rxjs "^6.0.0" sass "^1.17.3" stylus "^0.54.5" - terser "^3.16.1" - update-notifier "^2.3.0" + terser "^4.0.0" + update-notifier "^3.0.0" nice-try@^1.0.4: version "1.0.5" @@ -7330,6 +7348,11 @@ normalize-url@^3.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== +normalize-url@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.3.0.tgz#9c49e10fc1876aeb76dba88bf1b2b5d9fa57b2ee" + integrity sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ== + npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" @@ -7572,11 +7595,6 @@ [email protected]: dependencies: is-wsl "^1.1.0" -opencollective-postinstall@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" - integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== - opn@^5.1.0: version "5.4.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" @@ -7753,15 +7771,15 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ== -package-json@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" - integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== dependencies: - got "^6.7.1" - registry-auth-token "^3.0.1" - registry-url "^3.0.3" - semver "^5.1.0" + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" [email protected]: version "9.5.4" @@ -8167,7 +8185,7 @@ postcss-url@^8.0.0: postcss "^7.0.2" xxhashjs "^0.2.1" -postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.1: +postcss-value-parser@^3.2.3: version "3.3.1" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== @@ -8186,7 +8204,7 @@ [email protected], postcss@^7.0.17: source-map "^0.6.1" supports-color "^6.1.0" -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.2, postcss@^7.0.5: +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.2: version "7.0.5" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.5.tgz#70e6443e36a6d520b0fd4e7593fcca3635ee9f55" integrity sha512-HBNpviAUFCKvEh7NZhw1e8MBPivRszIiUnhrJ+sBFVSYSqubrzwX3KG51mYgcRHX8j/cAgZJedONZcm5jTBdgQ== @@ -8200,7 +8218,7 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepend-http@^1.0.0, prepend-http@^1.0.1: +prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= @@ -8551,7 +8569,7 @@ [email protected]: loader-utils "^1.1.0" schema-utils "^1.0.0" -rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: +rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -8739,13 +8757,6 @@ readdirp@^3.1.1: dependencies: picomatch "^2.0.4" -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= - dependencies: - resolve "^1.1.6" - redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -8801,20 +8812,20 @@ regexpu-core@^1.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -registry-auth-token@^3.0.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" - integrity sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ== +registry-auth-token@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.0.0.tgz#30e55961eec77379da551ea5c4cf43cbf03522be" + integrity sha512-lpQkHxd9UL6tb3k/aHAVfnVtn+Bcs9ob5InuFLLEDqSqeq+AljB8GZW9xY0x7F+xYwEcjKe07nyoxzEYz6yvkw== dependencies: - rc "^1.1.6" + rc "^1.2.8" safe-buffer "^5.0.1" -registry-url@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== dependencies: - rc "^1.0.1" + rc "^1.2.8" regjsgen@^0.2.0: version "0.2.0" @@ -8970,17 +8981,17 @@ [email protected], resolve@~1.1.6: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.1.5, resolve@^1.1.7, resolve@^1.3.2: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" -resolve@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" - integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== +resolve@^1.11.0, resolve@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" @@ -9048,15 +9059,16 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rollup-plugin-commonjs@^9.1.3: - version "9.2.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz#4604e25069e0c78a09e08faa95dc32dec27f7c89" - integrity sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA== +rollup-plugin-commonjs@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.0.1.tgz#fbfcadf4ce2e826068e056a9f5c19287d9744ddf" + integrity sha512-x0PcCVdEc4J8igv1qe2vttz8JKAKcTs3wfIA3L8xEty3VzxgORLrzZrNWaVMc+pBC4U3aDOb9BnWLAQ8J11vkA== dependencies: - estree-walker "^0.5.2" - magic-string "^0.25.1" - resolve "^1.8.1" - rollup-pluginutils "^2.3.3" + estree-walker "^0.6.1" + is-reference "^1.1.2" + magic-string "^0.25.2" + resolve "^1.11.0" + rollup-pluginutils "^2.8.1" rollup-plugin-json@^4.0.0: version "4.0.0" @@ -9065,14 +9077,16 @@ rollup-plugin-json@^4.0.0: dependencies: rollup-pluginutils "^2.5.0" -rollup-plugin-node-resolve@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.1.tgz#f95765d174e5daeef9ea6268566141f53aa9d422" - integrity sha512-fSS7YDuCe0gYqKsr5OvxMloeZYUSgN43Ypi1WeRZzQcWtHgFayV5tUSPYpxuaioIIWaBXl6NrVk0T2/sKwueLg== +rollup-plugin-node-resolve@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" + integrity sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== dependencies: - builtin-modules "^3.0.0" + "@types/resolve" "0.0.8" + builtin-modules "^3.1.0" is-module "^1.0.0" - resolve "^1.10.0" + resolve "^1.11.1" + rollup-pluginutils "^2.8.1" rollup-plugin-sourcemaps@^0.4.2: version "0.4.2" @@ -9082,7 +9096,7 @@ rollup-plugin-sourcemaps@^0.4.2: rollup-pluginutils "^2.0.1" source-map-resolve "^0.5.0" -rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.3: +rollup-pluginutils@^2.0.1: version "2.3.3" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA== @@ -9098,14 +9112,21 @@ rollup-pluginutils@^2.5.0: estree-walker "^0.6.0" micromatch "^3.1.10" -rollup@^1.6.0: - version "1.7.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.7.3.tgz#cade518b92e23efa72026e264e29d9a56cbf8eb9" - integrity sha512-U3/HaZujvGofNZQldfIknKoaNFNRS+j8/uCS/jSy3FrxF9t0FBsgZW4+VXLHG7l1daTgE6+jEy0Dv7cVCB2NPg== +rollup-pluginutils@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97" + integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== + dependencies: + estree-walker "^0.6.1" + +rollup@^1.12.1: + version "1.17.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.17.0.tgz#47ee8b04514544fc93b39bae06271244c8db7dfa" + integrity sha512-k/j1m0NIsI4SYgCJR4MWPstGJOWfJyd6gycKoMhyoKPVXxm+L49XtbUwZyFsrSU2YXsOkM4u1ll9CS/ZgJBUpw== dependencies: "@types/estree" "0.0.39" - "@types/node" "^11.11.6" - acorn "^6.1.1" + "@types/node" "^12.6.2" + acorn "^6.2.0" run-async@^2.2.0: version "2.3.0" @@ -9307,7 +9328,7 @@ [email protected]: dependencies: semver "^5.0.0" -"semver@2 >=2.2.1 || 3.x || 4 || 5", [email protected], semver@^5.0.0, semver@^5.0.3, semver@^5.1.0, semver@^5.4.1, semver@^5.6.0: +"semver@2 >=2.2.1 || 3.x || 4 || 5", [email protected], semver@^5.0.0, semver@^5.0.3, semver@^5.4.1, semver@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== @@ -9322,7 +9343,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== [email protected]: [email protected], semver@^6.2.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -9492,15 +9513,6 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= -shelljs@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" - integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -9704,14 +9716,6 @@ source-map-support@~0.4.0: dependencies: source-map "^0.5.6" -source-map-support@~0.5.9: - version "0.5.10" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" - integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -10309,15 +10313,6 @@ terser-webpack-plugin@^1.1.0: webpack-sources "^1.1.0" worker-farm "^1.5.2" -terser@^3.16.1: - version "3.16.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-3.16.1.tgz#5b0dd4fa1ffd0b0b43c2493b2c364fd179160493" - integrity sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow== - dependencies: - commander "~2.17.1" - source-map "~0.6.1" - source-map-support "~0.5.9" - terser@^3.8.1: version "3.10.8" resolved "https://registry.yarnpkg.com/terser/-/terser-3.10.8.tgz#2fe3967396a10cdc3d575074fe857efd30a2895a" @@ -10364,11 +10359,6 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.0.3.tgz#f5df732453407b09191dae73e2a8cc73f381a826" integrity sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow== -timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" @@ -10559,6 +10549,11 @@ ts-node@^5.0.0: source-map-support "^0.5.3" yn "^2.0.0" +tslib@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -10633,6 +10628,11 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-fest@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" + integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== + type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" @@ -10654,10 +10654,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= [email protected]: - version "3.4.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" - integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw== [email protected]: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== uglify-js@^3.1.4: version "3.4.9" @@ -10750,11 +10750,6 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" - integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= - upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" @@ -10765,19 +10760,21 @@ upath@^1.1.0, upath@^1.1.1: resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== -update-notifier@^2.3.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" - integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== +update-notifier@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-3.0.1.tgz#78ecb68b915e2fd1be9f767f6e298ce87b736250" + integrity sha512-grrmrB6Zb8DUiyDIaeRTBCkgISYUgETNe7NglEbVsrLWXeESnlCSP50WfRSj/GmzMPl6Uchj24S/p80nP/ZQrQ== dependencies: - boxen "^1.2.1" + boxen "^3.0.0" chalk "^2.0.1" - configstore "^3.0.0" + configstore "^4.0.0" + has-yarn "^2.1.0" import-lazy "^2.1.0" - is-ci "^1.0.10" + is-ci "^2.0.0" is-installed-globally "^0.1.0" - is-npm "^1.0.0" - latest-version "^3.0.0" + is-npm "^3.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.0.0" semver-diff "^2.0.0" xdg-basedir "^3.0.0" @@ -10798,13 +10795,6 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= - dependencies: - prepend-http "^1.0.1" - url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
c26a5f774c284d8ba0a7b0385b3c0328b9218a49
2017-07-26 00:56:25
Filipe Silva
fix(@angular/cli): pin webpack to 3.3.0
false
pin webpack to 3.3.0
fix
diff --git a/package.json b/package.json index 98bf8ca21155..28e51f0544a4 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "typescript": "~2.4.2", "url-loader": "^0.5.7", "walk-sync": "^0.3.1", - "webpack": "~3.3.0", + "webpack": "3.3.0", "webpack-dev-middleware": "^1.11.0", "webpack-dev-server": "~2.5.1", "webpack-merge": "^4.1.0", diff --git a/packages/@angular/cli/package.json b/packages/@angular/cli/package.json index 953ac4b9616b..4ac2ffa84f9c 100644 --- a/packages/@angular/cli/package.json +++ b/packages/@angular/cli/package.json @@ -84,7 +84,7 @@ "typescript": ">=2.0.0 <2.5.0", "url-loader": "^0.5.7", "walk-sync": "^0.3.1", - "webpack": "~3.3.0", + "webpack": "3.3.0", "webpack-dev-middleware": "^1.11.0", "webpack-dev-server": "~2.5.1", "webpack-merge": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 84250aabc206..148dcf4fd6cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5526,7 +5526,7 @@ webpack-sources@^1.0.1: source-list-map "^2.0.0" source-map "~0.5.3" -webpack@~3.3.0: [email protected]: version "3.3.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.3.0.tgz#ce2f9e076566aba91f74887133a883fd7da187bc" dependencies:
a44dc02feecaf8735f2dc6128a5b6cc5666b4434
2021-06-22 22:09:49
twerske
fix(@schematics/angular): add devtools to ng new
false
add devtools to ng new
fix
diff --git a/packages/schematics/angular/application/other-files/app.component.html.template b/packages/schematics/angular/application/other-files/app.component.html.template index cc25a215cc16..7b3720a6d608 100644 --- a/packages/schematics/angular/application/other-files/app.component.html.template +++ b/packages/schematics/angular/application/other-files/app.component.html.template @@ -380,6 +380,13 @@ <svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg> </a> + <a class="card" target="_blank" rel="noopener" href="https://angular.io/devtools/"> + <svg class="material-icons" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><g><path d="M14.73,13.31C15.52,12.24,16,10.93,16,9.5C16,5.91,13.09,3,9.5,3S3,5.91,3,9.5C3,13.09,5.91,16,9.5,16 c1.43,0,2.74-0.48,3.81-1.27L19.59,21L21,19.59L14.73,13.31z M9.5,14C7.01,14,5,11.99,5,9.5S7.01,5,9.5,5S14,7.01,14,9.5 S11.99,14,9.5,14z"/><polygon points="10.29,8.44 9.5,6 8.71,8.44 6.25,8.44 8.26,10.03 7.49,12.5 9.5,10.97 11.51,12.5 10.74,10.03 12.75,8.44"/></g></g></svg> + <span>Angular DevTools</span> + + <svg class="material-icons" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg> + </a> + </div> <!-- Next Steps -->
cf5cf19bb568928aaf05fb44e6122b0761f5dc8c
2019-03-21 03:38:07
Hans Larsen
feat(@angular/cli): add analytic support to commands and command-runner
false
add analytic support to commands and command-runner
feat
diff --git a/packages/angular/cli/models/analytics.ts b/packages/angular/cli/models/analytics.ts new file mode 100644 index 000000000000..b1521613fc53 --- /dev/null +++ b/packages/angular/cli/models/analytics.ts @@ -0,0 +1,483 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { analytics, json, tags, terminal } from '@angular-devkit/core'; +import * as child_process from 'child_process'; +import * as debug from 'debug'; +import { writeFileSync } from 'fs'; +import * as inquirer from 'inquirer'; +import * as os from 'os'; +import * as ua from 'universal-analytics'; +import { v4 as uuidV4 } from 'uuid'; +import { TimingOptions } from '../../../angular_devkit/core/src/analytics'; +import { getWorkspace, getWorkspaceRaw } from '../utilities/config'; + +const analyticsDebug = debug('ng:analytics'); // Generate analytics, including settings and users. +const analyticsLogDebug = debug('ng:analytics:log'); // Actual logs of events. + +const BYTES_PER_MEGABYTES = 1024 * 1024; + + +/** + * MAKE SURE TO KEEP THIS IN SYNC WITH THE TABLE AND CONTENT IN `/docs/design/analytics.md`. + * WE LIST THOSE DIMENSIONS (AND MORE). + */ +export enum AnalyticsDimensions { + NgAddCollection = 6, + NgBuildBuildEventLog = 7, +} + + +/** + * Attempt to get the Windows Language Code string. + * @private + */ +function _getWindowsLanguageCode(): string | undefined { + if (!os.platform().startsWith('win')) { + return undefined; + } + + try { + // This is true on Windows XP, 7, 8 and 10 AFAIK. Would return empty string or fail if it + // doesn't work. + return child_process.execSync('wmic.exe os get locale').toString().trim(); + } catch (_) {} + + return undefined; +} + +/** + * Get a language code. + * @private + */ +function _getLanguage() { + // Note: Windows does not expose the configured language by default. + return process.env.LANG // Default Unix env variable. + || process.env.LC_CTYPE // For C libraries. Sometimes the above isn't set. + || process.env.LANGSPEC // For Windows, sometimes this will be set (not always). + || _getWindowsLanguageCode() + || '??'; // ¯\_(ツ)_/¯ +} + +/** + * Return the number of CPUs. + * @private + */ +function _getCpuCount() { + const cpus = os.cpus(); + + // Return "(count)x(average speed)". + return cpus.length; +} + +/** + * Get the first CPU's speed. It's very rare to have multiple CPUs of different speed (in most + * non-ARM configurations anyway), so that's all we care about. + * @private + */ +function _getCpuSpeed() { + const cpus = os.cpus(); + + return Math.floor(cpus[0].speed); +} + +/** + * Get the amount of memory, in megabytes. + * @private + */ +function _getRamSize() { + // Report in megabytes. Otherwise it's too much noise. + return Math.floor(os.totalmem() / BYTES_PER_MEGABYTES); +} + +/** + * Get the Node name and version. This returns a string like "Node 10.11", or "io.js 3.5". + * @private + */ +function _getNodeVersion() { + // We use any here because p.release is a new Node construct in Node 10 (and our typings are the + // minimal version of Node we support). + const p = process as any; // tslint:disable-line:no-any + const name = typeof p.release == 'object' && typeof p.release.name == 'string' && p.release.name + || process.argv0; + + return name + ' ' + process.version; +} + +/** + * Get a numerical MAJOR.MINOR version of node. We report this as a metric. + * @private + */ +function _getNumericNodeVersion() { + const p = process.version; + const m = p.match(/\d+\.\d+/); + + return m && m[0] && parseFloat(m[0]) || 0; +} + + +// These are just approximations of UA strings. We just try to fool Google Analytics to give us the +// data we want. +// See https://developers.whatismybrowser.com/useragents/ +const osVersionMap: { [os: string]: { [release: string]: string } } = { + darwin: { + '1.3.1': '10_0_4', + '1.4.1': '10_1_0', + '5.1': '10_1_1', + '5.2': '10_1_5', + '6.0.1': '10_2', + '6.8': '10_2_8', + '7.0': '10_3_0', + '7.9': '10_3_9', + '8.0': '10_4_0', + '8.11': '10_4_11', + '9.0': '10_5_0', + '9.8': '10_5_8', + '10.0': '10_6_0', + '10.8': '10_6_8', + // We stop here because we try to math out the version for anything greater than 10, and it + // works. Those versions are standardized using a calculation now. + }, + win32: { + '6.3.9600': 'Windows 8.1', + '6.2.9200': 'Windows 8', + '6.1.7601': 'Windows 7 SP1', + '6.1.7600': 'Windows 7', + '6.0.6002': 'Windows Vista SP2', + '6.0.6000': 'Windows Vista', + '5.1.2600': 'Windows XP', + }, +}; + + +/** + * Build a fake User Agent string for OSX. This gets sent to Analytics so it shows the proper OS, + * versions and others. + * @private + */ +function _buildUserAgentStringForOsx() { + let v = osVersionMap.darwin[os.release()]; + + if (!v) { + // Remove 4 to tie Darwin version to OSX version, add other info. + const x = parseFloat(os.release()); + if (x > 10) { + v = `10_` + (x - 4).toString().replace('.', '_'); + } + } + + const cpuModel = os.cpus()[0].model.match(/^[a-z]+/i); + const cpu = cpuModel ? cpuModel[0] : os.cpus()[0].model; + + return `(Macintosh; ${cpu} Mac OS X ${v || os.release()})`; +} + +/** + * Build a fake User Agent string for Windows. This gets sent to Analytics so it shows the proper + * OS, versions and others. + * @private + */ +function _buildUserAgentStringForWindows() { + return `(Windows NT ${os.release()})`; +} + +/** + * Build a fake User Agent string for Linux. This gets sent to Analytics so it shows the proper OS, + * versions and others. + * @private + */ +function _buildUserAgentStringForLinux() { + return `(X11; Linux i686; ${os.release()}; ${os.cpus()[0].model})`; +} + +/** + * Build a fake User Agent string. This gets sent to Analytics so it shows the proper OS version. + * @private + */ +function _buildUserAgentString() { + switch (os.platform()) { + case 'darwin': + return _buildUserAgentStringForOsx(); + + case 'win32': + return _buildUserAgentStringForWindows(); + + case 'linux': + return _buildUserAgentStringForLinux(); + + default: + return os.platform() + ' ' + os.release(); + } +} + + +/** + * Implementation of the Analytics interface for using `universal-analytics` package. + */ +export class UniversalAnalytics implements analytics.Analytics { + private _ua: ua.Visitor; + private _dirty = false; + + /** + * @param trackingId The Google Analytics ID. + * @param uid A User ID. + */ + constructor(trackingId: string, uid: string) { + this._ua = ua(trackingId, uid, { + enableBatching: true, + batchSize: 5, + }); + + // Add persistent params for appVersion. + this._ua.set('ds', 'cli'); + this._ua.set('ua', _buildUserAgentString()); + this._ua.set('ul', _getLanguage()); + + // @angular/cli with version. + this._ua.set('an', require('../package.json').name); + this._ua.set('av', require('../package.json').version); + + // We use the application ID for the Node version. This should be "node 10.10.0". + // We also use a custom metrics, but + this._ua.set('aid', _getNodeVersion()); + + // We set custom metrics for values we care about. + this._ua.set('cm1', _getCpuCount()); + this._ua.set('cm2', _getCpuSpeed()); + this._ua.set('cm3', _getRamSize()); + this._ua.set('cm4', _getNumericNodeVersion()); + } + + /** + * Creates the dimension and metrics variables to pass to universal-analytics. + * @private + */ + private _customVariables(options: analytics.CustomDimensionsAndMetricsOptions) { + const additionals: { [key: string]: boolean | number | string } = {}; + (options.dimensions || []).forEach((v, i) => additionals['cd' + i] = v); + (options.metrics || []).forEach((v, i) => additionals['cm' + i] = v); + + return additionals; + } + + event(ec: string, ea: string, options: analytics.EventOptions = {}) { + const vars = this._customVariables(options); + analyticsLogDebug('event ec=%j, ea=%j, %j', ec, ea, vars); + + const { label: el, value: ev } = options; + this._dirty = true; + this._ua.event({ ec, ea, el, ev, ...vars }); + } + screenview(cd: string, an: string, options: analytics.ScreenviewOptions = {}) { + const vars = this._customVariables(options); + analyticsLogDebug('screenview cd=%j, an=%j, %j', cd, an, vars); + + const { appVersion: av, appId: aid, appInstallerId: aiid } = options; + this._dirty = true; + this._ua.screenview({ cd, an, av, aid, aiid, ...vars }); + } + pageview(dp: string, options: analytics.PageviewOptions = {}) { + const vars = this._customVariables(options); + analyticsLogDebug('pageview dp=%j, %j', dp, vars); + + const { hostname: dh, title: dt } = options; + this._dirty = true; + this._ua.pageview({ dp, dh, dt, ...vars }); + } + timing(utc: string, utv: string, utt: string | number, options: TimingOptions = {}) { + const vars = this._customVariables(options); + analyticsLogDebug('timing utc=%j, utv=%j, utl=%j, %j', utc, utv, utt, vars); + + const { label: utl } = options; + this._dirty = true; + this._ua.timing({ utc, utv, utt, utl, ...vars }); + } + + flush(): Promise<void> { + if (!this._dirty) { + return Promise.resolve(); + } + + this._dirty = false; + + return new Promise(resolve => this._ua.send(resolve)); + } +} + +/** + * Set analytics settings. This does not work if the user is not inside a project. + * @param level Which config to use. "global" for user-level, and "local" for project-level. + * @param value Either a user ID, true to generate a new User ID, or false to disable analytics. + */ +export function setAnalyticsConfig(level: 'global' | 'local', value: string | boolean) { + analyticsDebug('setting %s level analytics to: %s', level, value); + const [config, configPath] = getWorkspaceRaw(level); + if (!config || !configPath) { + throw new Error(`Could not find ${level} workspace.`); + } + + const configValue = config.value; + const cli: json.JsonValue = configValue['cli'] || (configValue['cli'] = {}); + + if (!json.isJsonObject(cli)) { + throw new Error(`Invalid config found at ${configPath}. CLI should be an object.`); + } + + if (value === true) { + value = uuidV4(); + } + cli['analytics'] = value; + + const output = JSON.stringify(configValue, null, 2); + writeFileSync(configPath, output); + analyticsDebug('done'); +} + +/** + * Prompt the user for usage gathering permission. + * @param force Whether to ask regardless of whether or not the user is using an interactive shell. + * @return Whether or not the user was shown a prompt. + */ +export async function promptGlobalAnalytics(force = false) { + analyticsDebug('prompting global analytics.'); + if (force || (process.stdout.isTTY && process.stdin.isTTY)) { + const answers = await inquirer.prompt<{ analytics: boolean }>([ + { + type: 'confirm', + name: 'analytics', + message: tags.stripIndents` + === MESSAGE TO BE FINALIZED ==== DO_NOT_SUBMIT + + Would you like to share anonymous usage data with the Angular Team at Google under + Google’s Privacy Policy at https://policies.google.com/privacy? For more details and + how to change this setting, see http://angular.io/usage/. + `, + default: false, + }, + ]); + + setAnalyticsConfig('global', answers.analytics); + + if (answers.analytics) { + console.log(''); + console.log(tags.stripIndent` + Thank you for sharing anonymous usage data. Would you change your mind, the following + command will disable this feature entirely: + + ${terminal.yellow('ng analytics off')} + `); + console.log(''); + } + + return true; + } + + return false; +} + +/** + * Prompt the user for usage gathering permission for the local project. Fails if there is no + * local workspace. + * @param force Whether to ask regardless of whether or not the user is using an interactive shell. + * @return Whether or not the user was shown a prompt. + */ +export async function promptProjectAnalytics(force = false): Promise<boolean> { + analyticsDebug('prompting user'); + const [config, configPath] = getWorkspaceRaw('local'); + if (!config || !configPath) { + throw new Error(`Could not find a local workspace. Are you in a project?`); + } + + if (force || (process.stdout.isTTY && process.stdin.isTTY)) { + const answers = await inquirer.prompt<{ analytics: boolean }>([ + { + type: 'confirm', + name: 'analytics', + message: tags.stripIndents` + === MESSAGE TO BE FINALIZED ==== DO_NOT_SUBMIT + + Would you like to share anonymous usage data about this project with the Angular Team at + Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more + details and how to change this setting, see http://angular.io/usage. + + `, + default: false, + }, + ]); + + setAnalyticsConfig('local', answers.analytics); + + if (answers.analytics) { + console.log(''); + console.log(tags.stripIndent` + === MESSAGE TO BE FINALIZED ==== DO_NOT_SUBMIT + + Thank you for sharing anonymous usage data. Would you change your mind, the following + command will disable this feature entirely: + + ${terminal.yellow('ng analytics project off')} + `); + console.log(''); + } + + return true; + } + + return false; +} + + +/** + * Get the global analytics setting for the user. This returns a string for UID, false if the user + * opted out of analytics, true if the user wants to stay anonymous (no client id), and undefined + * if the user has not been prompted yet. + * + * If any problem happens, it is considered the user has been opting out of analytics. + */ +export function getGlobalAnalytics(): string | boolean | undefined { + analyticsDebug('getGlobalAnalytics'); + + if ('NG_CLI_ANALYTICS' in process.env) { + if (process.env['NG_CLI_ANALYTICS'] == 'false' || process.env['NG_CLI_ANALYTICS'] == '') { + analyticsDebug('NG_CLI_ANALYTICS is false'); + + return false; + } + if (process.env['NG_CLI_ANALYTICS'] === 'ci') { + analyticsDebug('Running in CI mode'); + + return 'ci'; + } + } + + // If anything happens we just keep the NOOP analytics. + try { + const globalWorkspace = getWorkspace('global'); + const analyticsConfig = globalWorkspace + && globalWorkspace.getCli() + && globalWorkspace.getCli()['analytics']; + + if (analyticsConfig === false) { + return false; + } else if (analyticsConfig === undefined) { + return undefined; + } else { + let uid: string | undefined = undefined; + if (typeof analyticsConfig == 'string') { + uid = analyticsConfig; + } else if (typeof analyticsConfig == 'object' && typeof analyticsConfig['uid'] == 'string') { + uid = analyticsConfig['uid']; + } + + analyticsDebug('client id: %s', uid); + + return uid; + } + } catch { + return false; + } +} diff --git a/packages/angular/cli/models/command-runner.ts b/packages/angular/cli/models/command-runner.ts index a092540fbebb..1d54a5ac28d1 100644 --- a/packages/angular/cli/models/command-runner.ts +++ b/packages/angular/cli/models/command-runner.ts @@ -7,6 +7,7 @@ */ import { JsonParseMode, + analytics, isJsonObject, json, logging, @@ -14,10 +15,12 @@ import { strings, tags, } from '@angular-devkit/core'; +import * as debug from 'debug'; import { readFileSync } from 'fs'; import { dirname, join, resolve } from 'path'; import { findUp } from '../utilities/find-up'; import { parseJsonSchemaToCommandDescription } from '../utilities/json-schema'; +import { UniversalAnalytics, getGlobalAnalytics } from './analytics'; import { Command } from './command'; import { CommandDescription, @@ -26,23 +29,55 @@ import { } from './interface'; import * as parser from './parser'; +const analyticsDebug = debug('ng:analytics:commands'); + export interface CommandMapOptions { [key: string]: string; } + +async function _createAnalytics(): Promise<analytics.Analytics> { + const config = getGlobalAnalytics(); + + switch (config) { + case undefined: + case false: + analyticsDebug('Analytics disabled. Ignoring all analytics.'); + + return new analytics.NoopAnalytics(); + + case true: + analyticsDebug('Analytics enabled, anonymous user.'); + + return new UniversalAnalytics('UA-8594346-29', ''); + + case 'ci': + analyticsDebug('Logging analytics as CI.'); + + return new UniversalAnalytics('UA-8594346-29', 'ci'); + + default: + analyticsDebug('Analytics enabled. User ID: %j', config); + + return new UniversalAnalytics('UA-8594346-29', config); + } +} + /** * Run a command. * @param args Raw unparsed arguments. * @param logger The logger to use. * @param workspace Workspace information. * @param commands The map of supported commands. + * @param options Additional options. */ export async function runCommand( args: string[], logger: logging.Logger, workspace: CommandWorkspace, commands?: CommandMapOptions, + options: { analytics?: analytics.Analytics } = {}, ): Promise<number | void> { if (commands === undefined) { const commandMapPath = findUp('commands.json', __dirname); @@ -184,9 +219,23 @@ export async function runCommand( try { const parsedOptions = parser.parseArguments(args, description.options, logger); Command.setCommandMap(commandMap); - const command = new description.impl({ workspace }, description, logger); - return await command.validateAndRun(parsedOptions); + const analytics = options.analytics || await _createAnalytics(); + const context = { workspace, analytics }; + const command = new description.impl(context, description, logger); + + // Flush on an interval (if the event loop is waiting). + let analyticsFlushPromise = Promise.resolve(); + setInterval(() => { + analyticsFlushPromise = analyticsFlushPromise.then(() => analytics.flush()); + }, 1000); + + const result = await command.validateAndRun(parsedOptions); + + // Flush one last time. + await analyticsFlushPromise.then(() => analytics.flush()); + + return result; } catch (e) { if (e instanceof parser.ParseArgumentException) { logger.fatal('Cannot parse arguments. See below for the reasons.'); diff --git a/packages/angular/cli/models/command.ts b/packages/angular/cli/models/command.ts index 8accd58f1f77..a867576d6a6c 100644 --- a/packages/angular/cli/models/command.ts +++ b/packages/angular/cli/models/command.ts @@ -7,7 +7,7 @@ */ // tslint:disable:no-global-tslint-disable no-any -import { logging, strings, tags, terminal } from '@angular-devkit/core'; +import { analytics, logging, strings, tags, terminal } from '@angular-devkit/core'; import * as path from 'path'; import { getWorkspace } from '../utilities/config'; import { @@ -27,6 +27,7 @@ export interface BaseCommandOptions { export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> { public allowMissingWorkspace = false; public workspace: CommandWorkspace; + public analytics: analytics.Analytics; protected static commandMap: CommandDescriptionMap; static setCommandMap(map: CommandDescriptionMap) { @@ -39,6 +40,7 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> protected readonly logger: logging.Logger, ) { this.workspace = context.workspace; + this.analytics = context.analytics || new analytics.NoopAnalytics(); } async initialize(options: T & Arguments): Promise<void> { @@ -147,6 +149,24 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> } } + async reportAnalytics( + paths: string[], + options: T & Arguments, + dimensions: (boolean | number | string)[] = [], + metrics: (boolean | number | string)[] = [], + ): Promise<void> { + for (const option of this.description.options) { + const ua = option.userAnalytics; + const v = options[option.name]; + + if (v !== undefined && !Array.isArray(v) && ua) { + dimensions[ua] = v; + } + } + + this.analytics.pageview('/command/' + paths.join('/'), { dimensions }); + } + abstract async run(options: T & Arguments): Promise<number | void>; async validateAndRun(options: T & Arguments): Promise<number | void> { @@ -160,6 +180,8 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions> } else if (options.help === 'json' || options.help === 'JSON') { return this.printJsonHelp(options); } else { + await this.reportAnalytics([this.description.name], options); + return await this.run(options); } } diff --git a/packages/angular/cli/models/interface.ts b/packages/angular/cli/models/interface.ts index 48ae7ff7b0d3..17292c95269b 100644 --- a/packages/angular/cli/models/interface.ts +++ b/packages/angular/cli/models/interface.ts @@ -5,7 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import { json, logging } from '@angular-devkit/core'; +import { analytics, json, logging } from '@angular-devkit/core'; /** * Value type of arguments. @@ -57,6 +57,9 @@ export interface CommandWorkspace { */ export interface CommandContext { workspace: CommandWorkspace; + + // This feel is optional for backward compatibility. + analytics?: analytics.Analytics; } /** @@ -154,6 +157,12 @@ export interface Option { * Smart default object. */ $default?: OptionSmartDefault; + + /** + * Whether or not to report this option to the Angular Team, and which custom field to use. + * If this is falsey, do not report this option. + */ + userAnalytics?: number; } /** diff --git a/packages/angular/cli/utilities/json-schema.ts b/packages/angular/cli/utilities/json-schema.ts index 7b4422903801..c91a1e213197 100644 --- a/packages/angular/cli/utilities/json-schema.ts +++ b/packages/angular/cli/utilities/json-schema.ts @@ -255,6 +255,9 @@ export async function parseJsonSchemaToOptions( const deprecated = (xDeprecated === true || typeof xDeprecated == 'string') ? xDeprecated : undefined; + const xUserAnalytics = current['x-user-analytics']; + const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined; + const option: Option = { name, description: '' + (current.description === undefined ? '' : current.description), @@ -265,6 +268,7 @@ export async function parseJsonSchemaToOptions( aliases, ...format !== undefined ? { format } : {}, hidden, + ...userAnalytics ? { userAnalytics } : {}, ...deprecated !== undefined ? { deprecated } : {}, ...positional !== undefined ? { positional } : {}, };
e93e72f885a82ad83feeb9fba91ad7f541a166bb
2016-04-08 19:32:57
Mike Brocchi
chore: update angular2 version to 2.0.0-beta.14
false
update angular2 version to 2.0.0-beta.14
chore
diff --git a/addon/ng2/blueprints/ng2/files/package.json b/addon/ng2/blueprints/ng2/files/package.json index c46502e1c96d..18cd77f60041 100644 --- a/addon/ng2/blueprints/ng2/files/package.json +++ b/addon/ng2/blueprints/ng2/files/package.json @@ -13,7 +13,7 @@ }, "private": true, "dependencies": { - "angular2": "2.0.0-beta.13", + "angular2": "2.0.0-beta.14", "es6-shim": "^0.35.0", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2",
1227a2c84f1219cd4f8b571e48462e8fd547b248
2020-05-11 17:15:58
Alan Agius
build: remove module_name and module_root
false
remove module_name and module_root
build
diff --git a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel index 78f32ecd0b92..710e9441bedd 100644 --- a/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +++ b/packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel @@ -8,7 +8,5 @@ ts_library( name = "TypeScript", srcs = ["lib/typescript.d.ts"], data = ["lib/typescript.js"], - module_name = "typescript", - module_root = "lib/typescript.d.ts", visibility = ["//packages/schematics/angular:__subpackages__"], )
c2dd94c66193aacfd402ce2e7339cbb2677ba8ac
2016-10-15 04:18:30
Mike Brocchi
feat(generate): specify class type via dot notation (#2707)
false
specify class type via dot notation (#2707)
feat
diff --git a/packages/angular-cli/blueprints/class/index.js b/packages/angular-cli/blueprints/class/index.js index 9ddfa1a2459a..cfdc7f376098 100644 --- a/packages/angular-cli/blueprints/class/index.js +++ b/packages/angular-cli/blueprints/class/index.js @@ -6,26 +6,26 @@ const getFiles = Blueprint.prototype.files; module.exports = { description: '', - anonymousOptions: [ - '<class-type>' - ], - availableOptions: [ { name: 'spec', type: Boolean } ], normalizeEntityName: function (entityName) { - var parsedPath = dynamicPathParser(this.project, entityName); + var parsedPath = dynamicPathParser(this.project, entityName.split('.')[0]); this.dynamicPath = parsedPath; return parsedPath.name; }, locals: function (options) { - var classType = options.args [2] + const rawName = options.args[1]; + const nameParts = rawName.split('.') + .filter(part => part.length !== 0); + + const classType = nameParts[1]; this.fileName = stringUtils.dasherize(options.entity.name); if (classType) { - this.fileName += '.' + classType; + this.fileName += '.' + classType.toLowerCase(); } options.spec = options.spec !== undefined ? diff --git a/tests/acceptance/generate-class.spec.js b/tests/acceptance/generate-class.spec.js index 5ec94d056f30..dce2154ad118 100644 --- a/tests/acceptance/generate-class.spec.js +++ b/tests/acceptance/generate-class.spec.js @@ -43,8 +43,8 @@ describe('Acceptance: ng generate class', function () { }); }); - it('ng generate class my-class model', function () { - return ng(['generate', 'class', 'my-class', 'model']).then(() => { + it('ng generate class my-class.model', function () { + return ng(['generate', 'class', 'my-class.model']).then(() => { expect(existsSync(path.join(testPath, 'my-class.model.ts'))).to.equal(true); }); }); @@ -55,8 +55,8 @@ describe('Acceptance: ng generate class', function () { }); }); - it(`ng generate class shared${path.sep}my-class model`, function () { - return ng(['generate', 'class', 'shared/my-class', 'model']).then(() => { + it(`ng generate class shared${path.sep}my-class.model`, function () { + return ng(['generate', 'class', 'shared/my-class.model']).then(() => { expect(existsSync(path.join(testPath, 'shared', 'my-class.model.ts'))).to.equal(true); }); });
1ab2dff646f87ae5ec803266f6d8c079f96e1970
2022-09-26 14:58:54
Paul Gschwendtner
build: setup remote execution through shared command
false
setup remote execution through shared command
build
diff --git a/.circleci/dynamic_config.yml b/.circleci/dynamic_config.yml index 2d62c578e902..38b26536bf28 100644 --- a/.circleci/dynamic_config.yml +++ b/.circleci/dynamic_config.yml @@ -11,7 +11,7 @@ version: 2.1 orbs: browser-tools: circleci/[email protected] - devinfra: angular/[email protected] + devinfra: angular/[email protected] parameters: snapshot_changed: @@ -136,18 +136,8 @@ commands: type: env_var_name default: CIRCLE_PROJECT_REPONAME steps: - - run: - name: 'Setup bazel RBE remote execution' - command: | - touch .bazelrc.user; - # We need ensure that the same default digest is used for encoding and decoding - # with openssl. Openssl versions might have different default digests which can - # cause decryption failures based on the openssl version. https://stackoverflow.com/a/39641378/4317734 - openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k "${<< parameters.key >>}" -out /home/circleci/.gcp_credentials; - sudo bash -c "echo -e 'build --google_credentials=/home/circleci/.gcp_credentials' >> .bazelrc.user"; - # Enable remote builds - sudo bash -c "echo -e 'build --config=remote' >> .bazelrc.user"; - echo "Reading from remote cache for bazel remote jobs."; + - devinfra/setup-bazel-remote-exec: + bazelrc: ./.bazelrc.user install_python: steps: diff --git a/.circleci/gcp_token b/.circleci/gcp_token deleted file mode 100644 index 06773903e8d8..000000000000 Binary files a/.circleci/gcp_token and /dev/null differ
c6dd4696bfb50e98e7f0c7995459bc77d4154cf0
2024-09-26 01:15:46
Angular Robot
build: update angular
false
update angular
build
diff --git a/.github/workflows/assistant-to-the-branch-manager.yml b/.github/workflows/assistant-to-the-branch-manager.yml index a0f95e4b4add..b59762fac5da 100644 --- a/.github/workflows/assistant-to-the-branch-manager.yml +++ b/.github/workflows/assistant-to-the-branch-manager.yml @@ -16,6 +16,6 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: persist-credentials: false - - uses: angular/dev-infra/github-actions/branch-manager@5b6bd6567a35f60f8705021ce20cbd56abd10401 + - uses: angular/dev-infra/github-actions/branch-manager@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5a20a0821ab..3709acd4a933 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Generate JSON schema types @@ -42,11 +42,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Build release targets @@ -56,11 +56,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Run module and package tests @@ -90,13 +90,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} @@ -111,13 +111,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} @@ -132,13 +132,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} @@ -149,13 +149,13 @@ jobs: SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run E2E Browser tests env: SAUCE_USERNAME: ${{ vars.SAUCE_USERNAME }} @@ -182,11 +182,11 @@ jobs: CIRCLE_BRANCH: ${{ github.ref_name }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - run: yarn admin snapshots --verbose env: SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }} diff --git a/.github/workflows/dev-infra.yml b/.github/workflows/dev-infra.yml index 4e7630a85cf5..54d1bf03ee51 100644 --- a/.github/workflows/dev-infra.yml +++ b/.github/workflows/dev-infra.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: angular/dev-infra/github-actions/commit-message-based-labels@5b6bd6567a35f60f8705021ce20cbd56abd10401 + - uses: angular/dev-infra/github-actions/commit-message-based-labels@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} post_approval_changes: runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: angular/dev-infra/github-actions/post-approval-changes@5b6bd6567a35f60f8705021ce20cbd56abd10401 + - uses: angular/dev-infra/github-actions/post-approval-changes@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/feature-requests.yml b/.github/workflows/feature-requests.yml index f956a9ed2e80..167b2fa2b92e 100644 --- a/.github/workflows/feature-requests.yml +++ b/.github/workflows/feature-requests.yml @@ -16,6 +16,6 @@ jobs: if: github.repository == 'angular/angular-cli' runs-on: ubuntu-latest steps: - - uses: angular/dev-infra/github-actions/feature-request@5b6bd6567a35f60f8705021ce20cbd56abd10401 + - uses: angular/dev-infra/github-actions/feature-request@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dd7551aa9c27..0ac6a9b4765c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup ESLint Caching uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: @@ -54,7 +54,7 @@ jobs: - name: Run Validation run: yarn admin validate - name: Check Package Licenses - uses: angular/dev-infra/github-actions/linting/licenses@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/linting/licenses@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Check tooling setup run: yarn check-tooling-setup - name: Check commit message @@ -70,11 +70,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Build release targets @@ -90,11 +90,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Run module and package tests @@ -111,13 +111,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} @@ -132,13 +132,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} @@ -155,12 +155,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Install node modules run: yarn install --immutable - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/setup@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@5b6bd6567a35f60f8705021ce20cbd56abd10401 + uses: angular/dev-infra/github-actions/bazel/configure-remote@0bf58aff56fdef5e8644a591b32e57ca512bd5c7 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} diff --git a/package.json b/package.json index ec9aabedd97b..fb297532b15b 100644 --- a/package.json +++ b/package.json @@ -52,23 +52,23 @@ }, "devDependencies": { "@ampproject/remapping": "2.3.0", - "@angular/animations": "19.0.0-next.6", + "@angular/animations": "19.0.0-next.7", "@angular/bazel": "patch:@angular/bazel@https%3A//github.com/angular/bazel-builds.git%23commit=9e6140d1eef8ddf7113d00738f603e9cc3c310f1#~/.yarn/patches/@angular-bazel-https-9848736cf4.patch", - "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#7c83b9a375d35b804d89f48a33d170602747a338", + "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#f46197abd29ffd084e616af9b5a66d45193769e6", "@angular/cdk": "19.0.0-next.5", - "@angular/common": "19.0.0-next.6", - "@angular/compiler": "19.0.0-next.6", - "@angular/compiler-cli": "19.0.0-next.6", - "@angular/core": "19.0.0-next.6", - "@angular/forms": "19.0.0-next.6", - "@angular/localize": "19.0.0-next.6", + "@angular/common": "19.0.0-next.7", + "@angular/compiler": "19.0.0-next.7", + "@angular/compiler-cli": "19.0.0-next.7", + "@angular/core": "19.0.0-next.7", + "@angular/forms": "19.0.0-next.7", + "@angular/localize": "19.0.0-next.7", "@angular/material": "19.0.0-next.5", - "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#9794cd2757cc110ce3f7ffcbdec009f3eeae6ab3", - "@angular/platform-browser": "19.0.0-next.6", - "@angular/platform-browser-dynamic": "19.0.0-next.6", - "@angular/platform-server": "19.0.0-next.6", - "@angular/router": "19.0.0-next.6", - "@angular/service-worker": "19.0.0-next.6", + "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#39e1a11a2dfafc1284048120362b3a48d7f9a15b", + "@angular/platform-browser": "19.0.0-next.7", + "@angular/platform-browser-dynamic": "19.0.0-next.7", + "@angular/platform-server": "19.0.0-next.7", + "@angular/router": "19.0.0-next.7", + "@angular/service-worker": "19.0.0-next.7", "@babel/core": "7.25.2", "@babel/generator": "7.25.6", "@babel/helper-annotate-as-pure": "7.24.7", diff --git a/packages/angular/ssr/package.json b/packages/angular/ssr/package.json index cca74bdf9c04..665cd84391af 100644 --- a/packages/angular/ssr/package.json +++ b/packages/angular/ssr/package.json @@ -22,12 +22,12 @@ "@angular/router": "^19.0.0-next.0" }, "devDependencies": { - "@angular/common": "19.0.0-next.6", - "@angular/compiler": "19.0.0-next.6", - "@angular/core": "19.0.0-next.6", - "@angular/platform-browser": "19.0.0-next.6", - "@angular/platform-server": "19.0.0-next.6", - "@angular/router": "19.0.0-next.6", + "@angular/common": "19.0.0-next.7", + "@angular/compiler": "19.0.0-next.7", + "@angular/core": "19.0.0-next.7", + "@angular/platform-browser": "19.0.0-next.7", + "@angular/platform-server": "19.0.0-next.7", + "@angular/router": "19.0.0-next.7", "@bazel/runfiles": "^5.8.1" }, "schematics": "./schematics/collection.json", diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index e62e214fbd4f..22b10ac0df1f 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -27,8 +27,8 @@ }, "devDependencies": { "@angular-devkit/core": "0.0.0-PLACEHOLDER", - "@angular/compiler": "19.0.0-next.6", - "@angular/compiler-cli": "19.0.0-next.6", + "@angular/compiler": "19.0.0-next.7", + "@angular/compiler-cli": "19.0.0-next.7", "typescript": "5.6.2", "webpack": "5.94.0" } diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json index f9a935a1ac1d..059635ecfc7b 100644 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ b/tests/legacy-cli/e2e/ng-snapshot/package.json @@ -2,21 +2,21 @@ "description": "snapshot versions of Angular for e2e testing", "private": true, "dependencies": { - "@angular/animations": "github:angular/animations-builds#570ce43beecd742fc508be066dc3c813847e95f1", - "@angular/cdk": "github:angular/cdk-builds#2b8a27177b39fef6369d7c937be256916e4b52d9", - "@angular/common": "github:angular/common-builds#c4e14e5aee346633e72d25959ac5e67b1be9f9a6", - "@angular/compiler": "github:angular/compiler-builds#ac6ec8fe343d81898e98be812979d3b61170f2bf", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#bc1999da39249cbddada59a3be4090985ce2614f", - "@angular/core": "github:angular/core-builds#714325a425d57768ac7aff8d7000462191c48734", - "@angular/forms": "github:angular/forms-builds#bbba10f4e6231bfe317292cfa0080b2d21fcd024", - "@angular/language-service": "github:angular/language-service-builds#156892090e00f93e747b07d781cb5d8d51117199", - "@angular/localize": "github:angular/localize-builds#da5fbd4b0f50e328a0effc457afc822b87429658", - "@angular/material": "github:angular/material-builds#cd6632e5a5c8d1e1d7c40d824a3b1fa57fb3f81c", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#70dfc3a9978ad1af9aba32bc13cb5932a9dba673", - "@angular/platform-browser": "github:angular/platform-browser-builds#f4cbe66400ede1e07c5a3526889a16c416988efb", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#4893259ee0160250ca18cd19455a8179c89d9765", - "@angular/platform-server": "github:angular/platform-server-builds#8b96985add779a8d24ff981e34fbddee3c94a075", - "@angular/router": "github:angular/router-builds#f0ae27f170a2f5d20e15d3e6566c7c268028763e", - "@angular/service-worker": "github:angular/service-worker-builds#6b1b7e9dea78258cb27564517a1a4ec7a465d58c" + "@angular/animations": "github:angular/animations-builds#d5c7341155e1263e5c8dac38deeb67a9831d6dd6", + "@angular/cdk": "github:angular/cdk-builds#35718182f3189ff7cf64a81c8ea4dbb26f90391b", + "@angular/common": "github:angular/common-builds#da2cc9434e867131df1d05a9748cca6cc7b3d4e9", + "@angular/compiler": "github:angular/compiler-builds#f789e0f839a242916536eee7d557e2347e29ade8", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#90cc8da266199a65d48886e5e0318bd43e4af4f1", + "@angular/core": "github:angular/core-builds#b6a407c17636b53af2aef080db6ddc987289c991", + "@angular/forms": "github:angular/forms-builds#35579f6482c2ef4135331ed3d46120a951b4f0d7", + "@angular/language-service": "github:angular/language-service-builds#3a3db66c4690632836d6e446d2a6dfdd1abb6f1b", + "@angular/localize": "github:angular/localize-builds#0ba126cd4bff7507481e5840fe361b55a2b63c42", + "@angular/material": "github:angular/material-builds#b606b782782dc693c132ec13eb7ec71ccac806d0", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#be0bf8e6181d4efbd931d74b2332c20f226a8f5e", + "@angular/platform-browser": "github:angular/platform-browser-builds#9e883e27627308bccc0c053b546ce4c2a5348a3f", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#fd4b1652d8c534f6bd80385c11593e1787dc8328", + "@angular/platform-server": "github:angular/platform-server-builds#3b935b43509811fe83475cce33497d41dd0bf249", + "@angular/router": "github:angular/router-builds#c78a7694eba921795340c0d5457bcfd24248c9be", + "@angular/service-worker": "github:angular/service-worker-builds#1ebb25b7908b308c0293bc8ce47ff82589a0ccdd" } } diff --git a/yarn.lock b/yarn.lock index 442662128b53..5ea744ee0444 100644 --- a/yarn.lock +++ b/yarn.lock @@ -252,14 +252,14 @@ __metadata: languageName: unknown linkType: soft -"@angular/animations@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/animations@npm:19.0.0-next.6" +"@angular/animations@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/animations@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/core": 19.0.0-next.6 - checksum: 10c0/b679db6f2da75f591ef03f8a370a99448c0900734e1adaffc45608581ed95bdf2fb075a6562f877c0afdcdda7a4d8ac3a443116f1cd0cdeb0cc3779a91a02dd7 + "@angular/core": 19.0.0-next.7 + checksum: 10c0/30efc0367fcc8ead515f1c39f4f8c0a587d08d64068352e228bafd1f86f7945043c6779b929c216dd4560ee31267480b8cf93f2d897cdfac1c37568bb7b4655a languageName: node linkType: hard @@ -331,9 +331,9 @@ __metadata: languageName: node linkType: hard -"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#7c83b9a375d35b804d89f48a33d170602747a338": - version: 0.0.0-5b6bd6567a35f60f8705021ce20cbd56abd10401 - resolution: "@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#commit=7c83b9a375d35b804d89f48a33d170602747a338" +"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#f46197abd29ffd084e616af9b5a66d45193769e6": + version: 0.0.0-0bf58aff56fdef5e8644a591b32e57ca512bd5c7 + resolution: "@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#commit=f46197abd29ffd084e616af9b5a66d45193769e6" dependencies: "@angular/benchpress": "npm:0.3.0" "@angular/build": "npm:19.0.0-next.7" @@ -373,7 +373,7 @@ __metadata: dependenciesMeta: re2: built: false - checksum: 10c0/f369479944757a18bd37d34312eacb9b7eedc3df2cbb67ff499fb572e699cf0532c37e1aec3546aea85bd427fda0f9018f66c622a92008b09eead19459d26d58 + checksum: 10c0/37f8f6719b32633c7c559aea38aa3af5b252c794c0594d5d6a61619c4f20aa71d3865dbf64a14178a125b810f15c36ebf7e4990a24b720ea7f3a8c7ea24de219 languageName: node linkType: hard @@ -542,21 +542,21 @@ __metadata: languageName: unknown linkType: soft -"@angular/common@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/common@npm:19.0.0-next.6" +"@angular/common@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/common@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/core": 19.0.0-next.6 + "@angular/core": 19.0.0-next.7 rxjs: ^6.5.3 || ^7.4.0 - checksum: 10c0/56aca1bc75c43915e0e0753c750f835561b9d94a5aca1fc065e713ca6fd861df3dc359461370e313075416eeec572956f38675f8b0240ecbb4c069177d7b9d05 + checksum: 10c0/5e1bb0ec7c484c02b07d88a481b8cd91649a75dad5b9642bda33325745ef7ef4f3373295014622d0e7d731b0059656d926d8848e3674bbae35721423b04c80d9 languageName: node linkType: hard -"@angular/compiler-cli@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/compiler-cli@npm:19.0.0-next.6" +"@angular/compiler-cli@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/compiler-cli@npm:19.0.0-next.7" dependencies: "@babel/core": "npm:7.25.2" "@jridgewell/sourcemap-codec": "npm:^1.4.14" @@ -567,39 +567,39 @@ __metadata: tslib: "npm:^2.3.0" yargs: "npm:^17.2.1" peerDependencies: - "@angular/compiler": 19.0.0-next.6 + "@angular/compiler": 19.0.0-next.7 typescript: ">=5.5 <5.7" bin: ng-xi18n: bundles/src/bin/ng_xi18n.js ngc: bundles/src/bin/ngc.js ngcc: bundles/ngcc/index.js - checksum: 10c0/d79b474415ef5e3770280066b592e9c6dcb6ab1389f0c3b26d856a39d690a586cc5b055245289cb44b100b71c4caed6b0c330e67d14a614b286f32895f32a313 + checksum: 10c0/25ddd4ac3a10948fdaa3a91f389e2779809ab4dfe5b35477b9773ce458b837a471399e7d7461567366a6ac776304e0f1249547c9d46e80829dfe47652efd18f6 languageName: node linkType: hard -"@angular/compiler@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/compiler@npm:19.0.0-next.6" +"@angular/compiler@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/compiler@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/core": 19.0.0-next.6 + "@angular/core": 19.0.0-next.7 peerDependenciesMeta: "@angular/core": optional: true - checksum: 10c0/5762c38e3258d5ff97e1ac265e7da4fa3e2ec847ce0c6c5707906386e0f852a0a670729d08b8e03298a8357ad294b785086d27335cffcd5cc2dcd627bf855355 + checksum: 10c0/68b8c85eb45236aff67bf1dd69751d509f8ed4e1585d32a1c12277d6de42db2566c4cc41219deff03cf749c755ba6e7f73ffe1f3dbd9dced626297ff03b1b2ea languageName: node linkType: hard -"@angular/core@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/core@npm:19.0.0-next.6" +"@angular/core@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/core@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: rxjs: ^6.5.3 || ^7.4.0 zone.js: ~0.15.0 - checksum: 10c0/c5692c93dbb4b7a41435bcca390b872899a84e9886eac861806f0a97a572c485bfd100184a02b9bce1d09a140506bae23b8d06f1ed4990469cbd1db15f420619 + checksum: 10c0/cce267dc30b685695e97c78dc284e34c277313e328339ce874a50e946ed0d6e6f3d9785ec1a42b9e36618e89a780c4bbac2364ae179d331d77975147fc658496 languageName: node linkType: hard @@ -630,23 +630,23 @@ __metadata: resolution: "@angular/devkit-repo@workspace:." dependencies: "@ampproject/remapping": "npm:2.3.0" - "@angular/animations": "npm:19.0.0-next.6" + "@angular/animations": "npm:19.0.0-next.7" "@angular/bazel": "patch:@angular/bazel@https%3A//github.com/angular/bazel-builds.git%23commit=9e6140d1eef8ddf7113d00738f603e9cc3c310f1#~/.yarn/patches/@angular-bazel-https-9848736cf4.patch" - "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#7c83b9a375d35b804d89f48a33d170602747a338" + "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#f46197abd29ffd084e616af9b5a66d45193769e6" "@angular/cdk": "npm:19.0.0-next.5" - "@angular/common": "npm:19.0.0-next.6" - "@angular/compiler": "npm:19.0.0-next.6" - "@angular/compiler-cli": "npm:19.0.0-next.6" - "@angular/core": "npm:19.0.0-next.6" - "@angular/forms": "npm:19.0.0-next.6" - "@angular/localize": "npm:19.0.0-next.6" + "@angular/common": "npm:19.0.0-next.7" + "@angular/compiler": "npm:19.0.0-next.7" + "@angular/compiler-cli": "npm:19.0.0-next.7" + "@angular/core": "npm:19.0.0-next.7" + "@angular/forms": "npm:19.0.0-next.7" + "@angular/localize": "npm:19.0.0-next.7" "@angular/material": "npm:19.0.0-next.5" - "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#9794cd2757cc110ce3f7ffcbdec009f3eeae6ab3" - "@angular/platform-browser": "npm:19.0.0-next.6" - "@angular/platform-browser-dynamic": "npm:19.0.0-next.6" - "@angular/platform-server": "npm:19.0.0-next.6" - "@angular/router": "npm:19.0.0-next.6" - "@angular/service-worker": "npm:19.0.0-next.6" + "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#39e1a11a2dfafc1284048120362b3a48d7f9a15b" + "@angular/platform-browser": "npm:19.0.0-next.7" + "@angular/platform-browser-dynamic": "npm:19.0.0-next.7" + "@angular/platform-server": "npm:19.0.0-next.7" + "@angular/router": "npm:19.0.0-next.7" + "@angular/service-worker": "npm:19.0.0-next.7" "@babel/core": "npm:7.25.2" "@babel/generator": "npm:7.25.6" "@babel/helper-annotate-as-pure": "npm:7.24.7" @@ -800,36 +800,36 @@ __metadata: languageName: unknown linkType: soft -"@angular/forms@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/forms@npm:19.0.0-next.6" +"@angular/forms@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/forms@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/common": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 - "@angular/platform-browser": 19.0.0-next.6 + "@angular/common": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 + "@angular/platform-browser": 19.0.0-next.7 rxjs: ^6.5.3 || ^7.4.0 - checksum: 10c0/b8b781c8670e73262fa1b75dd0f75fe6ba72a51f935332c833c106d0019f637cf48ace2d21193e2cea3018828de3b071b56fa12a294b6cd38b90508a608ce3d4 + checksum: 10c0/01aa3e81b0d3caaae2e58c8b58befb21e228f5979deda9efc0f0f19c37f30a6fda035d26eddcc5b58e46f28dfd1efbf983e4da5905dd099977962dc248efd851 languageName: node linkType: hard -"@angular/localize@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/localize@npm:19.0.0-next.6" +"@angular/localize@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/localize@npm:19.0.0-next.7" dependencies: "@babel/core": "npm:7.25.2" "@types/babel__core": "npm:7.20.5" fast-glob: "npm:3.3.2" yargs: "npm:^17.2.1" peerDependencies: - "@angular/compiler": 19.0.0-next.6 - "@angular/compiler-cli": 19.0.0-next.6 + "@angular/compiler": 19.0.0-next.7 + "@angular/compiler-cli": 19.0.0-next.7 bin: localize-extract: tools/bundles/src/extract/cli.js localize-migrate: tools/bundles/src/migrate/cli.js localize-translate: tools/bundles/src/translate/cli.js - checksum: 10c0/767ef1e3863092b471492cf97dbb0fd9e533ba7720f0ff7c5b6b91770b091f217bd0563b170b4d245f4e861b58a5f88b7e38951ec1ea9aaea5f7264dbba7a900 + checksum: 10c0/2351bad75d531522a5e8a2605017547cc44df88ec1442b5105d1134aa61f63b3da6243be32a4b18a5f4b67a69c4083cefd8bca355fd46a60c97cb847ed63dd5d languageName: node linkType: hard @@ -850,9 +850,9 @@ __metadata: languageName: node linkType: hard -"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#9794cd2757cc110ce3f7ffcbdec009f3eeae6ab3": - version: 0.0.0-5b6bd6567a35f60f8705021ce20cbd56abd10401 - resolution: "@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#commit=9794cd2757cc110ce3f7ffcbdec009f3eeae6ab3" +"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#39e1a11a2dfafc1284048120362b3a48d7f9a15b": + version: 0.0.0-0bf58aff56fdef5e8644a591b32e57ca512bd5c7 + resolution: "@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#commit=39e1a11a2dfafc1284048120362b3a48d7f9a15b" dependencies: "@octokit/rest": "npm:21.0.2" "@types/semver": "npm:^7.3.6" @@ -866,53 +866,53 @@ __metadata: yaml: "npm:2.5.1" bin: ng-dev: ./bundles/cli.mjs - checksum: 10c0/26a308d6128bf050aad03b3af665c9041d987ff5032b06ff1e866e8d62481ea79b59cd0d78dd52c2675d96f0af2d12379d944249bed72af909fab08e517a7c62 + checksum: 10c0/9b3e542e1429e5840da3ac374b2d9be635a435e032939751dc53333608e8596f7223eeb6345fa120a28b689b8cde97c172b726573fdb11f5fa80192760bb1000 languageName: node linkType: hard -"@angular/platform-browser-dynamic@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/platform-browser-dynamic@npm:19.0.0-next.6" +"@angular/platform-browser-dynamic@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/platform-browser-dynamic@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/common": 19.0.0-next.6 - "@angular/compiler": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 - "@angular/platform-browser": 19.0.0-next.6 - checksum: 10c0/1c27e7ba0821c0002d1d66bfff1419f2296b7695667c1eccb61cd17689d56b2561eb3627dea24cd72539bb3018967fafe6fc9594669b5c440b5640dccef32aef + "@angular/common": 19.0.0-next.7 + "@angular/compiler": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 + "@angular/platform-browser": 19.0.0-next.7 + checksum: 10c0/0c125cab63644223386b56e82015442c1c73e761139805cfa8962891116e9f9842f3533c514fa1db5c3da2b6c52b57bf53cf701c74cee760f5afc66c3c57da6b languageName: node linkType: hard -"@angular/platform-browser@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/platform-browser@npm:19.0.0-next.6" +"@angular/platform-browser@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/platform-browser@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/animations": 19.0.0-next.6 - "@angular/common": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 + "@angular/animations": 19.0.0-next.7 + "@angular/common": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 peerDependenciesMeta: "@angular/animations": optional: true - checksum: 10c0/436aaa45030044e36c55c44528718afc3e203e58c1fa7b7e33de5bafde734647d5057f126f7e62ea54e8c6298d0fab902be2e83a6ed15343cb01fc1b8104d33c + checksum: 10c0/66ec91c27b100560e0959f82030a2f213acd04e3fb7d878b682eaf9a4a4fa73f8bd69aa9f23cdd64fd082e3ead04fda3eda0f9f3fb6c0e54a3dbc9cccb5dc4fe languageName: node linkType: hard -"@angular/platform-server@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/platform-server@npm:19.0.0-next.6" +"@angular/platform-server@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/platform-server@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" xhr2: "npm:^0.2.0" peerDependencies: - "@angular/animations": 19.0.0-next.6 - "@angular/common": 19.0.0-next.6 - "@angular/compiler": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 - "@angular/platform-browser": 19.0.0-next.6 - checksum: 10c0/b4f5eaeb099ad13d431b48123a95742d5dda2f971b53593189078a5ea6fd2fe0b32b31b16d5c38fcc69409524ef8b7bfb5e8d516c70892e8abdc8747787080b3 + "@angular/animations": 19.0.0-next.7 + "@angular/common": 19.0.0-next.7 + "@angular/compiler": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 + "@angular/platform-browser": 19.0.0-next.7 + checksum: 10c0/9287abb84b6948118bdacf4d81b51d825c9a492033a03c2e1d40978963bb1baa1020eef4f9821d81d29450fed87efd150b3db4d91289254f9c7877408e26e3f9 languageName: node linkType: hard @@ -931,31 +931,31 @@ __metadata: languageName: unknown linkType: soft -"@angular/router@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/router@npm:19.0.0-next.6" +"@angular/router@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/router@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/common": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 - "@angular/platform-browser": 19.0.0-next.6 + "@angular/common": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 + "@angular/platform-browser": 19.0.0-next.7 rxjs: ^6.5.3 || ^7.4.0 - checksum: 10c0/0e1332a64ac2f445a7789deac18d3e304691f46c0d63cea443360655d701eb064b26cb16e90d0510b9674b3a5e9379e462ed83886092d79dc6d07fdf2eb37be9 + checksum: 10c0/aec59c3f7a5a62edc9faa40514f64534e4023e6871a1c261d4ce6e6a1e764c303abd03a16e8b3fddef41644eb8fb59233aa9c18f3ead9bc8beab40e4ca3a25cf languageName: node linkType: hard -"@angular/service-worker@npm:19.0.0-next.6": - version: 19.0.0-next.6 - resolution: "@angular/service-worker@npm:19.0.0-next.6" +"@angular/service-worker@npm:19.0.0-next.7": + version: 19.0.0-next.7 + resolution: "@angular/service-worker@npm:19.0.0-next.7" dependencies: tslib: "npm:^2.3.0" peerDependencies: - "@angular/common": 19.0.0-next.6 - "@angular/core": 19.0.0-next.6 + "@angular/common": 19.0.0-next.7 + "@angular/core": 19.0.0-next.7 bin: ngsw-config: ngsw-config.js - checksum: 10c0/ab1b46302c28e6fa5b3b72ca18be375fdf7a424ebc8fbd350384fdcae3189750796104855657156228785f7b8aff6d832f2d34bc2b8086cce620db6644201e5b + checksum: 10c0/3de0edc6affe58912bb346ada56468fe7cfbd2d2ca533832f157a1524edbaddd5d564cc567c68412840a51b7244de1cc3027c34f893c34c6c0867b973fdd5b47 languageName: node linkType: hard @@ -963,12 +963,12 @@ __metadata: version: 0.0.0-use.local resolution: "@angular/ssr@workspace:packages/angular/ssr" dependencies: - "@angular/common": "npm:19.0.0-next.6" - "@angular/compiler": "npm:19.0.0-next.6" - "@angular/core": "npm:19.0.0-next.6" - "@angular/platform-browser": "npm:19.0.0-next.6" - "@angular/platform-server": "npm:19.0.0-next.6" - "@angular/router": "npm:19.0.0-next.6" + "@angular/common": "npm:19.0.0-next.7" + "@angular/compiler": "npm:19.0.0-next.7" + "@angular/core": "npm:19.0.0-next.7" + "@angular/platform-browser": "npm:19.0.0-next.7" + "@angular/platform-server": "npm:19.0.0-next.7" + "@angular/router": "npm:19.0.0-next.7" "@bazel/runfiles": "npm:^5.8.1" tslib: "npm:^2.3.0" peerDependencies: @@ -3793,8 +3793,8 @@ __metadata: resolution: "@ngtools/webpack@workspace:packages/ngtools/webpack" dependencies: "@angular-devkit/core": "npm:0.0.0-PLACEHOLDER" - "@angular/compiler": "npm:19.0.0-next.6" - "@angular/compiler-cli": "npm:19.0.0-next.6" + "@angular/compiler": "npm:19.0.0-next.7" + "@angular/compiler-cli": "npm:19.0.0-next.7" typescript: "npm:5.6.2" webpack: "npm:5.94.0" peerDependencies:
d47b4417d46f85f9f5bb460576d32aa0104e6d43
2021-04-12 23:38:43
Charles Lyding
feat(@angular-devkit/build-angular): support processing component inline CSS styles
false
support processing component inline CSS styles
feat
diff --git a/packages/angular_devkit/build_angular/src/browser/specs/styles_spec.ts b/packages/angular_devkit/build_angular/src/browser/specs/styles_spec.ts index faee30b1d996..7e8e64ec45e5 100644 --- a/packages/angular_devkit/build_angular/src/browser/specs/styles_spec.ts +++ b/packages/angular_devkit/build_angular/src/browser/specs/styles_spec.ts @@ -124,6 +124,56 @@ describe('Browser Builder styles', () => { await browserBuild(architect, host, target, { extractCss: true }); }); + it('supports autoprefixer with inline component styles in JIT mode', async () => { + host.writeMultipleFiles({ + './src/app/app.component.ts': ` + import { Component } from '@angular/core'; + + @Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styles: ['div { flex: 1 }'], + }) + export class AppComponent { + title = 'app'; + } + `, + '.browserslistrc': 'IE 10', + }); + + // Set target to ES5 to avoid differential loading and unnecessary testing time + host.replaceInFile('tsconfig.json', '"target": "es2017"', '"target": "es5"'); + + const { files } = await browserBuild(architect, host, target, { aot: false }); + + expect(await files['main.js']).toContain('-ms-flex: 1;'); + }); + + it('supports autoprefixer with inline component styles in AOT mode', async () => { + host.writeMultipleFiles({ + './src/app/app.component.ts': ` + import { Component } from '@angular/core'; + + @Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styles: ['div { flex: 1 }'], + }) + export class AppComponent { + title = 'app'; + } + `, + '.browserslistrc': 'IE 10', + }); + + // Set target to ES5 to avoid differential loading and unnecessary testing time + host.replaceInFile('tsconfig.json', '"target": "es2017"', '"target": "es5"'); + + const { files } = await browserBuild(architect, host, target, { aot: true }); + + expect(await files['main.js']).toContain('-ms-flex: 1;'); + }); + extensionsWithImportSupport.forEach(ext => { it(`supports imports in ${ext} files`, async () => { host.writeMultipleFiles({ @@ -456,7 +506,8 @@ describe('Browser Builder styles', () => { main = await files['main.js']; expect(styles).toContain(`url('/assets/global-img-absolute.svg')`); expect(main).toContain(`url('/assets/component-img-absolute.svg')`); - }); + // NOTE: Timeout for large amount of builds in test. Test should be split up when refactored. + }, 4 * 60 * 1000); it(`supports bootstrap@4 with full path`, async () => { const bootstrapPath = dirname(require.resolve('bootstrap/package.json')); diff --git a/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts b/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts index 7beee6ec2c2e..d3b59f85c07f 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts @@ -17,7 +17,11 @@ import { RemoveHashPlugin, SuppressExtractedTextChunksWebpackPlugin, } from '../plugins'; -import { assetNameTemplateFactory, getOutputHashFormat, normalizeExtraEntryPoints } from '../utils/helpers'; +import { + assetNameTemplateFactory, + getOutputHashFormat, + normalizeExtraEntryPoints, +} from '../utils/helpers'; function resolveGlobalStyles( styleEntrypoints: ExtraEntryPoint[], @@ -80,7 +84,8 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio const hashFormat = getOutputHashFormat(buildOptions.outputHashing as string); // use includePaths from appConfig - const includePaths = buildOptions.stylePreprocessorOptions?.includePaths?.map(p => path.resolve(root, p)) ?? []; + const includePaths = + buildOptions.stylePreprocessorOptions?.includePaths?.map((p) => path.resolve(root, p)) ?? []; // Process global styles. const { entryPoints, noInjectNames, paths: globalStylePaths } = resolveGlobalStyles( @@ -143,7 +148,7 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio const { supportedBrowsers } = new BuildBrowserFeatures(wco.projectRoot); const postcssOptionsCreator = (inlineSourcemaps: boolean, extracted: boolean | undefined) => { // tslint:disable-next-line: no-any - return (loader: any) => ({ + const optionGenerator = (loader: any) => ({ map: inlineSourcemaps ? { inline: true, @@ -152,7 +157,7 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio : undefined, plugins: [ postcssImports({ - resolve: (url: string) => url.startsWith('~') ? url.substr(1) : url, + resolve: (url: string) => (url.startsWith('~') ? url.substr(1) : url), load: (filename: string) => { return new Promise<string>((resolve, reject) => { loader.fs.readFile(filename, (err: Error, data: Buffer) => { @@ -186,24 +191,26 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio }), ], }); + // postcss-loader fails when trying to determine configuration files for data URIs + optionGenerator.config = false; + + return optionGenerator; }; // load component css as raw strings const componentsSourceMap = !!( - cssSourceMap + cssSourceMap && // Never use component css sourcemap when style optimizations are on. // It will just increase bundle size without offering good debug experience. - && !buildOptions.optimization.styles.minify + !buildOptions.optimization.styles.minify && // Inline all sourcemap types except hidden ones, which are the same as no sourcemaps // for component css. - && !buildOptions.sourceMap.hidden + !buildOptions.sourceMap.hidden ); if (buildOptions.extractCss) { // extract global css from js files into own css file. - extraPlugins.push( - new MiniCssExtractPlugin({ filename: `[name]${hashFormat.extract}.css` }), - ); + extraPlugins.push(new MiniCssExtractPlugin({ filename: `[name]${hashFormat.extract}.css` })); if (!buildOptions.hmr) { // don't remove `.js` files for `.css` when we are using HMR these contain HMR accept codes. @@ -212,129 +219,150 @@ export function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuratio } } - // Rule for all supported style types - const styleRule: webpack.RuleSetRule = { - test: /\.(?:css|scss|sass|less|styl)$/, - rules: [ - // Setup processing rules for global and component styles - { - oneOf: [ - // Component styles are all styles except defined global styles - { - exclude: globalStylePaths, - use: [ - { loader: require.resolve('raw-loader') }, - { - loader: require.resolve('postcss-loader'), - options: { - implementation: require('postcss'), - postcssOptions: postcssOptionsCreator(componentsSourceMap, false), - }, - }, - ], - }, - // Global styles are only defined global styles - { - include: globalStylePaths, - use: [ - buildOptions.extractCss - ? { - loader: MiniCssExtractPlugin.loader, - } - : require.resolve('style-loader'), - { - loader: require.resolve('css-loader'), - options: { - url: false, - sourceMap: !!cssSourceMap, - }, - }, - { - loader: require.resolve('postcss-loader'), - options: { - implementation: require('postcss'), - postcssOptions: postcssOptionsCreator(false, buildOptions.extractCss), - sourceMap: !!cssSourceMap, - }, - }, - ], - }, - ], + const componentStyleLoaders: webpack.RuleSetUseItem[] = [ + { loader: require.resolve('raw-loader') }, + { + loader: require.resolve('postcss-loader'), + options: { + implementation: require('postcss'), + postcssOptions: postcssOptionsCreator(componentsSourceMap, false), + }, + }, + ]; + + const globalStyleLoaders: webpack.RuleSetUseItem[] = [ + buildOptions.extractCss + ? { + loader: MiniCssExtractPlugin.loader, + } + : require.resolve('style-loader'), + { + loader: require.resolve('css-loader'), + options: { + url: false, + sourceMap: !!cssSourceMap, + }, + }, + { + loader: require.resolve('postcss-loader'), + options: { + implementation: require('postcss'), + postcssOptions: postcssOptionsCreator(false, buildOptions.extractCss), + sourceMap: !!cssSourceMap, }, - // Setup preprocessor rules for all styles - { - oneOf: [ - // No preprocessing required for CSS - { test: /\.css$/, use: [] }, - { - test: /\.scss$|\.sass$/, - use: [ - { - loader: require.resolve('resolve-url-loader'), - options: { - sourceMap: cssSourceMap, - }, - }, - { - loader: require.resolve('sass-loader'), - options: { - implementation: sassImplementation, - sourceMap: true, - sassOptions: { - // bootstrap-sass requires a minimum precision of 8 - precision: 8, - includePaths, - // Use expanded as otherwise sass will remove comments that are needed for autoprefixer - // Ex: /* autoprefixer grid: autoplace */ - // tslint:disable-next-line: max-line-length - // See: https://github.com/webpack-contrib/sass-loader/blob/45ad0be17264ceada5f0b4fb87e9357abe85c4ff/src/getSassOptions.js#L68-L70 - outputStyle: 'expanded', - }, - }, - }, - ], + }, + ]; + + const styleLanguages: { + extensions: string[]; + mimetype?: string; + use: webpack.RuleSetUseItem[]; + }[] = [ + { + extensions: ['css'], + mimetype: 'text/css', + use: [], + }, + { + extensions: ['sass', 'scss'], + use: [ + { + loader: require.resolve('resolve-url-loader'), + options: { + sourceMap: cssSourceMap, + }, + }, + { + loader: require.resolve('sass-loader'), + options: { + implementation: sassImplementation, + sourceMap: true, + sassOptions: { + // bootstrap-sass requires a minimum precision of 8 + precision: 8, + includePaths, + // Use expanded as otherwise sass will remove comments that are needed for autoprefixer + // Ex: /* autoprefixer grid: autoplace */ + // tslint:disable-next-line: max-line-length + // See: https://github.com/webpack-contrib/sass-loader/blob/45ad0be17264ceada5f0b4fb87e9357abe85c4ff/src/getSassOptions.js#L68-L70 + outputStyle: 'expanded', + }, }, - { - test: /\.less$/, - use: [ - { - loader: require.resolve('less-loader'), - options: { - implementation: require('less'), - sourceMap: cssSourceMap, - lessOptions: { - javascriptEnabled: true, - paths: includePaths, - }, - }, - }, - ], + }, + ], + }, + { + extensions: ['less'], + use: [ + { + loader: require.resolve('less-loader'), + options: { + implementation: require('less'), + sourceMap: cssSourceMap, + lessOptions: { + javascriptEnabled: true, + paths: includePaths, + }, }, - { - test: /\.styl$/, - use: [ - { - loader: require.resolve('stylus-loader'), - options: { - sourceMap: cssSourceMap, - stylusOptions: { - compress: false, - sourceMap: { comment: false }, - paths: includePaths, - }, - }, - }, - ], + }, + ], + }, + { + extensions: ['styl'], + use: [ + { + loader: require.resolve('stylus-loader'), + options: { + sourceMap: cssSourceMap, + stylusOptions: { + compress: false, + sourceMap: { comment: false }, + paths: includePaths, + }, }, - ], - }, - ], - }; + }, + ], + }, + ]; + + const inlineLanguageRules: webpack.RuleSetRule[] = []; + const fileLanguageRules: webpack.RuleSetRule[] = []; + for (const language of styleLanguages) { + if (language.mimetype) { + // inline component styles use data URIs and processing is selected by mimetype + inlineLanguageRules.push({ + mimetype: language.mimetype, + use: [...componentStyleLoaders, ...language.use], + }); + } + + fileLanguageRules.push({ + test: new RegExp(`\\.(?:${language.extensions.join('|')})$`, 'i'), + rules: [ + // Setup processing rules for global and component styles + { + oneOf: [ + // Component styles are all styles except defined global styles + { + exclude: globalStylePaths, + use: componentStyleLoaders, + }, + // Global styles are only defined global styles + { + include: globalStylePaths, + use: globalStyleLoaders, + }, + ], + }, + { use: language.use }, + ], + }); + } return { entry: entryPoints, module: { - rules: [styleRule], + rules: [...fileLanguageRules, ...inlineLanguageRules], }, plugins: extraPlugins, }; diff --git a/packages/angular_devkit/build_angular/src/webpack/configs/typescript.ts b/packages/angular_devkit/build_angular/src/webpack/configs/typescript.ts index 58ef4baf5028..36add374b1c8 100644 --- a/packages/angular_devkit/build_angular/src/webpack/configs/typescript.ts +++ b/packages/angular_devkit/build_angular/src/webpack/configs/typescript.ts @@ -57,6 +57,7 @@ function createIvyPlugin( fileReplacements, jitMode: !aot, emitNgModuleScope: !optimize, + inlineStyleMimeType: 'text/css', }); } diff --git a/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts b/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts index 43d0f5726b64..dc4d18765d12 100644 --- a/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts +++ b/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts @@ -56,11 +56,12 @@ export default async function () { '--output-path=dist/second', ); + const chunkId = '751'; const codeHashES5 = createHash('sha384') - .update(await readFile('dist/first/434-es5.js')) + .update(await readFile(`dist/first/${chunkId}-es5.js`)) .digest('base64'); const codeHashes2017 = createHash('sha384') - .update(await readFile('dist/first/434-es2017.js')) + .update(await readFile(`dist/first/${chunkId}-es2017.js`)) .digest('base64'); await expectFileToMatch('dist/first/runtime-es5.js', 'sha384-' + codeHashES5); diff --git a/tests/legacy-cli/e2e/tests/build/worker.ts b/tests/legacy-cli/e2e/tests/build/worker.ts index eb86bdae5c9d..5bc1866cc99a 100644 --- a/tests/legacy-cli/e2e/tests/build/worker.ts +++ b/tests/legacy-cli/e2e/tests/build/worker.ts @@ -35,10 +35,11 @@ export default async function () { await expectFileToMatch('dist/test-project/main-es2017.js', 'src_app_app_worker_ts'); await ng('build', '--output-hashing=none'); - await expectFileToExist('dist/test-project/609-es5.js'); - await expectFileToMatch('dist/test-project/main-es5.js', '609'); - await expectFileToExist('dist/test-project/609-es2017.js'); - await expectFileToMatch('dist/test-project/main-es2017.js', '609'); + const chunkId = '283'; + await expectFileToExist(`dist/test-project/${chunkId}-es5.js`); + await expectFileToMatch('dist/test-project/main-es5.js', chunkId); + await expectFileToExist(`dist/test-project/${chunkId}-es2017.js`); + await expectFileToMatch('dist/test-project/main-es2017.js', chunkId); // console.warn has to be used because chrome only captures warnings and errors by default // https://github.com/angular/protractor/issues/2207
58a648aadc0e6d9b1ff2107df0f67ca60eae7ef6
2024-11-06 00:08:39
Alan Agius
fix(@angular/ssr): add validation to prevent use of `provideServerRoutesConfig` in browser context
false
add validation to prevent use of `provideServerRoutesConfig` in browser context
fix
diff --git a/packages/angular/ssr/src/global.d.ts b/packages/angular/ssr/src/global.d.ts index 3465e8098860..a1aa4ddd4684 100644 --- a/packages/angular/ssr/src/global.d.ts +++ b/packages/angular/ssr/src/global.d.ts @@ -7,3 +7,15 @@ */ declare const ngDevMode: boolean | undefined; + +/** + * Indicates whether the application is operating in server-rendering mode. + * + * `ngServerMode` is a global flag set by Angular's server-side rendering mechanisms, + * typically configured by `provideServerRendering` and `platformServer` during runtime. + * + * @remarks + * - **Internal Angular Flag**: This is an *internal* Angular flag (not a public API), avoid relying on it in application code. + * - **Avoid Direct Use**: This variable is intended for runtime configuration; it should not be accessed directly in application code. + */ +declare const ngServerMode: boolean | undefined; diff --git a/packages/angular/ssr/src/routes/route-config.ts b/packages/angular/ssr/src/routes/route-config.ts index ac6fd6203bca..e9271f5e111b 100644 --- a/packages/angular/ssr/src/routes/route-config.ts +++ b/packages/angular/ssr/src/routes/route-config.ts @@ -169,6 +169,12 @@ export const SERVER_ROUTES_CONFIG = new InjectionToken<ServerRoute[]>('SERVER_RO * @developerPreview */ export function provideServerRoutesConfig(routes: ServerRoute[]): EnvironmentProviders { + if (typeof ngServerMode === 'undefined' || !ngServerMode) { + throw new Error( + `The 'provideServerRoutesConfig' function should not be invoked within the browser portion of the application.`, + ); + } + return makeEnvironmentProviders([ { provide: SERVER_ROUTES_CONFIG,
8a3accc5ee8ead99a2a3377f4e224ef4f5435b26
2020-01-22 23:58:10
Keen Yee Liau
build: upgrade typescript to 3.7.4
false
upgrade typescript to 3.7.4
build
diff --git a/package.json b/package.json index 5af3a82928e2..d19f2574b8e0 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "tslib": "~1.10.0", "tslint": "^5.18.0", "tsutils": "^3.0.0", - "typescript": "~3.6.4", + "typescript": "~3.7.4", "xhr2": "^0.2.0", "zone.js": "^0.10.2" } diff --git a/yarn.lock b/yarn.lock index b65fb93af99f..c8b1fa0c338b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2185,19 +2185,11 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arg@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" @@ -3302,11 +3294,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -3756,11 +3743,6 @@ deep-equal@^1.0.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -3841,11 +3823,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -3869,11 +3846,6 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-node@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" @@ -4800,20 +4772,6 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - genfun@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" @@ -5023,11 +4981,6 @@ has-symbols@^1.0.0, has-symbols@^1.0.1: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -5266,7 +5219,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" [email protected], iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: [email protected], iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -5395,7 +5348,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= [email protected], ini@^1.3.4, ini@~1.3.0: [email protected], ini@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -6911,15 +6864,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -needle@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" - integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - [email protected]: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -6988,22 +6932,6 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-releases@^1.1.44: version "1.1.45" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.45.tgz#4cf7e9175d71b1317f15ffd68ce63bce1d53e9f2" @@ -7025,14 +6953,6 @@ [email protected]: dependencies: abbrev "1" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.4.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -7107,7 +7027,7 @@ npm-package-arg@^7.0.0: semver "^5.6.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.12, npm-packlist@^1.1.6: +npm-packlist@^1.1.12: version "1.4.7" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.7.tgz#9e954365a06b80b18111ea900945af4f88ed4848" integrity sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ== @@ -7144,16 +7064,6 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nth-check@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -7405,7 +7315,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.4, osenv@^0.1.5: +osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -8371,16 +8281,6 @@ [email protected]: loader-utils "^1.1.0" schema-utils "^2.0.1" -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" @@ -8443,7 +8343,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -8759,7 +8659,7 @@ [email protected]: dependencies: glob "^7.1.3" -rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1: +rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -8916,7 +8816,7 @@ saucelabs@^1.5.0: dependencies: https-proxy-agent "^2.2.1" -sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4: +sax@>=0.6.0, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -9088,7 +8988,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/server-destroy/-/server-destroy-1.0.1.tgz#f13bf928e42b9c3e79383e61cc3998b5d14e6cdd" integrity sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0= -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -9635,7 +9535,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -9743,11 +9643,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - [email protected]: version "1.0.0" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.0.0.tgz#1d5296f9165e8e2c85d24eee0b7caf9ec8ca1f82" @@ -9853,7 +9748,7 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4.4.10, tar@^4.4.2: +tar@^4.4.10: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== @@ -10192,7 +10087,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= [email protected], typescript@~3.6.4: [email protected]: version "3.6.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d" integrity sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg== @@ -10202,6 +10097,11 @@ typescript@~3.7.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19" integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw== +typescript@~3.7.4: + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== + [email protected]: version "0.7.17" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" @@ -10725,13 +10625,6 @@ which@^1.1.1, which@^1.2.1, which@^1.2.9, which@^1.3.0, which@^1.3.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075"
04b818436e81b53cf61239c9eec559c407d7fb69
2025-01-08 18:42:01
Paul Gschwendtner
build: do not include tsconfig files in npm archives
false
do not include tsconfig files in npm archives
build
diff --git a/tools/interop.bzl b/tools/interop.bzl index f0dd3ce765f0..c6d8c0a117af 100644 --- a/tools/interop.bzl +++ b/tools/interop.bzl @@ -45,13 +45,12 @@ def _ts_project_module_impl(ctx): # Filter runfiles to not `node_modules` from Aspect as this interop # target is supposed to be used downstream by `rules_nodejs` consumers, # and mixing pnpm-style node modules with linker node modules is incompatible. - filtered = [] + filtered_runfiles = [] for f in runfiles.files.to_list(): if f.short_path.startswith("node_modules/"): continue - filtered.append(f) - - runfiles = ctx.runfiles(files = filtered) + filtered_runfiles.append(f) + runfiles = ctx.runfiles(files = filtered_runfiles) providers = [ DefaultInfo( @@ -62,8 +61,8 @@ def _ts_project_module_impl(ctx): sources = depset(transitive = [info.transitive_sources]), ), DeclarationInfo( - declarations = info.types, - transitive_declarations = info.transitive_types, + declarations = _filter_types_depset(info.types), + transitive_declarations = _filter_types_depset(info.transitive_types), type_blocklisted_declarations = depset(), ), ] @@ -135,3 +134,17 @@ def ts_project(name, module_name = None, interop_deps = [], deps = [], testonly deps = [] + interop_deps + deps, module_name = module_name, ) + +# Filter type provider to not include `.json` files. `ts_config` +# targets are included in `ts_project` and their tsconfig json file +# is included as type. See: +# https://github.com/aspect-build/rules_ts/blob/main/ts/private/ts_config.bzl#L55C63-L55C68. +def _filter_types_depset(types_depset): + types = [] + + for t in types_depset.to_list(): + if t.short_path.endswith(".json"): + continue + types.append(t) + + return depset(types)
02c50fbd6a5d278eec4220687c5639ae938227c1
2019-11-27 02:37:42
Alan Agius
refactor(@angular-devkit/build-angular): deprecate karma `environment` option
false
deprecate karma `environment` option
refactor
diff --git a/packages/angular_devkit/build_angular/src/karma/schema.json b/packages/angular_devkit/build_angular/src/karma/schema.json index 9bf96efe307e..79f2df99decf 100644 --- a/packages/angular_devkit/build_angular/src/karma/schema.json +++ b/packages/angular_devkit/build_angular/src/karma/schema.json @@ -61,7 +61,8 @@ }, "environment": { "type": "string", - "description": "Defines the build environment." + "description": "Defines the build environment.", + "x-deprecated": "This option has no effect." }, "include": { "type": "array",
f3c8eb94042b7bdc6eab202f6609e5a01698f987
2021-09-23 08:11:22
Doug Parker
docs: release notes for the v12.2.7 release
false
release notes for the v12.2.7 release
docs
diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3ce793101c..749b89cd4ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,22 @@ Alan Agius and Charles Lyding +<a name="12.2.7"></a> + +# 12.2.7 (2021-09-22) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | +| [d856b4d23](https://github.com/angular/angular-cli/commit/d856b4d2369bea76ce65fc5f6d1585145ad41618) | fix | support WASM-based esbuild optimizer fallback | + +## Special Thanks + +Alan Agius and Charles Lyding + +<!-- CHANGELOG SPLIT MARKER --> + <a name="13.0.0-next.5"></a> # 13.0.0-next.5 (2021-09-15)
7a91323189b54634826c3b5f19f5734d34240297
2024-01-09 23:12:06
Angular Robot
build: update all non-major dependencies
false
update all non-major dependencies
build
diff --git a/package.json b/package.json index c4a867a9820e..c7cdd845122e 100644 --- a/package.json +++ b/package.json @@ -83,8 +83,8 @@ "@babel/plugin-transform-async-generator-functions": "7.23.7", "@babel/plugin-transform-async-to-generator": "7.23.3", "@babel/plugin-transform-runtime": "7.23.7", - "@babel/preset-env": "7.23.7", - "@babel/runtime": "7.23.7", + "@babel/preset-env": "7.23.8", + "@babel/runtime": "7.23.8", "@bazel/bazelisk": "1.19.0", "@bazel/buildifier": "6.4.0", "@bazel/concatjs": "5.8.1", @@ -118,8 +118,8 @@ "@types/yargs": "^17.0.20", "@types/yargs-parser": "^21.0.0", "@types/yarnpkg__lockfile": "^1.1.5", - "@typescript-eslint/eslint-plugin": "6.17.0", - "@typescript-eslint/parser": "6.17.0", + "@typescript-eslint/eslint-plugin": "6.18.1", + "@typescript-eslint/parser": "6.18.1", "@vitejs/plugin-basic-ssl": "1.0.2", "@web/test-runner": "^0.18.0", "@yarnpkg/lockfile": "1.1.0", @@ -136,7 +136,7 @@ "chokidar": "3.5.3", "copy-webpack-plugin": "11.0.0", "critters": "0.0.20", - "css-loader": "6.8.1", + "css-loader": "6.9.0", "debug": "^4.1.1", "esbuild": "0.19.11", "esbuild-wasm": "0.19.11", @@ -187,7 +187,7 @@ "prettier": "^3.0.0", "protractor": "~7.0.0", "puppeteer": "18.2.1", - "quicktype-core": "23.0.80", + "quicktype-core": "23.0.81", "resolve-url-loader": "5.0.0", "rollup": "~4.9.0", "rollup-plugin-sourcemaps": "^0.6.0", @@ -209,7 +209,7 @@ "ts-node": "^10.9.1", "tslib": "2.6.2", "typescript": "5.3.3", - "undici": "6.2.1", + "undici": "6.3.0", "verdaccio": "5.29.0", "verdaccio-auth-memory": "^10.0.0", "vite": "5.0.11", diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 64444dc80539..f089a0722a34 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -17,8 +17,8 @@ "@babel/plugin-transform-async-generator-functions": "7.23.7", "@babel/plugin-transform-async-to-generator": "7.23.3", "@babel/plugin-transform-runtime": "7.23.7", - "@babel/preset-env": "7.23.7", - "@babel/runtime": "7.23.7", + "@babel/preset-env": "7.23.8", + "@babel/runtime": "7.23.8", "@discoveryjs/json-ext": "0.5.7", "@ngtools/webpack": "0.0.0-PLACEHOLDER", "@vitejs/plugin-basic-ssl": "1.0.2", @@ -29,7 +29,7 @@ "browserslist": "^4.21.5", "copy-webpack-plugin": "11.0.0", "critters": "0.0.20", - "css-loader": "6.8.1", + "css-loader": "6.9.0", "esbuild-wasm": "0.19.11", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.2", @@ -62,7 +62,7 @@ "text-table": "0.2.0", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.2.1", + "undici": "6.3.0", "vite": "5.0.11", "watchpack": "2.4.0", "webpack": "5.89.0", diff --git a/yarn.lock b/yarn.lock index 3a9bf8601c7f..2460b9588fc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -893,6 +893,20 @@ "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" +"@babel/plugin-transform-classes@^7.23.8": + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz#d08ae096c240347badd68cdf1b6d1624a6435d92" + integrity sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.20" + "@babel/helper-split-export-declaration" "^7.22.6" + globals "^11.1.0" + "@babel/plugin-transform-computed-properties@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" @@ -1308,6 +1322,92 @@ core-js-compat "^3.31.0" semver "^6.3.1" +"@babel/[email protected]": + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.23.8.tgz#7d6f8171ea7c221ecd28059e65ad37c20e441e3e" + integrity sha512-lFlpmkApLkEP6woIKprO6DO60RImpatTQKtz4sUcDjVcK8M8mQ4sZsuxaTMNOZf0sqAq/ReYW1ZBHnOQwKpLWA== + dependencies: + "@babel/compat-data" "^7.23.5" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.23.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.23.3" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.23.3" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly" "^7.23.7" + "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.23.3" + "@babel/plugin-syntax-import-attributes" "^7.23.3" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" + "@babel/plugin-transform-arrow-functions" "^7.23.3" + "@babel/plugin-transform-async-generator-functions" "^7.23.7" + "@babel/plugin-transform-async-to-generator" "^7.23.3" + "@babel/plugin-transform-block-scoped-functions" "^7.23.3" + "@babel/plugin-transform-block-scoping" "^7.23.4" + "@babel/plugin-transform-class-properties" "^7.23.3" + "@babel/plugin-transform-class-static-block" "^7.23.4" + "@babel/plugin-transform-classes" "^7.23.8" + "@babel/plugin-transform-computed-properties" "^7.23.3" + "@babel/plugin-transform-destructuring" "^7.23.3" + "@babel/plugin-transform-dotall-regex" "^7.23.3" + "@babel/plugin-transform-duplicate-keys" "^7.23.3" + "@babel/plugin-transform-dynamic-import" "^7.23.4" + "@babel/plugin-transform-exponentiation-operator" "^7.23.3" + "@babel/plugin-transform-export-namespace-from" "^7.23.4" + "@babel/plugin-transform-for-of" "^7.23.6" + "@babel/plugin-transform-function-name" "^7.23.3" + "@babel/plugin-transform-json-strings" "^7.23.4" + "@babel/plugin-transform-literals" "^7.23.3" + "@babel/plugin-transform-logical-assignment-operators" "^7.23.4" + "@babel/plugin-transform-member-expression-literals" "^7.23.3" + "@babel/plugin-transform-modules-amd" "^7.23.3" + "@babel/plugin-transform-modules-commonjs" "^7.23.3" + "@babel/plugin-transform-modules-systemjs" "^7.23.3" + "@babel/plugin-transform-modules-umd" "^7.23.3" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" + "@babel/plugin-transform-new-target" "^7.23.3" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.23.4" + "@babel/plugin-transform-numeric-separator" "^7.23.4" + "@babel/plugin-transform-object-rest-spread" "^7.23.4" + "@babel/plugin-transform-object-super" "^7.23.3" + "@babel/plugin-transform-optional-catch-binding" "^7.23.4" + "@babel/plugin-transform-optional-chaining" "^7.23.4" + "@babel/plugin-transform-parameters" "^7.23.3" + "@babel/plugin-transform-private-methods" "^7.23.3" + "@babel/plugin-transform-private-property-in-object" "^7.23.4" + "@babel/plugin-transform-property-literals" "^7.23.3" + "@babel/plugin-transform-regenerator" "^7.23.3" + "@babel/plugin-transform-reserved-words" "^7.23.3" + "@babel/plugin-transform-shorthand-properties" "^7.23.3" + "@babel/plugin-transform-spread" "^7.23.3" + "@babel/plugin-transform-sticky-regex" "^7.23.3" + "@babel/plugin-transform-template-literals" "^7.23.3" + "@babel/plugin-transform-typeof-symbol" "^7.23.3" + "@babel/plugin-transform-unicode-escapes" "^7.23.3" + "@babel/plugin-transform-unicode-property-regex" "^7.23.3" + "@babel/plugin-transform-unicode-regex" "^7.23.3" + "@babel/plugin-transform-unicode-sets-regex" "^7.23.3" + "@babel/preset-modules" "0.1.6-no-external-plugins" + babel-plugin-polyfill-corejs2 "^0.4.7" + babel-plugin-polyfill-corejs3 "^0.8.7" + babel-plugin-polyfill-regenerator "^0.5.4" + core-js-compat "^3.31.0" + semver "^6.3.1" + "@babel/[email protected]": version "0.1.6-no-external-plugins" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" @@ -1329,6 +1429,13 @@ dependencies: regenerator-runtime "^0.14.0" +"@babel/[email protected]": + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.8.tgz#8ee6fe1ac47add7122902f257b8ddf55c898f650" + integrity sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" @@ -3931,16 +4038,16 @@ dependencies: "@types/node" "*" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.17.0.tgz#dfc38f790704ba8a54a1277c51efdb489f6ecf9f" - integrity sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.1.tgz#0df881a47da1c1a9774f39495f5f7052f86b72e0" + integrity sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.17.0" - "@typescript-eslint/type-utils" "6.17.0" - "@typescript-eslint/utils" "6.17.0" - "@typescript-eslint/visitor-keys" "6.17.0" + "@typescript-eslint/scope-manager" "6.18.1" + "@typescript-eslint/type-utils" "6.18.1" + "@typescript-eslint/utils" "6.18.1" + "@typescript-eslint/visitor-keys" "6.18.1" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -3948,47 +4055,47 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.17.0.tgz#8cd7a0599888ca6056082225b2fdf9a635bf32a1" - integrity sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.18.1.tgz#3c3987e186b38c77b30b6bfa5edf7c98ae2ec9d3" + integrity sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA== dependencies: - "@typescript-eslint/scope-manager" "6.17.0" - "@typescript-eslint/types" "6.17.0" - "@typescript-eslint/typescript-estree" "6.17.0" - "@typescript-eslint/visitor-keys" "6.17.0" + "@typescript-eslint/scope-manager" "6.18.1" + "@typescript-eslint/types" "6.18.1" + "@typescript-eslint/typescript-estree" "6.18.1" + "@typescript-eslint/visitor-keys" "6.18.1" debug "^4.3.4" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.17.0.tgz#70e6c1334d0d76562dfa61aed9009c140a7601b4" - integrity sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.18.1.tgz#28c31c60f6e5827996aa3560a538693cb4bd3848" + integrity sha512-BgdBwXPFmZzaZUuw6wKiHKIovms97a7eTImjkXCZE04TGHysG+0hDQPmygyvgtkoB/aOQwSM/nWv3LzrOIQOBw== dependencies: - "@typescript-eslint/types" "6.17.0" - "@typescript-eslint/visitor-keys" "6.17.0" + "@typescript-eslint/types" "6.18.1" + "@typescript-eslint/visitor-keys" "6.18.1" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.17.0.tgz#5febad3f523e393006614cbda28b826925b728d5" - integrity sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.18.1.tgz#115cf535f8b39db8301677199ce51151e2daee96" + integrity sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q== dependencies: - "@typescript-eslint/typescript-estree" "6.17.0" - "@typescript-eslint/utils" "6.17.0" + "@typescript-eslint/typescript-estree" "6.18.1" + "@typescript-eslint/utils" "6.18.1" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.17.0.tgz#844a92eb7c527110bf9a7d177e3f22bd5a2f40cb" - integrity sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.18.1.tgz#91617d8080bcd99ac355d9157079970d1d49fefc" + integrity sha512-4TuMAe+tc5oA7wwfqMtB0Y5OrREPF1GeJBAjqwgZh1lEMH5PJQgWgHGfYufVB51LtjD+peZylmeyxUXPfENLCw== -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.17.0.tgz#b913d19886c52d8dc3db856903a36c6c64fd62aa" - integrity sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.1.tgz#a12b6440175b4cbc9d09ab3c4966c6b245215ab4" + integrity sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA== dependencies: - "@typescript-eslint/types" "6.17.0" - "@typescript-eslint/visitor-keys" "6.17.0" + "@typescript-eslint/types" "6.18.1" + "@typescript-eslint/visitor-keys" "6.18.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -3996,25 +4103,25 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.17.0.tgz#f2b16d4c9984474656c420438cdede7eccd4079e" - integrity sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.18.1.tgz#3451cfe2e56babb6ac657e10b6703393d4b82955" + integrity sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.17.0" - "@typescript-eslint/types" "6.17.0" - "@typescript-eslint/typescript-estree" "6.17.0" + "@typescript-eslint/scope-manager" "6.18.1" + "@typescript-eslint/types" "6.18.1" + "@typescript-eslint/typescript-estree" "6.18.1" semver "^7.5.4" -"@typescript-eslint/[email protected]": - version "6.17.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.17.0.tgz#3ed043709c39b43ec1e58694f329e0b0430c26b6" - integrity sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg== +"@typescript-eslint/[email protected]": + version "6.18.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.1.tgz#704d789bda2565a15475e7d22f145b8fe77443f4" + integrity sha512-/kvt0C5lRqGoCfsbmm7/CwMqoSkY3zzHLIjdhHZQW3VFrnz7ATecOHR7nb7V+xn4286MBxfnQfQhAmCI0u+bJA== dependencies: - "@typescript-eslint/types" "6.17.0" + "@typescript-eslint/types" "6.18.1" eslint-visitor-keys "^3.4.1" "@ungap/structured-clone@^1.2.0": @@ -5979,6 +6086,20 @@ [email protected]: postcss-value-parser "^4.2.0" semver "^7.3.8" [email protected]: + version "6.9.0" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.9.0.tgz#0cc2f14df94ed97c526c5ae42b6b13916d1d8d0e" + integrity sha512-3I5Nu4ytWlHvOP6zItjiHlefBNtrH+oehq8tnQa2kO305qpVyx9XNIT1CXIj5bgCJs7qICBCkgCYxQLKPANoLA== + dependencies: + icss-utils "^5.1.0" + postcss "^8.4.31" + postcss-modules-extract-imports "^3.0.0" + postcss-modules-local-by-default "^4.0.3" + postcss-modules-scope "^3.1.0" + postcss-modules-values "^4.0.0" + postcss-value-parser "^4.2.0" + semver "^7.5.4" + css-select@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" @@ -10828,7 +10949,7 @@ postcss-modules-local-by-default@^4.0.3: postcss-selector-parser "^6.0.2" postcss-value-parser "^4.1.0" -postcss-modules-scope@^3.0.0: +postcss-modules-scope@^3.0.0, postcss-modules-scope@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.1.0.tgz#fbfddfda93a31f310f1d152c2bb4d3f3c5592ee0" integrity sha512-SaIbK8XW+MZbd0xHPf7kdfA/3eOt7vxJ72IRecn3EzuZVLr1r0orzf0MX/pN8m+NMDoo6X/SQd8oeKqGZd8PXg== @@ -11157,10 +11278,10 @@ quick-format-unescaped@^4.0.3: resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== [email protected]: - version "23.0.80" - resolved "https://registry.yarnpkg.com/quicktype-core/-/quicktype-core-23.0.80.tgz#d9114cb862e03046599eb5f0f44b01b9aaafccd4" - integrity sha512-dd+aJRzAl3MzkaXJMjUu0j60y82gwX/RRr3EvW/aScQKycvkgwliNDN2tIiLB06EKBzjgC9mtlMqKyRg2rYKhQ== [email protected]: + version "23.0.81" + resolved "https://registry.yarnpkg.com/quicktype-core/-/quicktype-core-23.0.81.tgz#a3c49ae7cffd6ca0b1094a178bcd3f4463b58eea" + integrity sha512-iJQpCEzSQIkffJPS5NC+0w+Rq9faGgz09L+WIbseu1toFfj+M/3KTG5jhzdY/uN88fWosAom2fMoEADA403+rQ== dependencies: "@glideapps/ts-necessities" "2.1.3" "@types/urijs" "^1.19.19" @@ -12928,6 +13049,13 @@ [email protected]: dependencies: "@fastify/busboy" "^2.0.0" [email protected]: + version "6.3.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.3.0.tgz#ad105a56ec80fb74ecb3252e6dc27947bf69d275" + integrity sha512-zkSMOXs2topAR1LF0PxAaNNvhdX4LYEcmRMJLMh3mjgfZpBtc/souXOp4aYiR5Q46HrBPA2/8DkEZhD3eNFE1Q== + dependencies: + "@fastify/busboy" "^2.0.0" + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
1e5cbd1cc950be898f3e8a55376f4f747c42bf29
2018-11-27 00:46:06
Hans
release: v7.1.0
false
v7.1.0
release
diff --git a/.monorepo.json b/.monorepo.json index 54a1f68eca58..0fb1c2a091b2 100644 --- a/.monorepo.json +++ b/.monorepo.json @@ -42,16 +42,16 @@ }, "packages": { "@_/benchmark": { - "version": "0.11.0-rc.0", - "hash": "5bfa9de2083bea5cbbea49d48a87e49a" + "version": "0.11.0", + "hash": "5225044ecf49d630564a68b710f6b82f" }, "@_/builders": { - "version": "0.11.0-rc.0", - "hash": "575504a90d567ed077e933519642be6f" + "version": "0.11.0", + "hash": "f34470f978203f13c312094472b0a343" }, "devkit": { - "version": "0.11.0-rc.0", - "hash": "24385ec699deb72d602dcab7234a850c" + "version": "0.11.0", + "hash": "3d8279285237adcda7885a24f0242ff1" }, "@angular/cli": { "name": "Angular CLI", @@ -62,15 +62,15 @@ "url": "/packages/angular/cli/README.md" } ], - "version": "7.1.0-rc.0", + "version": "7.1.0", "snapshotRepo": "angular/cli-builds", - "hash": "95f75fed987e54edd7128d0a0f9619a4" + "hash": "e12ea0ff25b467c59f41bb7f09978b77" }, "@angular/pwa": { "name": "Angular PWA Schematics", "section": "Schematics", - "version": "0.11.0-rc.0", - "hash": "1c100bee84f5bca5f4bd08b715519425", + "version": "0.11.0", + "hash": "c116af8724067c8d65d6b9e5cff0db6e", "snapshotRepo": "angular/angular-pwa-builds" }, "@angular-devkit/architect": { @@ -81,21 +81,21 @@ "url": "/packages/angular_devkit/architect/README.md" } ], - "version": "0.11.0-rc.0", - "hash": "3e5084d27124e4d31eb7ea2c8b8bc182", + "version": "0.11.0", + "hash": "a35fc327f511397304b54abce6e51f13", "snapshotRepo": "angular/angular-devkit-architect-builds" }, "@angular-devkit/architect-cli": { "name": "Architect CLI", - "version": "0.11.0-rc.0", - "hash": "445c678fb5882243b789f6d0e2463269", + "version": "0.11.0", + "hash": "f8b9ed887e104ea4a8d23732ebacb4d0", "snapshotRepo": "angular/angular-devkit-architect-cli-builds" }, "@angular-devkit/benchmark": { "name": "Benchmark", "section": "Tooling", - "version": "1.0.0-rc.0", - "hash": "f1b5d598a9748e2b9ddeb06956d192d6" + "version": "1.0.0", + "hash": "2a821f7757c6722e57873437e91712cf" }, "@angular-devkit/build-optimizer": { "name": "Build Optimizer", @@ -105,8 +105,8 @@ "url": "/packages/angular_devkit/build_optimizer/README.md" } ], - "version": "0.11.0-rc.0", - "hash": "f7a208e234574769498fc97802e33178", + "version": "0.11.0", + "hash": "15bcfd189158d6f2540a6d318753a847", "snapshotRepo": "angular/angular-devkit-build-optimizer-builds" }, "@angular-devkit/build-ng-packagr": { @@ -117,8 +117,8 @@ "url": "/packages/angular_devkit/build_ng_packagr/README.md" } ], - "version": "0.11.0-rc.0", - "hash": "d742d683614e05e097558a3dcf6b7d85", + "version": "0.11.0", + "hash": "5567a181dea53e9b59965c701591c791", "snapshotRepo": "angular/angular-devkit-build-ng-packagr-builds" }, "@angular-devkit/build-angular": { @@ -129,8 +129,8 @@ "url": "/packages/angular_devkit/build_angular/README.md" } ], - "version": "0.11.0-rc.0", - "hash": "37947c7342c85b6c76bcb2c30dff0e32", + "version": "0.11.0", + "hash": "97495f7e53ae9d8d3e6e84737734289f", "snapshotRepo": "angular/angular-devkit-build-angular-builds" }, "@angular-devkit/build-webpack": { @@ -141,9 +141,9 @@ "url": "/packages/angular_devkit/build_webpack/README.md" } ], - "version": "0.11.0-rc.0", + "version": "0.11.0", "snapshotRepo": "angular/angular-devkit-build-webpack-builds", - "hash": "7082fc772c44e13aeb5e6af55f81bb7a" + "hash": "c82f5f66b7cba16409fb450423ef584b" }, "@angular-devkit/core": { "name": "Core", @@ -153,8 +153,8 @@ "url": "/packages/angular_devkit/core/README.md" } ], - "version": "7.1.0-rc.0", - "hash": "61c8d98cb6faa0ed05d6a2f54f8b8446", + "version": "7.1.0", + "hash": "edb4cd588e93738ddc701eba0a18838d", "snapshotRepo": "angular/angular-devkit-core-builds" }, "@angular-devkit/schematics": { @@ -165,43 +165,43 @@ "url": "/packages/angular_devkit/schematics/README.md" } ], - "version": "7.1.0-rc.0", - "hash": "241304d0a05ce95082c22c894317be9f", + "version": "7.1.0", + "hash": "14adbc24f34c6bf530c595c8f81a1dac", "snapshotRepo": "angular/angular-devkit-schematics-builds" }, "@angular-devkit/schematics-cli": { "name": "Schematics CLI", "section": "Tooling", - "version": "0.11.0-rc.0", - "hash": "6a410ab5ada8a71f7429b5e6d0305d2d", + "version": "0.11.0", + "hash": "a3932c5c4bee509cf99f968764a33bc6", "snapshotRepo": "angular/angular-devkit-schematics-cli-builds" }, "@ngtools/webpack": { "name": "Webpack Angular Plugin", - "version": "7.1.0-rc.0", + "version": "7.1.0", "section": "Misc", - "hash": "9add1a8b73ad9a38947cb00a42a475f9", + "hash": "688d8625df02a29bb4b35c7ace1c6306", "snapshotRepo": "angular/ngtools-webpack-builds" }, "@schematics/angular": { "name": "Angular Schematics", "section": "Schematics", - "version": "7.1.0-rc.0", - "hash": "b8ffff36a742299d0a0e218b11ac3eb7", + "version": "7.1.0", + "hash": "415e700a4b37e4c7bbc39215ccada542", "snapshotRepo": "angular/schematics-angular-builds" }, "@schematics/schematics": { "name": "Schematics Schematics", - "version": "0.11.0-rc.0", + "version": "0.11.0", "section": "Schematics", - "hash": "e912ea1bae8ae64487e2d11f393bc4a1", + "hash": "5ac1b2d99b258044b32d1a2428f5423a", "snapshotRepo": "angular/schematics-schematics-builds" }, "@schematics/update": { "name": "Package Update Schematics", - "version": "0.11.0-rc.0", + "version": "0.11.0", "section": "Schematics", - "hash": "dbbc989101ade8492b8594dbc22267fc", + "hash": "f19a525d59e859922020dc75ec22ec0f", "snapshotRepo": "angular/schematics-update-builds" } } diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index ca34a923985b..3bc2df3fe9b9 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -8,12 +8,12 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. - Angular: '~7.1.0-beta.0', + Angular: '~7.1.0', RxJs: '~6.3.3', ZoneJs: '~0.8.26', TypeScript: '~3.1.6', TsLib: '^1.9.0', // The versions below must be manually updated when making a new devkit release. - DevkitBuildAngular: '~0.11.0-beta.0', - DevkitBuildNgPackagr: '~0.11.0-beta.0', + DevkitBuildAngular: '~0.11.0', + DevkitBuildNgPackagr: '~0.11.0', };
b315c7b4c457cdc04c7cb43d3304de2057652c48
2022-01-20 03:48:55
Joey Perrott
release: bump the next branch to v13.3.0-next.0
false
bump the next branch to v13.3.0-next.0
release
diff --git a/package.json b/package.json index dcd955f3b9cd..cdd4b8f31d20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/devkit-repo", - "version": "13.2.0-next.2", + "version": "13.3.0-next.0", "private": true, "description": "Software Development Kit for Angular", "bin": {
4fe36f4e467f11828d40cea6599f628b4b4f66f7
2017-07-27 01:40:00
Charles Lyding
refactor(@angular/cli): remove magic-string console message
false
remove magic-string console message
refactor
diff --git a/packages/@ngtools/webpack/src/refactor.ts b/packages/@ngtools/webpack/src/refactor.ts index 037a49bf83dc..c96c90d3e00b 100644 --- a/packages/@ngtools/webpack/src/refactor.ts +++ b/packages/@ngtools/webpack/src/refactor.ts @@ -196,7 +196,7 @@ export class TypeScriptFileRefactor { this._sourceString.overwrite(node.getStart(this._sourceFile), node.getEnd(), replacement, - replaceSymbolName); + { storeName: replaceSymbolName }); this._changed = true; }
a4200a0f04e90588b8a8746826291f15b68d0ae6
2019-11-23 03:06:31
Greg Magolan
refactor(@angular-devkit/build-angular): allow @angular/core version 0.0.0
false
allow @angular/core version 0.0.0
refactor
diff --git a/packages/angular_devkit/build_angular/src/utils/version.ts b/packages/angular_devkit/build_angular/src/utils/version.ts index 59dbe707a144..64147d29d851 100644 --- a/packages/angular_devkit/build_angular/src/utils/version.ts +++ b/packages/angular_devkit/build_angular/src/utils/version.ts @@ -59,9 +59,10 @@ export function assertCompatibleAngularVersion(projectRoot: string, logger: logg const cliMajor = new SemVer(angularCliPkgJson['version']).major; // e.g. CLI 8.0 supports '>=8.0.0 <9.0.0', including pre-releases (betas, rcs, snapshots) - // of both 8 and 9. + // of both 8 and 9. Also allow version "0.0.0" for integration testing in the angular/angular + // repository with the generated development @angular/core npm package which is versioned "0.0.0". const supportedAngularSemver = - `^${cliMajor}.0.0-beta || ` + `>=${cliMajor}.0.0 <${cliMajor + 1}.0.0`; + `0.0.0 || ^${cliMajor}.0.0-beta || ` + `>=${cliMajor}.0.0 <${cliMajor + 1}.0.0`; const angularVersion = new SemVer(angularPkgJson['version']); const rxjsVersion = new SemVer(rxjsPkgJson['version']);
8a559f764da3e4780615d2bcd21f1bd36976829f
2020-05-29 19:09:47
Renovate Bot
build: update bazel packages
false
update bazel packages
build
diff --git a/WORKSPACE b/WORKSPACE index 5a4b28de1494..19f467a852ae 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") http_archive( name = "build_bazel_rules_nodejs", - sha256 = "d14076339deb08e5460c221fae5c5e9605d2ef4848eee1f0c81c9ffdc1ab31c1", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.6.1/rules_nodejs-1.6.1.tar.gz"], + sha256 = "84abf7ac4234a70924628baa9a73a5a5cbad944c4358cf9abdb4aab29c9a5b77", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.7.0/rules_nodejs-1.7.0.tar.gz"], ) # We use protocol buffers for the Build Event Protocol @@ -107,9 +107,9 @@ web_test_repositories() # Bring in bazel_toolchains for RBE setup configuration. http_archive( name = "bazel_toolchains", - sha256 = "d0a2219b1d9edbc430413127b9e01502bb35b3e0bdd14b5a53ad1c30ee4fda5e", - strip_prefix = "bazel-toolchains-3.1.2", - url = "https://github.com/bazelbuild/bazel-toolchains/archive/3.1.2.tar.gz", + sha256 = "db48eed61552e25d36fe051a65d2a329cc0fb08442627e8f13960c5ab087a44e", + strip_prefix = "bazel-toolchains-3.2.0", + url = "https://github.com/bazelbuild/bazel-toolchains/archive/3.2.0.tar.gz", ) load("@bazel_toolchains//rules:environments.bzl", "clang_env") diff --git a/package.json b/package.json index 213905c19f85..fb397da1d8a6 100644 --- a/package.json +++ b/package.json @@ -88,10 +88,10 @@ "@babel/template": "7.8.6", "@bazel/bazelisk": "1.4.0", "@bazel/buildifier": "3.0.0", - "@bazel/jasmine": "1.6.1", - "@bazel/karma": "1.6.1", - "@bazel/labs": "1.6.1", - "@bazel/typescript": "1.6.1", + "@bazel/jasmine": "1.7.0", + "@bazel/karma": "1.7.0", + "@bazel/labs": "1.7.0", + "@bazel/typescript": "1.7.0", "@jsdevtools/coverage-istanbul-loader": "3.0.3", "@types/babel__core": "7.1.7", "@types/babel__template": "7.0.2", diff --git a/yarn.lock b/yarn.lock index 4e73eded773d..21a976beb9be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -896,32 +896,32 @@ resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-3.0.0.tgz#21055461bff546f09845c21570e3c1f528a43e41" integrity sha512-M4JLddg7JjZi5Kn2wYc6qmLRsE0KPb7GaIl8rBvmMJ2F+5Lm4BYp6KpXoj28/AikPyZ/pwWe9O0Wcvc+SQBMpw== -"@bazel/[email protected]": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.6.1.tgz#fd7d10fe4cbf180f8be9db54b5da5c587d392d95" - integrity sha512-uG/d2CbU8Pa7Fh0Khkv9BLhMQgMzb5xGhd9/HbvhvTk45akI4HuP/hXcAUU01Cg09C0N04SAjy7hmrZHBuPpeg== +"@bazel/[email protected]": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.7.0.tgz#429df76e6628aa139176340434729cc091e371d7" + integrity sha512-LXq6nfBBEczjsDLwFW9kesGdewRrnFiAOZzXAAivCV3xtq516xK4QnVWA9tQGq+R1DnY50IaODpCJhh8PDezdg== dependencies: jasmine "~3.5.0" jasmine-core "~3.5.0" jasmine-reporters "~2.3.2" v8-coverage "1.0.9" -"@bazel/[email protected]": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.6.1.tgz#1afa1a74f147debd55b04926af88de3a31ed3fe4" - integrity sha512-eLzbgVs9mpsiVOi86e+APpBEtSkOIrfIkZTCI8vbYMD/jM8kuQOnJb6Px70LakC7xQzmCm5yY+UpNv6Sr2YvzQ== +"@bazel/[email protected]": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.7.0.tgz#ec7e97a2629f5af0b2abe9a99ae30363a34af97d" + integrity sha512-mGYVD9DldB3v/DjxJpS39X1vUD6M32Al96DMoilwW3TSAazcRWwUAC6HY9z5Wtyeqwxyk8BY1Mg1/berWpoTxg== dependencies: tmp "0.1.0" -"@bazel/[email protected]": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@bazel/labs/-/labs-1.6.1.tgz#56a408cfa4e37ba4643f142a4aa9c6a60194e5f3" - integrity sha512-A3p4c/nkltp2TIMOerCoHhOiXSwSZEtSRYZHHaFdYYxWIGnVSv9lyH/28j34RBn5G35b6TW5GZT1cklLxY5IJg== +"@bazel/[email protected]": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@bazel/labs/-/labs-1.7.0.tgz#9e627e579073ec14fca85e35493c17493684a221" + integrity sha512-xAGPHB6rbCnmjIHEhPA1a34AbsXpQPrJr1edrSmcWJjDFSA7PJZBv/YEYW0dC9Zm+VjIhX76Vw93mplxDlBQXg== -"@bazel/[email protected]": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.6.1.tgz#1bf83c20021d359bc9b532181981ac540584a30c" - integrity sha512-wQ9AASRcG1jLQOpJfNOMjZzPpwIV/9qTOxCFvp55ga6A5a2qveQr8JJ7jHHbBM0LtK+slEPixXmVmtEOwfKsIg== +"@bazel/[email protected]": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.7.0.tgz#8dc02b8a161f4fff3285186066b5f73666793452" + integrity sha512-M6JPXJZ+W6457QZfPHmGg/Mejnp7//YTnffGmnmeK9vDqybXeCCRWW1/iEOwopLJYQViBHfaoulde0VXelx9sA== dependencies: protobufjs "6.8.8" semver "5.6.0"
e3730ddd6a98e83d7f8a9a37e559531bef40f32a
2018-04-02 06:13:10
Vikram Subramanian
chore(release): 5.0.0
false
5.0.0
chore
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7942fbc8a7b8..f085f2cdd94f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +<a name="5.0.0"></a> +# [5.0.0](https://github.com/angular/universal/compare/5.0.0-beta.8...5.0.0) (2018-04-02) + + + <a name="5.0.0-beta.8"></a> # 5.0.0-beta.8 (2018-03-23) diff --git a/package.json b/package.json index 5dab1dbe1f71..139f56e3cae1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nguniversal", "main": "index.js", - "version": "5.0.0-beta.8", + "version": "5.0.0", "description": "Universal (isomorphic) JavaScript support for Angular", "homepage": "https://github.com/angular/universal", "license": "MIT",
8f33fe07d4616af33ccf9de9d511fb971024cb66
2020-07-26 13:00:22
Renovate Bot
build: update angular packages
false
update angular packages
build
diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json index dcb8766c72d1..69652f5cafbe 100644 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ b/tests/legacy-cli/e2e/ng-snapshot/package.json @@ -2,20 +2,20 @@ "description": "snapshot versions of Angular for e2e testing", "private": true, "dependencies": { - "@angular/animations": "github:angular/animations-builds#6dfd49c7f026b66e1ca521671fb61500370a9fb4", - "@angular/cdk": "github:angular/cdk-builds#8146108ee54abd785a99ca58200db6cd2feaed6f", - "@angular/common": "github:angular/common-builds#99d208237db1e0cbdd506c61b97dc3e092781e75", - "@angular/compiler": "github:angular/compiler-builds#2b56d276287d81f98b3b48edddfa4cdeb646a1b5", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#fa4620e1363e97a6623d59df19301f62a22cb5a9", - "@angular/core": "github:angular/core-builds#e437426f221cf0739f242670f9092096381689cb", - "@angular/forms": "github:angular/forms-builds#7a044241d833e735a6d05b2e2e0150e4207d7adf", - "@angular/language-service": "github:angular/language-service-builds#811d0a321afdf0dab3ce69a4005e291fac10337d", - "@angular/localize": "github:angular/localize-builds#5abac5fe3a4f8b63f338c5a05c91d1ec382da332", - "@angular/material": "github:angular/material2-builds#7b9d879f79421d7b89d471b51dd16cdde6630075", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#45b06bd749a91c1d68e32a5046131810296d81d8", - "@angular/platform-browser": "github:angular/platform-browser-builds#4f544b0290f72ea7df2b67f88facafc037363036", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#50779292e84d2783dbfbe51edd3ba445fecfbd62", - "@angular/platform-server": "github:angular/platform-server-builds#d79af083b5dd9a88c2989ef40ad74fbcbbd94a90", - "@angular/router": "github:angular/router-builds#4815a3c3c47b93d1703651231215470eaee83e4d" + "@angular/animations": "github:angular/animations-builds#16538500b934d9a41deaa3a6dcd80611c8a9e12b", + "@angular/cdk": "github:angular/cdk-builds#3716b0204e730e956d0c9c723ec07da0f85f67aa", + "@angular/common": "github:angular/common-builds#6ae69a90a250fef9a445afaa2e9605187c103baa", + "@angular/compiler": "github:angular/compiler-builds#809e9aaac0853c614af54e49beb70595745d9d16", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#8293c4b47c1749e0844c647c100a778888f010d3", + "@angular/core": "github:angular/core-builds#8f643e8214639e441d93f511ad19cd56af026697", + "@angular/forms": "github:angular/forms-builds#ed094eb9fa4c5a4fba413a7fbd2fd2040aa00f54", + "@angular/language-service": "github:angular/language-service-builds#c4d8aceb5e70da1f2e5b6088318dca72ddb8ee4f", + "@angular/localize": "github:angular/localize-builds#91e598a524503d2472223340421bd0bf2ff5b442", + "@angular/material": "github:angular/material2-builds#3969e151e16a155123577d3b11c73f41a1266687", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#922a127697b6aa6518b357233328b854a9821a60", + "@angular/platform-browser": "github:angular/platform-browser-builds#3621d42aa514876d3b213fcbfb0878578a0dbfc6", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#df3bb84bba6485aea07a7b77e886bbfbe6c5cc91", + "@angular/platform-server": "github:angular/platform-server-builds#087e95bd065317670bd409d713ccf6a732c5d620", + "@angular/router": "github:angular/router-builds#673ff5d7cc4f0edcf79b076252f20689355b0092" } }
dad2de9737b9d09bd3a499bb72d554a3e533786f
2018-06-18 19:07:01
Alan Agius
fix(@schematics/angular): add `module` in root tsconfig when migrating
false
add `module` in root tsconfig when migrating
fix
diff --git a/packages/schematics/angular/migrations/update-6/index.ts b/packages/schematics/angular/migrations/update-6/index.ts index ab829d5f44fc..27e74d77ce1c 100644 --- a/packages/schematics/angular/migrations/update-6/index.ts +++ b/packages/schematics/angular/migrations/update-6/index.ts @@ -32,7 +32,6 @@ import { addPackageJsonDependency, } from '../../utility/dependencies'; import { - appendPropertyInAstObject, appendValueInAstArray, findPropertyInAstObject, } from '../../utility/json-utils'; @@ -734,31 +733,47 @@ function updateRootTsConfig(): Rule { } const tsCfgAst = parseJsonAst(buffer.toString(), JsonParseMode.Loose); - if (tsCfgAst.kind != 'object') { - throw new SchematicsException( - 'Invalid tsconfig. Was expecting an object' - ); + if (tsCfgAst.kind !== 'object') { + throw new SchematicsException('Invalid root tsconfig. Was expecting an object'); } const compilerOptionsAstNode = findPropertyInAstObject(tsCfgAst, 'compilerOptions'); if (!compilerOptionsAstNode || compilerOptionsAstNode.kind != 'object') { - throw new SchematicsException('Invalid tsconfig "compilerOptions" property; expected an object.'); + throw new SchematicsException( + 'Invalid root tsconfig "compilerOptions" property; expected an object.', + ); } - if (findPropertyInAstObject(compilerOptionsAstNode, 'baseUrl')) { + if ( + findPropertyInAstObject(compilerOptionsAstNode, 'baseUrl') && + findPropertyInAstObject(compilerOptionsAstNode, 'module') + ) { return host; } - const recorder = host.beginUpdate(tsConfigPath); - appendPropertyInAstObject( - recorder, - compilerOptionsAstNode, - 'baseUrl', - './', - 4, - ); + const compilerOptions = compilerOptionsAstNode.value; + const { baseUrl = './', module = 'es2015'} = compilerOptions; + + const validBaseUrl = ['./', '', '.']; + if (!validBaseUrl.includes(baseUrl as string)) { + const formattedBaseUrl = validBaseUrl.map(x => `'${x}'`).join(', '); + context.logger.warn(tags.oneLine + `Root tsconfig option 'baseUrl' is not one of: ${formattedBaseUrl}. + This might cause unexpected behaviour when generating libraries.`, + ); + } + + if (module !== 'es2015') { + context.logger.warn( + `Root tsconfig option 'module' is not 'es2015'. This might cause unexpected behaviour.`, + ); + } + + compilerOptions.module = module; + compilerOptions.baseUrl = baseUrl; + + host.overwrite(tsConfigPath, JSON.stringify(tsCfgAst.value, null, 2)); - host.commitUpdate(recorder); return host; }; } diff --git a/packages/schematics/angular/migrations/update-6/index_spec.ts b/packages/schematics/angular/migrations/update-6/index_spec.ts index 118670b21514..d2627791ee08 100644 --- a/packages/schematics/angular/migrations/update-6/index_spec.ts +++ b/packages/schematics/angular/migrations/update-6/index_spec.ts @@ -777,22 +777,33 @@ describe('Migration to v6', () => { describe('root ts config', () => { const rootTsConfig = '/tsconfig.json'; + let compilerOptions: JsonObject; + beforeEach(() => { tree.create(rootTsConfig, ` { "compilerOptions": { - "module": "es2015" + "noEmitOnError": true } } `); - }); - it('should add baseUrl', () => { tree.create(oldConfigPath, JSON.stringify(baseConfig, null, 2)); tree = schematicRunner.runSchematic('migration-01', defaultOptions, tree); const content = tree.readContent(rootTsConfig); - const config = JSON.parse(content); - expect(config.compilerOptions.baseUrl).toEqual('./'); + compilerOptions = JSON.parse(content).compilerOptions; + }); + + it('should add baseUrl', () => { + expect(compilerOptions.baseUrl).toEqual('./'); + }); + + it('should add module', () => { + expect(compilerOptions.module).toEqual('es2015'); + }); + + it('should not remove existing options', () => { + expect(compilerOptions.noEmitOnError).toBeDefined(); }); });
e182d15f002843d7429beca164cbd8d4c288eaac
2025-01-14 02:30:45
Joey Perrott
build: migrate @angular/pwa to npm_package
false
migrate @angular/pwa to npm_package
build
diff --git a/packages/angular/pwa/BUILD.bazel b/packages/angular/pwa/BUILD.bazel index 345104673c7e..5750a6c0d3d9 100644 --- a/packages/angular/pwa/BUILD.bazel +++ b/packages/angular/pwa/BUILD.bazel @@ -4,28 +4,32 @@ # found in the LICENSE file at https://angular.dev/license load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:defaults.bzl", "pkg_npm") -load("//tools:interop.bzl", "ts_project") +load("//tools:defaults2.bzl", "npm_package", "ts_project") load("//tools:ts_json_schema.bzl", "ts_json_schema") licenses(["notice"]) package(default_visibility = ["//visibility:public"]) +RUNTIME_ASSETS = glob( + include = [ + "pwa/*.js", + "pwa/*.mjs", + "pwa/files/**/*", + ], +) + [ + "package.json", + "collection.json", + "pwa/schema.json", +] + ts_project( name = "pwa", srcs = [ "pwa/index.ts", "//packages/angular/pwa:pwa/schema.ts", ], - data = [ - "collection.json", - "pwa/schema.json", - ] + glob( - include = [ - "pwa/files/**/*", - ], - ), + data = RUNTIME_ASSETS, module_name = "@angular/pwa", deps = [ "//:root_modules/@types/node", @@ -63,16 +67,16 @@ genrule( cmd = "cp $(execpath //:LICENSE) $@", ) -pkg_npm( - name = "npm_package", +npm_package( + name = "pkg", pkg_deps = [ "//packages/angular_devkit/schematics:package.json", "//packages/schematics/angular:package.json", ], tags = ["release-package"], - deps = [ + deps = RUNTIME_ASSETS + [ ":README.md", ":license", - ":pwa", + ":pwa_rjs", ], )
9969509f15b3c800f4a168a1d4354cdf4fda529c
2016-05-02 00:12:51
Mike Brocchi
feat: allow for configurable source diretory location and selector prefix at app creation
false
allow for configurable source diretory location and selector prefix at app creation
feat
diff --git a/addon/ng2/blueprints/component/index.js b/addon/ng2/blueprints/component/index.js index 784e6ceb7230..03342908f36c 100644 --- a/addon/ng2/blueprints/component/index.js +++ b/addon/ng2/blueprints/component/index.js @@ -88,7 +88,8 @@ module.exports = { dir = dirParts.join(path.sep); } } - this.appDir = dir.replace(`src${path.sep}client${path.sep}`, ''); + var srcDir = this.project.ngConfig.defaults.sourceDir; + this.appDir = dir.substr(dir.indexOf(srcDir) + srcDir.length); this.generatePath = dir; return dir; }, @@ -100,8 +101,11 @@ module.exports = { afterInstall: function(options) { if (!options.flat) { - var filePath = path.join('src', 'client', 'system-config.ts'); - var barrelUrl = this.appDir.replace(path.sep, '/'); + var filePath = path.join(this.project.ngConfig.defaults.sourceDir, 'system-config.ts'); + var barrelUrl = this.appDir.replace(/\\/g, '/'); + if (barrelUrl[0] === '/') { + barrelUrl = barrelUrl.substr(1); + } return addBarrelRegistration(this, this.generatePath) .then(() => { @@ -110,7 +114,7 @@ module.exports = { ` '${barrelUrl}',`, { before: ' /** @cli-barrel */' } ); - }) + }); } else { return addBarrelRegistration( this, diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.__styleext__ b/addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.__styleext__ similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.__styleext__ rename to addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.__styleext__ diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html b/addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.html similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.html rename to addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.html diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts b/addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.spec.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.spec.ts rename to addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.spec.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts b/addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/__name__.component.ts rename to addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/environment.ts b/addon/ng2/blueprints/ng2/files/__path__/app/environment.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/environment.ts rename to addon/ng2/blueprints/ng2/files/__path__/app/environment.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/app/shared/index.ts b/addon/ng2/blueprints/ng2/files/__path__/app/shared/index.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/app/shared/index.ts rename to addon/ng2/blueprints/ng2/files/__path__/app/shared/index.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/favicon.ico b/addon/ng2/blueprints/ng2/files/__path__/favicon.ico similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/favicon.ico rename to addon/ng2/blueprints/ng2/files/__path__/favicon.ico diff --git a/addon/ng2/blueprints/ng2/files/src/client/index.html b/addon/ng2/blueprints/ng2/files/__path__/index.html similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/index.html rename to addon/ng2/blueprints/ng2/files/__path__/index.html diff --git a/addon/ng2/blueprints/ng2/files/src/client/main.ts b/addon/ng2/blueprints/ng2/files/__path__/main.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/main.ts rename to addon/ng2/blueprints/ng2/files/__path__/main.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/system-config.ts b/addon/ng2/blueprints/ng2/files/__path__/system-config.ts similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/system-config.ts rename to addon/ng2/blueprints/ng2/files/__path__/system-config.ts diff --git a/addon/ng2/blueprints/ng2/files/src/client/tsconfig.json b/addon/ng2/blueprints/ng2/files/__path__/tsconfig.json similarity index 100% rename from addon/ng2/blueprints/ng2/files/src/client/tsconfig.json rename to addon/ng2/blueprints/ng2/files/__path__/tsconfig.json diff --git a/addon/ng2/blueprints/ng2/files/__path__/typings.d.ts b/addon/ng2/blueprints/ng2/files/__path__/typings.d.ts new file mode 100644 index 000000000000..a602e1b0f66e --- /dev/null +++ b/addon/ng2/blueprints/ng2/files/__path__/typings.d.ts @@ -0,0 +1,3 @@ +/// <reference path="<%= refToTypings %>/typings/browser.d.ts" /> + +declare var __moduleName: string; diff --git a/addon/ng2/blueprints/ng2/files/angular-cli.json b/addon/ng2/blueprints/ng2/files/angular-cli.json index 9a023e664f51..35333d86b85d 100644 --- a/addon/ng2/blueprints/ng2/files/angular-cli.json +++ b/addon/ng2/blueprints/ng2/files/angular-cli.json @@ -4,7 +4,7 @@ "name": "<%= htmlComponentName %>" }, "apps": [ - {"main": "src/client/main.ts", "tsconfig": "src/client/tsconfig.json"} + {"main": "<%= sourceDir %>/main.ts", "tsconfig": "<%= sourceDir %>/tsconfig.json"} ], "addons": [], "packages": [], @@ -19,6 +19,7 @@ } }, "defaults": { - "prefix": "app" + "prefix": "<%= prefix %>", + "sourceDir": "<%= sourceDir %>" } } diff --git a/addon/ng2/blueprints/ng2/files/src/client/typings.d.ts b/addon/ng2/blueprints/ng2/files/src/client/typings.d.ts deleted file mode 100644 index f642f36b93bd..000000000000 --- a/addon/ng2/blueprints/ng2/files/src/client/typings.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// <reference path="../../typings/browser.d.ts" /> - -declare var __moduleName: string; diff --git a/addon/ng2/blueprints/ng2/index.js b/addon/ng2/blueprints/ng2/index.js index aadb0f96fb01..a458837e6a0d 100644 --- a/addon/ng2/blueprints/ng2/index.js +++ b/addon/ng2/blueprints/ng2/index.js @@ -3,23 +3,36 @@ const stringUtils = require('ember-cli-string-utils'); module.exports = { description: '', + + availableOptions: [ + { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, + { name: 'prefix', type: String, default: 'app', aliases: ['p'] } + ], locals: function(options) { //TODO: pull value from config this.styleExt = 'css'; this.version = require(path.resolve(__dirname, '..', '..', '..', '..', 'package.json')).version; + // Join with / not path.sep as reference to typings require forward slashes. + const refToTypings = options.sourceDir.split(path.sep).map(() => '..').join('/'); return { htmlComponentName: stringUtils.dasherize(options.entity.name), jsComponentName: stringUtils.classify(options.entity.name), styleExt: this.styleExt, - version: this.version + version: this.version, + sourceDir: options.sourceDir, + prefix: options.prefix, + refToTypings: refToTypings }; }, fileMapTokens: function (options) { // Return custom template variables here. return { + __path__: () => { + return options.locals.sourceDir; + }, __styleext__: () => { return options.locals.styleExt; } diff --git a/addon/ng2/commands/init.js b/addon/ng2/commands/init.js index a8770a1c3d8b..a05b1ffbe3d3 100644 --- a/addon/ng2/commands/init.js +++ b/addon/ng2/commands/init.js @@ -19,7 +19,9 @@ module.exports = Command.extend({ { name: 'blueprint', type: String, aliases: ['b'] }, { name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] }, { name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] }, - { name: 'name', type: String, default: '', aliases: ['n'] } + { name: 'name', type: String, default: '', aliases: ['n'] }, + { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, + { name: 'prefix', type: String, default: 'app', aliases: ['p'] } ], anonymousOptions: ['<glob-pattern>'], @@ -79,13 +81,15 @@ module.exports = Command.extend({ return Promise.reject(new SilentError(message)); } - + var blueprintOpts = { dryRun: commandOptions.dryRun, blueprint: commandOptions.blueprint || this._defaultBlueprint(), rawName: packageName, targetFiles: rawArgs || '', - rawArgs: rawArgs.toString() + rawArgs: rawArgs.toString(), + sourceDir: commandOptions.sourceDir, + prefix: commandOptions.prefix }; if (!validProjectName(packageName)) { diff --git a/addon/ng2/commands/new.ts b/addon/ng2/commands/new.ts index 6e1d424bc200..ca30ef31896b 100644 --- a/addon/ng2/commands/new.ts +++ b/addon/ng2/commands/new.ts @@ -20,6 +20,8 @@ const NewCommand = Command.extend({ { name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] }, { name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] }, { name: 'directory', type: String, aliases: ['dir'] }, + { name: 'source-dir', type: String, default: 'src', aliases: ['sd'] }, + { name: 'prefix', type: String, default: 'app', aliases: ['p'] } ], run: function (commandOptions, rawArgs) { diff --git a/addon/ng2/utilities/dynamic-path-parser.js b/addon/ng2/utilities/dynamic-path-parser.js index 6528c6491426..281f9ea17f42 100644 --- a/addon/ng2/utilities/dynamic-path-parser.js +++ b/addon/ng2/utilities/dynamic-path-parser.js @@ -4,31 +4,17 @@ var fs = require('fs'); module.exports = function dynamicPathParser(project, entityName) { var projectRoot = project.root; - var appRoot = path.join('src', 'client', 'app'); + var appRoot = path.join(project.ngConfig.defaults.sourceDir, 'app'); var cwd = process.env.PWD; var rootPath = path.join(projectRoot, appRoot); var outputPath = path.join(rootPath, entityName); - + if (entityName.indexOf(path.sep) === 0) { outputPath = path.join(rootPath, entityName.substr(1)); } else if (cwd.indexOf(rootPath) >= 0) { outputPath = path.join(cwd, entityName); - } else if (cwd.indexOf(path.join(projectRoot, 'src', 'client')) >= 0) { - if (entityName.indexOf('app') === 0) { - outputPath = path.join(cwd, entityName); - } else { - outputPath = path.join(cwd, 'app', entityName); - } - } else if (cwd.indexOf(path.join(projectRoot, 'src')) >= 0) { - if (entityName.indexOf(path.join('client', 'app')) === 0) { - outputPath = path.join(cwd, entityName); - } else if (entityName.indexOf('client') === 0) { - outputPath = path.join(cwd, 'app', entityName); - } else { - outputPath = path.join(cwd, 'client', 'app', entityName); - } } if (!fs.existsSync(outputPath)) { diff --git a/lib/broccoli/angular2-app.js b/lib/broccoli/angular2-app.js index 58b894d9dd8e..3a84f89d2e52 100644 --- a/lib/broccoli/angular2-app.js +++ b/lib/broccoli/angular2-app.js @@ -10,10 +10,13 @@ const BroccoliFunnel = require('broccoli-funnel'); const BroccoliMergeTrees = require('broccoli-merge-trees'); const BroccoliUglify = require('broccoli-uglify-js'); const Project = require('ember-cli/lib/models/project'); +const config = require('../../addon/ng2/models/config'); class Angular2App extends BroccoliPlugin { constructor(project, inputNode, options) { + const ngConfig = config.CliConfig.fromProject(); + if (!options) { options = inputNode; inputNode = null; @@ -23,7 +26,7 @@ class Angular2App extends BroccoliPlugin { options = options || {}; this._options = options; - this._sourceDir = options.sourceDir || 'src/client'; + this._sourceDir = ngConfig.defaults.sourceDir || 'src'; this._inputNode = inputNode || this._buildInputTree(); this._destDir = options.destDir || ''; @@ -95,6 +98,7 @@ class Angular2App extends BroccoliPlugin { var buildTrees = [assetTree, tsTree, indexTree, vendorNpmTree]; + // Add available and supported CSS plugins. for (const suffix of ['sass', 'less', 'stylus', 'compass']) { const plugin = require(`./angular-broccoli-${suffix}`); const tree = plugin.makeBroccoliTree(this._inputNode, this._options[`${suffix}Compiler`]); @@ -113,6 +117,18 @@ class Angular2App extends BroccoliPlugin { } })); } + + // Add the public folder in. + buildTrees.push(new BroccoliFunnel(this._inputNode, { + include: ['public/**/*'], + getDestinationPath: (n) => { + if (n.startsWith('public')) { + return n.substr(6); + } + return n; + }, + name: 'PublicFolderFunnel' + })); var merged = new BroccoliMergeTrees(buildTrees, { overwrite: true }); merged = new BroccoliMergeTrees([merged, new BroccoliSwManifest([merged])]); diff --git a/lib/config/schema.json b/lib/config/schema.json index 06475848071c..070732a4bb20 100644 --- a/lib/config/schema.json +++ b/lib/config/schema.json @@ -82,6 +82,9 @@ "properties": { "prefix": { "type": "string" + }, + "sourceDir": { + "type": "string" } }, "additionalProperties": false diff --git a/tests/acceptance/dynamic-path-parser.spec.js b/tests/acceptance/dynamic-path-parser.spec.js index 9c2f257bfabe..9beab6306144 100644 --- a/tests/acceptance/dynamic-path-parser.spec.js +++ b/tests/acceptance/dynamic-path-parser.spec.js @@ -5,22 +5,28 @@ var path = require('path'); var dynamicPathParser = require('../../addon/ng2/utilities/dynamic-path-parser'); var mockFs = require('mock-fs'); -var appDir = `src${path.sep}client${path.sep}app`; +var appDir = `src${path.sep}app`; describe('dynamic path parser', () => { var project; var entityName = 'temp-name'; var rootName = path.parse(process.cwd()).root + 'project'; + var sourceDir = 'src'; beforeEach(() => { - project = { root: rootName }; + project = { + root: rootName, + ngConfig: { + defaults: { + sourceDir: sourceDir + } + } + }; var mockFolder = {}; mockFolder[rootName] = { src: { - client: { - app: { - 'index.html': '<html></html>', - 'temp-name': {} - } + app: { + 'index.html': '<html></html>', + 'temp-name': {} } } }; @@ -63,18 +69,16 @@ describe('dynamic path parser', () => { var mockFolder = {}; mockFolder[rootName] = { src: { - client: { - app: { - 'index.html': '<html></html>', - 'child-dir': { - 'temp-name': {} - } + app: { + 'index.html': '<html></html>', + 'child-dir': { + 'temp-name': {} } } } }; mockFs(mockFolder); - process.env.PWD = path.join(project.root, 'src', 'client', 'app', 'child-dir'); + process.env.PWD = path.join(project.root, 'src', 'app', 'child-dir'); var result = dynamicPathParser(project, entityName); expect(result.dir).to.equal(`${appDir}${path.sep}child-dir`); expect(result.name).to.equal(entityName); @@ -84,17 +88,15 @@ describe('dynamic path parser', () => { var mockFolder = {}; mockFolder[rootName] = { src: { - client: { - app: { - 'index.html': '<html></html>', - 'child-dir': {}, - 'temp-name': {} - } + app: { + 'index.html': '<html></html>', + 'child-dir': {}, + 'temp-name': {} } } }; mockFs(mockFolder); - process.env.PWD = path.join(project.root, 'src', 'client', 'app', 'child-dir'); + process.env.PWD = path.join(project.root, 'src', 'app', 'child-dir'); var result = dynamicPathParser(project, '..' + path.sep + entityName); expect(result.dir).to.equal(appDir); expect(result.name).to.equal(entityName); @@ -105,19 +107,17 @@ describe('dynamic path parser', () => { var mockFolder = {}; mockFolder[rootName] = { src: { - client: { - app: { - 'index.html': '<html></html>', - 'child-dir': { - 'grand-child-dir': {}, - 'temp-name': {} - } + app: { + 'index.html': '<html></html>', + 'child-dir': { + 'grand-child-dir': {}, + 'temp-name': {} } } } }; mockFs(mockFolder); - process.env.PWD = path.join(project.root, 'src', 'client', 'app', 'child-dir', 'grand-child-dir'); + process.env.PWD = path.join(project.root, 'src', 'app', 'child-dir', 'grand-child-dir'); var result = dynamicPathParser(project, '..' + path.sep + entityName); expect(result.dir).to.equal(`${appDir}${path.sep}child-dir`); expect(result.name).to.equal(entityName); @@ -127,15 +127,13 @@ describe('dynamic path parser', () => { var mockFolder = {}; mockFolder[rootName] = { src: { - client: { - app: { - '+my-route': {} - } + app: { + '+my-route': {} } } }; mockFs(mockFolder); - process.env.PWD = path.join(project.root, 'src', 'client', 'app', 'my-route'); + process.env.PWD = path.join(project.root, 'src', 'app', 'my-route'); var result = dynamicPathParser(project, entityName); expect(result.dir).to.equal(`${appDir}${path.sep}+my-route`); expect(result.name).to.equal(entityName); diff --git a/tests/acceptance/generate-class.spec.js b/tests/acceptance/generate-class.spec.js index 379c6bf6bf5e..9215bd32cfc9 100644 --- a/tests/acceptance/generate-class.spec.js +++ b/tests/acceptance/generate-class.spec.js @@ -9,7 +9,7 @@ const expect = require('chai').expect; const path = require('path'); const root = process.cwd(); -const testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app'); +const testPath = path.join(root, 'tmp', 'foo', 'src', 'app'); describe('Acceptance: ng generate class', function () { before(conf.setup); diff --git a/tests/acceptance/generate-component.spec.js b/tests/acceptance/generate-component.spec.js index bbd514a622be..34357bbbb028 100644 --- a/tests/acceptance/generate-component.spec.js +++ b/tests/acceptance/generate-component.spec.js @@ -33,15 +33,15 @@ describe('Acceptance: ng generate component', function () { it('ng generate component my-comp', function () { return ng(['generate', 'component', 'my-comp']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate component test' + path.sep + 'my-comp', function () { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', 'test')); return ng(['generate', 'component', 'test' + path.sep + 'my-comp']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'test', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }); }); @@ -49,36 +49,34 @@ describe('Acceptance: ng generate component', function () { it('ng generate component test' + path.sep + '..' + path.sep + 'my-comp', function () { return ng(['generate', 'component', 'test' + path.sep + '..' + path.sep + 'my-comp']) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate component my-comp from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { return ng(['generate', 'component', 'my-comp']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate component child-dir' + path.sep + 'my-comp from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -86,19 +84,18 @@ describe('Acceptance: ng generate component', function () { }) .then(() => { var testPath = path.join( - root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir', 'my-comp', 'my-comp.component.ts'); + root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate component child-dir' + path.sep + '..' + path.sep + 'my-comp from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -108,27 +105,26 @@ describe('Acceptance: ng generate component', function () { }) .then(() => { var testPath = - path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-comp', 'my-comp.component.ts'); + path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate component ' + path.sep + 'my-comp from a child dir, gens under ' + - path.join('src', 'client', 'app'), + path.join('src', 'app'), () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { return ng(['generate', 'component', path.sep + 'my-comp']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); @@ -137,14 +133,14 @@ describe('Acceptance: ng generate component', function () { return ng(['generate', 'component', '..' + path.sep + 'my-comp']).then(() => { throw new SilentError(`ng generate component ..${path.sep}my-comp from root dir should fail.`); }, (err) => { - expect(err).to.equal(`Invalid path: "..${path.sep}my-comp" cannot be above the "src${path.sep}client${path.sep}app" directory`); + expect(err).to.equal(`Invalid path: "..${path.sep}my-comp" cannot be above the "src${path.sep}app" directory`); }); }); it('ng generate component mycomp will prefix selector', () => { return ng(['generate', 'component', 'mycomp']) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'mycomp', 'mycomp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'mycomp', 'mycomp.component.ts'); expect(existsSync(testPath)).to.equal(true); var contents = fs.readFileSync(testPath, 'utf8'); expect(contents.indexOf('selector: \'app-mycomp\'') === -1).to.equal(false); @@ -154,7 +150,7 @@ describe('Acceptance: ng generate component', function () { it('ng generate component mycomp --no-prefix will not prefix selector', () => { return ng(['generate', 'component', 'mycomp', '--no-prefix']) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'mycomp', 'mycomp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'mycomp', 'mycomp.component.ts'); expect(existsSync(testPath)).to.equal(true); var contents = fs.readFileSync(testPath, 'utf8'); expect(contents.indexOf('selector: \'mycomp\'') === -1).to.equal(false); @@ -164,21 +160,21 @@ describe('Acceptance: ng generate component', function () { it('ng generate component myComp will succeed', () => { return ng(['generate', 'component', 'myComp']) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate component my-comp --inline-template', function () { return ng(['generate', 'component', 'my-comp', '--inline-template']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.html'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.html'); expect(existsSync(testPath)).to.equal(false); }); }); it('ng generate component my-comp --inline-style', function () { return ng(['generate', 'component', 'my-comp', '--inline-style']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-comp', 'my-comp.component.css'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.css'); expect(existsSync(testPath)).to.equal(false); }); }); diff --git a/tests/acceptance/generate-directive.spec.js b/tests/acceptance/generate-directive.spec.js index 76301bdd5b23..44ae806c895f 100644 --- a/tests/acceptance/generate-directive.spec.js +++ b/tests/acceptance/generate-directive.spec.js @@ -33,22 +33,22 @@ describe('Acceptance: ng generate directive', function () { it('ng generate flat directive', function () { return ng(['generate', 'directive', 'flat']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'flat.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'flat.directive.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate directive my-dir', function () { return ng(['generate', 'directive', 'my-dir', '--flat', 'false']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-dir', 'my-dir.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate directive test' + path.sep + 'my-dir', function () { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', 'test')); return ng(['generate', 'directive', 'test' + path.sep + 'my-dir', '--flat', 'false']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test', 'my-dir', 'my-dir.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'test', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }); }); @@ -56,18 +56,17 @@ describe('Acceptance: ng generate directive', function () { it('ng generate directive test' + path.sep + '..' + path.sep + 'my-dir', function () { return ng(['generate', 'directive', 'test' + path.sep + '..' + path.sep + 'my-dir', '--flat', 'false']) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-dir', 'my-dir.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate directive my-dir from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -75,18 +74,17 @@ describe('Acceptance: ng generate directive', function () { return ng(['generate', 'directive', 'my-dir', '--flat', 'false']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-dir', 'my-dir.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate directive child-dir' + path.sep + 'my-dir from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -95,19 +93,18 @@ describe('Acceptance: ng generate directive', function () { }) .then(() => { var testPath = path.join( - root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir', 'my-dir', 'my-dir.directive.ts'); + root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate directive child-dir' + path.sep + '..' + path.sep + 'my-dir from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -117,20 +114,19 @@ describe('Acceptance: ng generate directive', function () { }) .then(() => { var testPath = - path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-dir', 'my-dir.directive.ts'); + path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate directive ' + path.sep + 'my-dir from a child dir, gens under ' + - path.join('src', 'client', 'app'), + path.join('src', 'app'), () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -138,7 +134,7 @@ describe('Acceptance: ng generate directive', function () { return ng(['generate', 'directive', path.sep + 'my-dir', '--flat', 'false']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-dir', 'my-dir.directive.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-dir', 'my-dir.directive.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); @@ -147,7 +143,7 @@ describe('Acceptance: ng generate directive', function () { return ng(['generate', 'directive', '..' + path.sep + 'my-dir']).then(() => { throw new SilentError(`ng generate directive ..${path.sep}my-dir from root dir should fail.`); }, (err) => { - expect(err).to.equal(`Invalid path: "..${path.sep}my-dir" cannot be above the "src${path.sep}client${path.sep}app" directory`); + expect(err).to.equal(`Invalid path: "..${path.sep}my-dir" cannot be above the "src${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/generate-pipe.spec.js b/tests/acceptance/generate-pipe.spec.js index b021f5db544c..19af86494b65 100644 --- a/tests/acceptance/generate-pipe.spec.js +++ b/tests/acceptance/generate-pipe.spec.js @@ -33,33 +33,32 @@ describe('Acceptance: ng generate pipe', function () { it('ng generate pipe my-pipe', function () { return ng(['generate', 'pipe', 'my-pipe']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate pipe test' + path.sep + 'my-pipe', function () { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', 'test')); return ng(['generate', 'pipe', 'test' + path.sep + 'my-pipe']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'test', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate pipe test' + path.sep + '..' + path.sep + 'my-pipe', function () { return ng(['generate', 'pipe', 'test' + path.sep + '..' + path.sep + 'my-pipe']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate pipe my-pipe from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -67,18 +66,17 @@ describe('Acceptance: ng generate pipe', function () { return ng(['generate', 'pipe', 'my-pipe']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate pipe child-dir' + path.sep + 'my-pipe from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -87,18 +85,17 @@ describe('Acceptance: ng generate pipe', function () { }) .then(() => { var testPath = path.join( - root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir', 'my-pipe.pipe.ts'); + root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate pipe child-dir' + path.sep + '..' + path.sep + 'my-pipe from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -106,20 +103,19 @@ describe('Acceptance: ng generate pipe', function () { return ng(['generate', 'pipe', 'child-dir' + path.sep + '..' + path.sep + 'my-pipe']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate pipe ' + path.sep + 'my-pipe from a child dir, gens under ' + - path.join('src', 'client', 'app'), + path.join('src', 'app'), () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -127,7 +123,7 @@ describe('Acceptance: ng generate pipe', function () { return ng(['generate', 'pipe', path.sep + 'my-pipe']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-pipe.pipe.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-pipe.pipe.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); @@ -136,7 +132,7 @@ describe('Acceptance: ng generate pipe', function () { return ng(['generate', 'pipe', '..' + path.sep + 'my-pipe']).then(() => { throw new SilentError(`ng generate pipe ..${path.sep}my-pipe from root dir should fail.`); }, (err) => { - expect(err).to.equal(`Invalid path: "..${path.sep}my-pipe" cannot be above the "src${path.sep}client${path.sep}app" directory`); + expect(err).to.equal(`Invalid path: "..${path.sep}my-pipe" cannot be above the "src${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/generate-route.spec.js b/tests/acceptance/generate-route.spec.js index 6ae56355c7de..61f35ea3cdf6 100644 --- a/tests/acceptance/generate-route.spec.js +++ b/tests/acceptance/generate-route.spec.js @@ -10,9 +10,7 @@ const fs = require('fs'); const path = require('path'); const root = process.cwd(); - -const testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app'); - +const testPath = path.join(root, 'tmp', 'foo', 'src', 'app'); function fileExpectations(lazy, expectation) { const lazyPrefix = lazy ? '+' : ''; @@ -20,7 +18,6 @@ function fileExpectations(lazy, expectation) { expect(existsSync(path.join(testPath, dir, 'my-route.component.ts'))).to.equal(expectation); } - describe('Acceptance: ng generate route', function () { before(conf.setup); diff --git a/tests/acceptance/generate-service.spec.js b/tests/acceptance/generate-service.spec.js index 0909beda3215..71e31ac1cf2e 100644 --- a/tests/acceptance/generate-service.spec.js +++ b/tests/acceptance/generate-service.spec.js @@ -33,33 +33,32 @@ describe('Acceptance: ng generate service', function () { it('ng generate service my-svc', function () { return ng(['generate', 'service', 'my-svc']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-svc.service.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate service test' + path.sep + 'my-svc', function () { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', 'test')); return ng(['generate', 'service', 'test' + path.sep + 'my-svc']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'test', 'my-svc.service.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'test', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate service test' + path.sep + '..' + path.sep + 'my-svc', function () { return ng(['generate', 'service', 'test' + path.sep + '..' + path.sep + 'my-svc']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-svc.service.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }); }); it('ng generate service my-svc from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -67,18 +66,17 @@ describe('Acceptance: ng generate service', function () { return ng(['generate', 'service', 'my-svc']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-svc.service.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate service child-dir' + path.sep + 'my-svc from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -87,19 +85,18 @@ describe('Acceptance: ng generate service', function () { }) .then(() => { var testPath = path.join( - root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'child-dir', 'my-svc.service.ts'); + root, 'tmp', 'foo', 'src', 'app', '1', 'child-dir', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate service child-dir' + path.sep + '..' + path.sep + 'my-svc from a child dir', () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -109,20 +106,19 @@ describe('Acceptance: ng generate service', function () { }) .then(() => { var testPath = - path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1', 'my-svc.service.ts'); + path.join(root, 'tmp', 'foo', 'src', 'app', '1', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); it('ng generate service ' + path.sep + 'my-svc from a child dir, gens under ' + - path.join('src', 'client', 'app'), + path.join('src', 'app'), () => { - fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '1')); + fs.mkdirsSync(path.join(root, 'tmp', 'foo', 'src', 'app', '1')); return new Promise(function (resolve) { process.chdir('./src'); resolve(); }) - .then(() => process.chdir('./client')) .then(() => process.chdir('./app')) .then(() => process.chdir('./1')) .then(() => { @@ -130,7 +126,7 @@ describe('Acceptance: ng generate service', function () { return ng(['generate', 'service', path.sep + 'my-svc']) }) .then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', 'my-svc.service.ts'); + var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-svc.service.ts'); expect(existsSync(testPath)).to.equal(true); }, err => console.log('ERR: ', err)); }); @@ -139,7 +135,7 @@ describe('Acceptance: ng generate service', function () { return ng(['generate', 'service', '..' + path.sep + 'my-svc']).then(() => { throw new SilentError(`ng generate service ..${path.sep}my-svc from root dir should fail.`); }, (err) => { - expect(err).to.equal(`Invalid path: "..${path.sep}my-svc" cannot be above the "src${path.sep}client${path.sep}app" directory`); + expect(err).to.equal(`Invalid path: "..${path.sep}my-svc" cannot be above the "src${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/init.spec.js b/tests/acceptance/init.spec.js index 638043e908ba..89105f53fc9f 100644 --- a/tests/acceptance/init.spec.js +++ b/tests/acceptance/init.spec.js @@ -54,6 +54,7 @@ describe('Acceptance: ng init', function () { expected.forEach(function (file, index) { expected[index] = file.replace(/__name__/g, 'tmp'); expected[index] = expected[index].replace(/__styleext__/g, 'css'); + expected[index] = expected[index].replace(/__path__/g, 'src'); }); removeIgnored(expected); diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 97e1c4a24585..4a3a8a5a6639 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -110,11 +110,11 @@ describe('Basic end-to-end Workflow', function () { it('Can create a test component using `ng generate component test-component`', function () { this.timeout(10000); return ng(['generate', 'component', 'test-component']).then(function () { - var componentDir = path.join(process.cwd(), 'src', 'client', 'app', 'components', 'test-component'); - expect(existsSync(componentDir)); - expect(existsSync(path.join(componentDir, 'test-component.ts'))); - expect(existsSync(path.join(componentDir, 'test-component.html'))); - expect(existsSync(path.join(componentDir, 'test-component.css'))); + var componentDir = path.join(process.cwd(), 'src', 'app', 'test-component'); + expect(existsSync(componentDir)).to.be.equal(true); + expect(existsSync(path.join(componentDir, 'test-component.component.ts'))).to.be.equal(true); + expect(existsSync(path.join(componentDir, 'test-component.component.html'))).to.be.equal(true); + expect(existsSync(path.join(componentDir, 'test-component.component.css'))).to.be.equal(true); }); }); @@ -129,10 +129,10 @@ describe('Basic end-to-end Workflow', function () { it('Can create a test service using `ng generate service test-service`', function () { return ng(['generate', 'service', 'test-service']).then(function () { - var serviceDir = path.join(process.cwd(), 'src', 'client', 'app', 'services', 'test-service'); - expect(existsSync(serviceDir)); - expect(existsSync(path.join(serviceDir, 'test-service.ts'))); - expect(existsSync(path.join(serviceDir, 'test-service.spec.ts'))); + var serviceDir = path.join(process.cwd(), 'src', 'app'); + expect(existsSync(serviceDir)).to.be.equal(true); + expect(existsSync(path.join(serviceDir, 'test-service.service.ts'))).to.be.equal(true); + expect(existsSync(path.join(serviceDir, 'test-service.service.spec.ts'))).to.be.equal(true); }); }); @@ -147,10 +147,10 @@ describe('Basic end-to-end Workflow', function () { it('Can create a test pipe using `ng generate pipe test-pipe`', function () { return ng(['generate', 'pipe', 'test-pipe']).then(function () { - var pipeDir = path.join(process.cwd(), 'src', 'client', 'app', 'pipes', 'test-pipe'); - expect(existsSync(pipeDir)); - expect(existsSync(path.join(pipeDir, 'test-pipe.ts'))); - expect(existsSync(path.join(pipeDir, 'test-pipe.spec.ts'))); + var pipeDir = path.join(process.cwd(), 'src', 'app'); + expect(existsSync(pipeDir)).to.be.equal(true); + expect(existsSync(path.join(pipeDir, 'test-pipe.pipe.ts'))).to.be.equal(true); + expect(existsSync(path.join(pipeDir, 'test-pipe.pipe.spec.ts'))).to.be.equal(true); }); }); @@ -165,9 +165,9 @@ describe('Basic end-to-end Workflow', function () { it('Can create a test route using `ng generate route test-route`', function () { return ng(['generate', 'route', 'test-route']).then(function () { - var routeDir = path.join(process.cwd(), 'src', 'client', 'app', 'test-route'); - expect(existsSync(routeDir)); - expect(existsSync(path.join(routeDir, 'test-route.ts'))); + var routeDir = path.join(process.cwd(), 'src', 'app', '+test-route'); + expect(existsSync(routeDir)).to.be.equal(true); + expect(existsSync(path.join(routeDir, 'test-route.component.ts'))).to.be.equal(true); }); }); @@ -189,7 +189,7 @@ describe('Basic end-to-end Workflow', function () { return ng(['build', '--silent']) .then(function () { - expect(existsSync(tmpFileLocation)); + expect(existsSync(tmpFileLocation)).to.be.equal(true); }) .catch(err => { throw new Error(err) @@ -202,7 +202,7 @@ describe('Basic end-to-end Workflow', function () { sh.exec('npm install node-sass', { silent: true }); return ng(['generate', 'component', 'test-component']) .then(() => { - let componentPath = path.join(process.cwd(), 'src', 'client', 'app', 'test-component'); + let componentPath = path.join(process.cwd(), 'src', 'app', 'test-component'); let cssFile = path.join(componentPath, 'test-component.component.css'); let scssFile = path.join(componentPath, 'test-component.component.scss'); @@ -237,7 +237,7 @@ describe('Basic end-to-end Workflow', function () { sh.exec('npm install less', { silent: true }); return ng(['generate', 'component', 'test-component']) .then(() => { - let componentPath = path.join(process.cwd(), 'src', 'client', 'app', 'test-component'); + let componentPath = path.join(process.cwd(), 'src', 'app', 'test-component'); let cssFile = path.join(componentPath, 'test-component.component.css'); let lessFile = path.join(componentPath, 'test-component.component.less'); @@ -272,7 +272,7 @@ describe('Basic end-to-end Workflow', function () { sh.exec('npm install stylus', { silent: true }); return ng(['generate', 'component', 'test-component']) .then(() => { - let componentPath = path.join(process.cwd(), 'src', 'client', 'app', 'test-component'); + let componentPath = path.join(process.cwd(), 'src', 'app', 'test-component'); let cssFile = path.join(componentPath, 'test-component.component.css'); let stylusFile = path.join(componentPath, 'test-component.component.styl'); @@ -303,7 +303,7 @@ describe('Basic end-to-end Workflow', function () { it('Turn on `noImplicitAny` in tsconfig.json and rebuild', function (done) { this.timeout(420000); - const configFilePath = path.join(process.cwd(), 'src', 'client', 'tsconfig.json'); + const configFilePath = path.join(process.cwd(), 'src', 'tsconfig.json'); let config = require(configFilePath); config.compilerOptions.noImplicitAny = true; @@ -321,7 +321,7 @@ describe('Basic end-to-end Workflow', function () { .finally(function () { // Clean `tmp` folder process.chdir(path.resolve(root, '..')); - sh.rm('-rf', './tmp'); // tmp.teardown takes too long + // sh.rm('-rf', './tmp'); // tmp.teardown takes too long done(); }); });
5fdc0a666ac2d7024a060dd8b011b2abf2e40786
2021-01-14 23:04:04
Alan Agius
fix(@ngtools/webpack): use `getDiagnosticsForFile` instead of `getDiagnostics`
false
use `getDiagnosticsForFile` instead of `getDiagnostics`
fix
diff --git a/package.json b/package.json index bb0140182fee..03cff3dbf6dc 100644 --- a/package.json +++ b/package.json @@ -64,21 +64,21 @@ ] }, "devDependencies": { - "@angular/animations": "11.1.0-next.4", + "@angular/animations": "11.1.0-rc.0", "@angular/cdk": "11.0.3", - "@angular/common": "11.1.0-next.4", - "@angular/compiler": "11.1.0-next.4", - "@angular/compiler-cli": "11.1.0-next.4", - "@angular/core": "11.1.0-next.4", - "@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#579e491f4308ab4733a5c28ef7c5c734e3bf405e", - "@angular/forms": "11.1.0-next.4", - "@angular/localize": "11.1.0-next.4", + "@angular/common": "11.1.0-rc.0", + "@angular/compiler": "11.1.0-rc.0", + "@angular/compiler-cli": "11.1.0-rc.0", + "@angular/core": "11.1.0-rc.0", + "@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#d46e59817dc0ecebc10e2c716baa461afcd710cf", + "@angular/forms": "11.1.0-rc.0", + "@angular/localize": "11.1.0-rc.0", "@angular/material": "11.0.3", - "@angular/platform-browser": "11.1.0-next.4", - "@angular/platform-browser-dynamic": "11.1.0-next.4", - "@angular/platform-server": "11.1.0-next.4", - "@angular/router": "11.1.0-next.4", - "@angular/service-worker": "11.1.0-next.4", + "@angular/platform-browser": "11.1.0-rc.0", + "@angular/platform-browser-dynamic": "11.1.0-rc.0", + "@angular/platform-server": "11.1.0-rc.0", + "@angular/router": "11.1.0-rc.0", + "@angular/service-worker": "11.1.0-rc.0", "@babel/core": "7.12.10", "@babel/generator": "7.12.11", "@babel/plugin-transform-runtime": "7.12.10", diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index 35a904fc7bbd..773e7d76d466 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -31,8 +31,8 @@ "webpack": "^4.0.0" }, "devDependencies": { - "@angular/compiler": "11.1.0-next.4", - "@angular/compiler-cli": "11.1.0-next.4", + "@angular/compiler": "11.1.0-rc.0", + "@angular/compiler-cli": "11.1.0-rc.0", "typescript": "4.1.3", "webpack": "4.44.2" } diff --git a/packages/ngtools/webpack/src/ivy/plugin.ts b/packages/ngtools/webpack/src/ivy/plugin.ts index c117edf4271f..3130b69a6466 100644 --- a/packages/ngtools/webpack/src/ivy/plugin.ts +++ b/packages/ngtools/webpack/src/ivy/plugin.ts @@ -425,7 +425,17 @@ export class AngularWebpackPlugin { for (const sourceFile of builder.getSourceFiles()) { // Collect Angular template diagnostics if (!ignoreForDiagnostics.has(sourceFile)) { - diagnosticsReporter(angularCompiler.getDiagnostics(sourceFile)); + // The below check should be removed once support for compiler 11.0 is dropped. + // Also, the below require should be changed to an ES6 import. + if (angularCompiler.getDiagnosticsForFile) { + // @angular/compiler-cli 11.1+ + const { OptimizeFor } = require('@angular/compiler-cli/src/ngtsc/typecheck/api'); + diagnosticsReporter(angularCompiler.getDiagnosticsForFile(sourceFile, OptimizeFor.WholeProgram)); + } else { + // @angular/compiler-cli 11.0+ + const getDiagnostics = angularCompiler.getDiagnostics as (sourceFile: ts.SourceFile) => ts.Diagnostic[]; + diagnosticsReporter(getDiagnostics.call(angularCompiler, sourceFile)); + } } // Collect sources that are required to be emitted diff --git a/yarn.lock b/yarn.lock index 447b2f7db1c6..c5f15025c048 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-11.1.0-next.4.tgz#dea9d08a3d62c302f9c12c5064ab8adc6f2db228" - integrity sha512-ZwNyimfkhT029JvRSNnmflBGIGU8kR38yQsD1h4u4ypPwdoxYWonvI6mAbnRHAa85WG3qA8Fb8HA3kKuAXYDag== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-11.1.0-rc.0.tgz#963697f805a2b06c3e4de7e95ba5216d9f21123a" + integrity sha512-2Rw/4Mch5GccVb2uNNumeKLXS2g/g7FTXOS/PBhN38rxFuAzL2WE3Obx72y3xr3sfta2avfJdWQjIf+5B8qytw== dependencies: tslib "^2.0.0" @@ -26,17 +26,17 @@ optionalDependencies: parse5 "^5.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-11.1.0-next.4.tgz#e5602ac8f1df0eaa0f403383be4921c663765f14" - integrity sha512-O5tFWJl6yr45mvy84onR/gUYfxTqP10Pv2/0MJbLF/L3R1sK5LwBHg69SB6y8mdma/kwOMvemUK3lt9k9SrQQQ== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-11.1.0-rc.0.tgz#c19ffada76d3e01dfcca7e01b2244da1a724af1c" + integrity sha512-ZivVwORX8FC+Eq2oJsVAEw5EST/nCBlW/JHF5hpyfuBynhDmH4vQunPQapHfhP841FGiSGjGKTXFTBw09/gBpA== dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-11.1.0-next.4.tgz#feaada877589cdabbcc687e939ffde4393293605" - integrity sha512-E1/6e0JS3Saj9nG12eo8q0zJJXlbwtPyuWOVK7EK57OJdF6PsYIAf9g93TKk2QA+iimbNklconj/2LQj9cCGMQ== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-11.1.0-rc.0.tgz#8bb026939a421190ac55dacaf7aca63d568ace82" + integrity sha512-YYyg/ixzqxoqaRnoInT60BwqA3enfcQvK2BcaUKvmhyyzqK+fnAiCiRgBl3uZGu+kQgAZuleUKdFmyHJZ275sQ== dependencies: "@babel/core" "^7.8.6" "@babel/types" "^7.8.6" @@ -54,10 +54,10 @@ tslib "^2.0.0" yargs "^16.1.1" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.1.0-next.4.tgz#abf575efdec0fcc76cc15205431e460ed4063953" - integrity sha512-RP2kXZsPxtHPfAngYz0TPkGBQlJxD0CIC0+Gn3Ck2axSAWGCwRCuiozK9NVEIOzKT3VNtFZB9+esYzSYawcr2w== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.1.0-rc.0.tgz#de784751a59d619ebccb7b0e6c58e77aaab9bce3" + integrity sha512-ArVrXo/ozIb/MIGtjSrXF3+ZUjUUlQcOQ1+/zdWDeH+B8Gs78p1C6VQoBx8j27UsJ1XgX/Khsl3Zg3nzPq1kOA== dependencies: tslib "^2.0.0" @@ -66,10 +66,10 @@ resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-9.0.0.tgz#87e0bef4c369b6cadae07e3a4295778fc93799d5" integrity sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ== -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.1.0-next.4.tgz#d7bfc8e77f7bddcad40b45d52679d2eec5cbc049" - integrity sha512-2fsArpeyIDiZa2jjhj+FFCS+Rgj2+D3CoRUcAXNly+SVEL+yR8fZSCsBsFHFbReQnrAE/XvU0N63Q2jD3m56Yw== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-11.1.0-rc.0.tgz#2185e63d085921641c1c11ca57a29d16f5d881ed" + integrity sha512-OqYl5yGjLKeoMlWDpyEQWgWxf6qs7pJzHtw8220Alqio0lLTQTpldUBk8QgdRL75A+lZ/L8YqsLssozTyytPKw== dependencies: tslib "^2.0.0" @@ -85,9 +85,9 @@ dependencies: tslib "^2.0.0" -"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#579e491f4308ab4733a5c28ef7c5c734e3bf405e": +"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#d46e59817dc0ecebc10e2c716baa461afcd710cf": version "0.0.0" - resolved "https://github.com/angular/dev-infra-private-builds.git#579e491f4308ab4733a5c28ef7c5c734e3bf405e" + resolved "https://github.com/angular/dev-infra-private-builds.git#d46e59817dc0ecebc10e2c716baa461afcd710cf" dependencies: "@angular/benchpress" "0.2.1" "@bazel/buildifier" "^0.29.0" @@ -117,17 +117,17 @@ yaml "^1.10.0" yargs "^16.1.1" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-11.1.0-next.4.tgz#c5a4b516aeadf6c3672c33595b66b04ae1050b4f" - integrity sha512-ZkW8bsYPL8C10RjhwdU1G07TVWyxxfHzzlLORFZ3CQgXoZtXBNTh0P7VDw44ZDLHmfwuksxryYVHTTrCeGQPew== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-11.1.0-rc.0.tgz#7c03253e2b4a57ad6fe6fa0ecc0b436fb77c6097" + integrity sha512-yAFoMaPGiA2JleIQ8wwEaILMIGiM3tBg6RFcMkOz/pw3ihlh6cyj6UN5yM2z4SFwn87p8eSyd6XQBTybg5Ht4A== dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-11.1.0-next.4.tgz#124671437a4b43a1d70e824abedb04c9fe64d656" - integrity sha512-PCV+gzszB3OMHyWhAgDy9QSZCXlTXmhUYWy/4FGvc37LzRTFj+6U74y7mFIt3AXX547a3WbBU5/VLQw+ykhHBQ== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-11.1.0-rc.0.tgz#8fac82a2453ff68cdce0cdc15e6f09f95320a44e" + integrity sha512-06F9Bzl6jAgu+4ZPSkG9XWgd/ZF+1/lQQ0RfcTEGcYNfcqXv4EaM9R2eCCFLFEClEz0pA0Bis9l2jtf8Z6c02A== dependencies: "@babel/core" "7.8.3" glob "7.1.2" @@ -140,40 +140,40 @@ dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.1.0-next.4.tgz#b77709cd540affe41b23b38f941c75b9f3efda9d" - integrity sha512-RyLrIKFbSBxtERnZkZ1nOn4912JmuFjOdU83b+j22DWBmMJVi4+aWYZcjJPSnjLTrKMwvpDIGwS95+GcNL8Gww== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-11.1.0-rc.0.tgz#1e9df5f9a6a6284256db7f8b3a8c0e9a8fa21e30" + integrity sha512-9Tiji8ahz23mozpZkuTjwH/GBSVLR+kdfeHpdArY7c1F7iyLgdHSnxgTfdUyz4fd+zg7a7y4YGP99iOJKnT3Ug== dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-11.1.0-next.4.tgz#dbf902fb7034bd89b77369c28ac76dfd800d45af" - integrity sha512-y8rvqieQHXTgXtrJcjsYLIVYE5wAxSpLZ66M5/pbnO/cxtl+UUQRfUVpNOFO8ZvCZyzF/6cgcUw2/bm7GxdW8A== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-11.1.0-rc.0.tgz#4bfeea5a45eb883e2f4236a959d8529ac634509e" + integrity sha512-5Qx6iBeoBuvFGA/CMiMaj6tIz6V9uM2tWuMbT9UVM5HW0ZgBRJzHTlHjVZE1LpV3lwBVORD5G2Txgji4ti8Mjg== dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-11.1.0-next.4.tgz#ea1f25c0034e970bc74a0b1b26c59e7a4cefb143" - integrity sha512-RSYx2D/g4Pn33JUQIdGEmXDWYiztZH+tqes2408msWiq9PNXd4JHdmamHNS/dnCB/OMoxtFG2N++jz10bbhEqQ== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-11.1.0-rc.0.tgz#a6954df0a6e100c00e33077dab1c5429b6ae8622" + integrity sha512-KUkNXGVrObstqw81STkERH+8Dp8//HNeadISAuCVMtkkqVnSSkASVce4jBHyCu4dg3hFEGAdAgMWOqC/Dr7OSQ== dependencies: domino "^2.1.2" tslib "^2.0.0" xhr2 "^0.2.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-11.1.0-next.4.tgz#1204848b79f97503da6f4a2cfe0dd6f9bd0046db" - integrity sha512-l4LW1/BHTBihV9+d2KYOmvTJZUS75JdXziB7iNCGp7ZBRD51YDr8rbBHQnQTYVE8lFi5y6uzZonkrHVEm9CKWQ== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-11.1.0-rc.0.tgz#5bf8a01d7d09e0aac36b3d8fe3119c8a6cc2efff" + integrity sha512-yevlvefmCa0ltlKPeTz9sT5d5UKVthMB2mOIopVsbr3U0HKVbIMJUhaLQmWdbBC1L2AKuBmUm4ljuOWEsIO4VA== dependencies: tslib "^2.0.0" -"@angular/[email protected]": - version "11.1.0-next.4" - resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-11.1.0-next.4.tgz#58af6e3e47866d718ec8ad710bb4ff55833ec3f5" - integrity sha512-fpL6bXGc5QAIx3tphkgXntYB4OHSUek7zlAJTM8MPgiVrdCErpjLUufATYII+34X0blgZ1AarpWwpI/MOZUMiA== +"@angular/[email protected]": + version "11.1.0-rc.0" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-11.1.0-rc.0.tgz#08d2073a6b7c86894fc0b9647405883576331021" + integrity sha512-8eRlxwK+56Po0LUEfObYxhoWe0yruMgRmfe46wel02rz/aPXnc7wqbxb6/PDYiJrTvBxkyxZ1MAh4ezAo6py+Q== dependencies: tslib "^2.0.0"
0dd9367cb8bcd139d46b2339eec92a67a700da93
2020-11-03 01:07:40
Renovate Bot
build: update webpack-dev-server to version 3.11.0
false
update webpack-dev-server to version 3.11.0
build
diff --git a/package.json b/package.json index dfaa52628aaf..61eb8bc9aaef 100644 --- a/package.json +++ b/package.json @@ -230,7 +230,7 @@ "verdaccio-auth-memory": "^9.7.2", "webpack": "4.44.2", "webpack-dev-middleware": "3.7.2", - "webpack-dev-server": "3.10.3", + "webpack-dev-server": "3.11.0", "webpack-merge": "5.3.0", "webpack-sources": "2.0.1", "webpack-subresource-integrity": "1.5.1", diff --git a/yarn.lock b/yarn.lock index 7d2812b08b02..be6a3b10a195 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6002,7 +6002,7 @@ html-encoding-sniffer@^1.0.2: dependencies: whatwg-encoding "^1.0.1" -html-entities@^1.2.1, html-entities@^1.3.1: +html-entities@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.3.1.tgz#fb9a1a4b5b14c5daba82d3e34c6ae4fe701a0e44" integrity sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA== @@ -7606,7 +7606,7 @@ log4js@^6.2.1: rfdc "^1.1.4" streamroller "^2.2.4" -loglevel@^1.6.6, loglevel@^1.6.8: +loglevel@^1.6.8: version "1.7.0" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.0.tgz#728166855a740d59d38db01cf46f042caa041bb0" integrity sha512-i2sY04nal5jDcagM3FMfG++T69GEEM8CYuOfeOIvmXzOIcwE9a/CJPR0MFM97pYMj/u10lzz7/zd7+qwhrBTqQ== @@ -9316,7 +9316,7 @@ popper.js@^1.14.1: resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== -portfinder@^1.0.25, portfinder@^1.0.26: +portfinder@^1.0.26: version "1.0.28" resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== @@ -11043,14 +11043,6 @@ [email protected]: json3 "^3.3.2" url-parse "^1.4.3" [email protected]: - version "0.3.19" - resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d" - integrity sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw== - dependencies: - faye-websocket "^0.10.0" - uuid "^3.0.1" - [email protected]: version "0.3.20" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.20.tgz#b26a283ec562ef8b2687b44033a4eeceac75d855" @@ -11254,7 +11246,7 @@ spdy-transport@^3.0.0: readable-stream "^3.0.6" wbuf "^1.7.3" -spdy@^4.0.1, spdy@^4.0.2: +spdy@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.2.tgz#b74f466203a3eda452c02492b91fb9e84a27677b" integrity sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA== @@ -12431,7 +12423,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== -uuid@^3.0.0, uuid@^3.0.1, uuid@^3.3.2, uuid@^3.4.0: +uuid@^3.0.0, uuid@^3.3.2, uuid@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== @@ -12648,45 +12640,6 @@ [email protected], webpack-dev-middleware@^3.7.2: range-parser "^1.2.1" webpack-log "^2.0.0" [email protected]: - version "3.10.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.10.3.tgz#f35945036813e57ef582c2420ef7b470e14d3af0" - integrity sha512-e4nWev8YzEVNdOMcNzNeCN947sWJNd43E5XvsJzbAL08kGc2frm1tQ32hTJslRS+H65LCb/AaUCYU7fjHCpDeQ== - dependencies: - ansi-html "0.0.7" - bonjour "^3.5.0" - chokidar "^2.1.8" - compression "^1.7.4" - connect-history-api-fallback "^1.6.0" - debug "^4.1.1" - del "^4.1.1" - express "^4.17.1" - html-entities "^1.2.1" - http-proxy-middleware "0.19.1" - import-local "^2.0.0" - internal-ip "^4.3.0" - ip "^1.1.5" - is-absolute-url "^3.0.3" - killable "^1.0.1" - loglevel "^1.6.6" - opn "^5.5.0" - p-retry "^3.0.1" - portfinder "^1.0.25" - schema-utils "^1.0.0" - selfsigned "^1.10.7" - semver "^6.3.0" - serve-index "^1.9.1" - sockjs "0.3.19" - sockjs-client "1.4.0" - spdy "^4.0.1" - strip-ansi "^3.0.1" - supports-color "^6.1.0" - url "^0.11.0" - webpack-dev-middleware "^3.7.2" - webpack-log "^2.0.0" - ws "^6.2.1" - yargs "12.0.5" - [email protected]: version "3.11.0" resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz#8f154a3bce1bcfd1cc618ef4e703278855e7ff8c" @@ -13052,24 +13005,6 @@ yargs-parser@^18.0.0, yargs-parser@^18.1.0, yargs-parser@^18.1.2, yargs-parser@^ camelcase "^5.0.0" decamelize "^1.2.0" [email protected], yargs@^12.0.5: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== - dependencies: - cliui "^4.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^11.1.1" - [email protected]: version "15.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.0.tgz#403af6edc75b3ae04bf66c94202228ba119f0976" @@ -13087,6 +13022,24 @@ [email protected]: y18n "^4.0.0" yargs-parser "^18.1.0" +yargs@^12.0.5: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" + yargs@^13.3.2: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
f816162db7b6bb0c8893069561d1dee9da0f2b2c
2023-11-30 23:47:02
Angular Robot
build: update angular
false
update angular
build
diff --git a/.github/workflows/assistant-to-the-branch-manager.yml b/.github/workflows/assistant-to-the-branch-manager.yml index 7a010c5b0756..f429a9bb5534 100644 --- a/.github/workflows/assistant-to-the-branch-manager.yml +++ b/.github/workflows/assistant-to-the-branch-manager.yml @@ -16,6 +16,6 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: persist-credentials: false - - uses: angular/dev-infra/github-actions/branch-manager@f00131a6ab074797904b905c6a7637af1ce7ce80 + - uses: angular/dev-infra/github-actions/branch-manager@3b93d927624e63c84b79f412fd708e9bcd2092e0 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 921511a553fa..ce41c970fb0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup ESLint Caching uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 with: @@ -71,11 +71,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/configure-remote@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Build release targets @@ -92,11 +92,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/configure-remote@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Run tests @@ -124,13 +124,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/configure-remote@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} @@ -147,13 +147,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/configure-remote@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} @@ -165,13 +165,13 @@ jobs: SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Setup Bazel RBE - uses: angular/dev-infra/github-actions/bazel/configure-remote@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/configure-remote@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Run E2E Browser tests env: SAUCE_USERNAME: ${{ vars.SAUCE_USERNAME }} @@ -199,11 +199,11 @@ jobs: CIRCLE_BRANCH: ${{ github.ref_name }} steps: - name: Initialize environment - uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@3b93d927624e63c84b79f412fd708e9bcd2092e0 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel - uses: angular/dev-infra/github-actions/bazel/setup@f00131a6ab074797904b905c6a7637af1ce7ce80 + uses: angular/dev-infra/github-actions/bazel/setup@3b93d927624e63c84b79f412fd708e9bcd2092e0 - run: yarn admin snapshots --verbose env: SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }} diff --git a/.github/workflows/dev-infra.yml b/.github/workflows/dev-infra.yml index 4970d3857f14..801458c94768 100644 --- a/.github/workflows/dev-infra.yml +++ b/.github/workflows/dev-infra.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: angular/dev-infra/github-actions/commit-message-based-labels@f00131a6ab074797904b905c6a7637af1ce7ce80 + - uses: angular/dev-infra/github-actions/commit-message-based-labels@3b93d927624e63c84b79f412fd708e9bcd2092e0 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} post_approval_changes: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: angular/dev-infra/github-actions/post-approval-changes@f00131a6ab074797904b905c6a7637af1ce7ce80 + - uses: angular/dev-infra/github-actions/post-approval-changes@3b93d927624e63c84b79f412fd708e9bcd2092e0 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/feature-requests.yml b/.github/workflows/feature-requests.yml index 35f3f2447706..696a4f26e33d 100644 --- a/.github/workflows/feature-requests.yml +++ b/.github/workflows/feature-requests.yml @@ -16,6 +16,6 @@ jobs: if: github.repository == 'angular/angular-cli' runs-on: ubuntu-latest steps: - - uses: angular/dev-infra/github-actions/feature-request@f00131a6ab074797904b905c6a7637af1ce7ce80 + - uses: angular/dev-infra/github-actions/feature-request@3b93d927624e63c84b79f412fd708e9bcd2092e0 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/package.json b/package.json index ddfec503f51d..a976da0ccd62 100644 --- a/package.json +++ b/package.json @@ -59,23 +59,23 @@ }, "devDependencies": { "@ampproject/remapping": "2.2.1", - "@angular/animations": "17.1.0-next.1", - "@angular/bazel": "https://github.com/angular/bazel-builds.git#18fe69c8d9558564187fbea2d47acaac34af3ec9", - "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#39de01a4b72a744a86f1062872a2822a609fe975", + "@angular/animations": "17.1.0-next.2", + "@angular/bazel": "https://github.com/angular/bazel-builds.git#2570dc3fad334cfd9bc15e540112a98c542cfe9c", + "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#3b41bc98abe89bd664f506b418c7295b252ccbb2", "@angular/cdk": "17.1.0-next.0", - "@angular/common": "17.1.0-next.1", - "@angular/compiler": "17.1.0-next.1", - "@angular/compiler-cli": "17.1.0-next.1", - "@angular/core": "17.1.0-next.1", - "@angular/forms": "17.1.0-next.1", - "@angular/localize": "17.0.4", + "@angular/common": "17.1.0-next.2", + "@angular/compiler": "17.1.0-next.2", + "@angular/compiler-cli": "17.1.0-next.2", + "@angular/core": "17.1.0-next.2", + "@angular/forms": "17.1.0-next.2", + "@angular/localize": "17.0.5", "@angular/material": "17.1.0-next.0", - "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#581fbc0546738cf4e0ded85d2ba307ba20b781cc", - "@angular/platform-browser": "17.1.0-next.1", - "@angular/platform-browser-dynamic": "17.1.0-next.1", - "@angular/platform-server": "17.1.0-next.1", - "@angular/router": "17.1.0-next.1", - "@angular/service-worker": "17.1.0-next.1", + "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#9bce3bcdeab665b1ed9b2115e803da6af899a2eb", + "@angular/platform-browser": "17.1.0-next.2", + "@angular/platform-browser-dynamic": "17.1.0-next.2", + "@angular/platform-server": "17.1.0-next.2", + "@angular/router": "17.1.0-next.2", + "@angular/service-worker": "17.1.0-next.2", "@babel/core": "7.23.5", "@babel/generator": "7.23.5", "@babel/helper-annotate-as-pure": "7.22.5", diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index 61830a4ea2ad..643afd7f4685 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -28,8 +28,8 @@ }, "devDependencies": { "@angular-devkit/core": "0.0.0-PLACEHOLDER", - "@angular/compiler": "17.1.0-next.1", - "@angular/compiler-cli": "17.1.0-next.1", + "@angular/compiler": "17.1.0-next.2", + "@angular/compiler-cli": "17.1.0-next.2", "typescript": "5.3.2", "webpack": "5.89.0" } diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json index d7f0a5594c40..7c49a2a3b10d 100644 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ b/tests/legacy-cli/e2e/ng-snapshot/package.json @@ -2,21 +2,21 @@ "description": "snapshot versions of Angular for e2e testing", "private": true, "dependencies": { - "@angular/animations": "github:angular/animations-builds#4865268bff5d32a928e8546a61f3bd043f28c823", - "@angular/cdk": "github:angular/cdk-builds#6c9bd12400d86ad5354030fa0b7706d57781b1e5", - "@angular/common": "github:angular/common-builds#16e8e72b6552793e589e6322e3cd87944ddb71fe", - "@angular/compiler": "github:angular/compiler-builds#94049981073835ced6c1330890e85996eb5f5cb4", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#141eff8a68377a60a3ddb94302519be6206d47ea", - "@angular/core": "github:angular/core-builds#c6526c78d4e90b82dac7932f9ba485c74aa3a317", - "@angular/forms": "github:angular/forms-builds#e22ea827855b92f62431f123ae631a1b3441093d", - "@angular/language-service": "github:angular/language-service-builds#1e84d0c3fbc7b53ccd54bd5e3faf70af4cf79e9c", - "@angular/localize": "github:angular/localize-builds#69487b8e1cd271e4fd1ed6e0dc4ec1873aaf959d", - "@angular/material": "github:angular/material-builds#96cad6e0eb2930685510ee3eb3816c3e5e3eadc9", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#566d5998932256915b80fb326d16101b804f6cca", - "@angular/platform-browser": "github:angular/platform-browser-builds#6f49ec05a9e1a6099ff82642a883d0f8b39125f3", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#9fc9e8dd5dcf30bec8e087fe317601c9b043a892", - "@angular/platform-server": "github:angular/platform-server-builds#cff18fab6d97516381a2cbc6001d460fe0c6ad1a", - "@angular/router": "github:angular/router-builds#33c466e507dda32b6f8a776673bd8e074c3d2b64", - "@angular/service-worker": "github:angular/service-worker-builds#5caf2e61e5b869b442e86fd1d7629df950f5b5e5" + "@angular/animations": "github:angular/animations-builds#8eb98bc9b3cddf0bf844c9525edb4b948e1a04dc", + "@angular/cdk": "github:angular/cdk-builds#12bfa09ecea359ceef90c2eec1f2a585e98ecb82", + "@angular/common": "github:angular/common-builds#c71cc2d5748e113d94493caa094b55e6f5ba78f1", + "@angular/compiler": "github:angular/compiler-builds#eaa54336e7fe153923aef12ad65013f2274bc2e8", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#f8b40e41b6375fa50c5a2c622c3850459570676d", + "@angular/core": "github:angular/core-builds#718ab067838df1a098d3286b5f3d842cdb75e4d8", + "@angular/forms": "github:angular/forms-builds#dbd1f5d78e11ae191befd3b7419415b2b24797c6", + "@angular/language-service": "github:angular/language-service-builds#7b62a5da436903dd106d49043dddbbbb45a8a3bc", + "@angular/localize": "github:angular/localize-builds#c7687ab14bc577f46f95b0fef74af47d980efb23", + "@angular/material": "github:angular/material-builds#9017a64d60cc09ad51338a5075fda9a03d0f4bf8", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#a0a970499b7b6c70b93af4b052ff2289ef9c78eb", + "@angular/platform-browser": "github:angular/platform-browser-builds#7b359acf8ce18c8554775754da2877d064a28201", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#57f4609f6afcc7946257da04c32c078afb72be5e", + "@angular/platform-server": "github:angular/platform-server-builds#73514eb02dccb78501975c2d79d8dc5f3b8c52a8", + "@angular/router": "github:angular/router-builds#cd381a564fc227a1589a651f947ac6ceed825c6e", + "@angular/service-worker": "github:angular/service-worker-builds#e3026fa5d1701e890925ab15749ff5574b31bc34" } } diff --git a/yarn.lock b/yarn.lock index 41cb12360a70..fb0b32188fb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -116,17 +116,17 @@ rxjs "7.8.1" source-map "0.7.4" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-17.1.0-next.1.tgz#11b47e75a9e8a0349e7cc7ee882a5350e708d74b" - integrity sha512-L+FMtm7oqV6gxmvQoc1UXVzXpVjXdui05cI11vp1odwtRRUFe9BaEiqm+/m2/6fwEsVKwWFqTA414Vd8c32aug== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-17.1.0-next.2.tgz#7f43cbbc554c1fb53f8046fc775b716b230d0992" + integrity sha512-ql8JCOAVY3vN57vuSDeJ6WPfYaWV9H7qmvWe7KIey0B8D8wYN6Yw8p2jPmzoF4sdLsVV3oU10C8+JYwS6S8J3A== dependencies: tslib "^2.3.0" -"@angular/bazel@https://github.com/angular/bazel-builds.git#18fe69c8d9558564187fbea2d47acaac34af3ec9": - version "17.1.0-next.1+sha-e3dbadd" - uid "18fe69c8d9558564187fbea2d47acaac34af3ec9" - resolved "https://github.com/angular/bazel-builds.git#18fe69c8d9558564187fbea2d47acaac34af3ec9" +"@angular/bazel@https://github.com/angular/bazel-builds.git#2570dc3fad334cfd9bc15e540112a98c542cfe9c": + version "17.1.0-next.2+sha-6462ddd" + uid "2570dc3fad334cfd9bc15e540112a98c542cfe9c" + resolved "https://github.com/angular/bazel-builds.git#2570dc3fad334cfd9bc15e540112a98c542cfe9c" dependencies: "@microsoft/api-extractor" "^7.24.2" magic-string "^0.30.0" @@ -140,10 +140,10 @@ "@angular/core" "^13.0.0 || ^14.0.0-0" reflect-metadata "^0.1.13" -"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#39de01a4b72a744a86f1062872a2822a609fe975": - version "0.0.0-f00131a6ab074797904b905c6a7637af1ce7ce80" - uid "39de01a4b72a744a86f1062872a2822a609fe975" - resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#39de01a4b72a744a86f1062872a2822a609fe975" +"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#3b41bc98abe89bd664f506b418c7295b252ccbb2": + version "0.0.0-3b93d927624e63c84b79f412fd708e9bcd2092e0" + uid "3b41bc98abe89bd664f506b418c7295b252ccbb2" + resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#3b41bc98abe89bd664f506b418c7295b252ccbb2" dependencies: "@angular-devkit/build-angular" "17.0.0" "@angular/benchpress" "0.3.0" @@ -170,7 +170,7 @@ clang-format "1.8.0" highlight.js "^11.8.0" html-entities "^2.4.0" - marked "^10.0.0" + marked "^11.0.0" marked-mangle "^1.1.4" preact "^10.17.1" preact-render-to-string "^6.2.1" @@ -195,17 +195,17 @@ optionalDependencies: parse5 "^7.1.2" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-17.1.0-next.1.tgz#752861457eeb4ec818207829d3adb719fdc7f1cd" - integrity sha512-PxCcmxhiuuzpCwI6gYB8nIKFmHdjrXw+TD+EThu06of2yn6jmnMMYHsQGI1WfruhjTIRh4vXSICC8hyJ73f13w== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-17.1.0-next.2.tgz#d1199dae4edbae3f529dce9ac7175757d3f414ac" + integrity sha512-5RQ7hN4hupIoO/s1wyq035zi1WZskkBSaDLHo1UhsOlxqVwXQvq5dNU93YrjkyK6XEmUsFuLSX7MU0v0sPbBxA== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-17.1.0-next.1.tgz#6c40fb2e908872236b64747f892a9f7fa4baa0f1" - integrity sha512-0iXKjv1gJjQyQS/Zw7B3vNktiAyTR858rUypTYbmk3CvWRkNNEsHM54MbMeiloVsP5nfLN2t3G8QVJ2jbZFSTQ== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-17.1.0-next.2.tgz#82f605a355de8fc2732dcf8d67455460df282cc4" + integrity sha512-TIB6JLHoLe1OHcFTcWJXBdfZ9VLZOLsbaHPtwCNwp5fAaaY1b3QvyxVumoFWJhjwiYP4+XPgwnTB1iXw5CqUDw== dependencies: "@babel/core" "7.23.2" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -216,17 +216,17 @@ tslib "^2.3.0" yargs "^17.2.1" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-17.1.0-next.1.tgz#565c88ca4b7d7f4be0c19c935bd7198e0f58e75b" - integrity sha512-YktCnpM31KQy6fkVHojkExoNurXhzqRRDrzjYVAt3gNRfhDVtac6o1O960IiXzfXcVr5GZPojCLwxrweiPJ+ww== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-17.1.0-next.2.tgz#89c67f707bb89b5607fff63ea9e4eeec53f1a879" + integrity sha512-8xxkQESwvBWacgXdZz0kMA/BuOBjuX5CSXlLRlocYMbCHhHiidARUdvrDaJKDW9HjKZCpgVLeLwce3ZZW6bKaA== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-17.1.0-next.1.tgz#bed1ccad43e7396aedf6dd8d6817998473f562b0" - integrity sha512-2FESyR3XGUScbVBtHUG1ufxxP5lgLigt21BL1DTjz4q4CZ7qXYU+16H7qkv07Pb4+srm313zdx+egoiGHpOXcA== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-17.1.0-next.2.tgz#3a60e540db5288fa8f0724cf4c7aaab81fbafd47" + integrity sha512-h1vlehM+z8WQh2FhunK0w7Z5y2YPjAvMQQPu5RX1/5sx3geVXkH6b2ebdVlPYdnFbKa3OFZl9nDeyl4u3+o3zg== dependencies: tslib "^2.3.0" @@ -237,17 +237,17 @@ dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-17.1.0-next.1.tgz#d300e0dafb6b9fb62bba6661a332310ab6e7281b" - integrity sha512-u+uaHcah9bCK2VToJGZJYNNy2/X4O19TnqX99a1Pxsfj5i47CU4mP/iSjDUHYOhBxknX3Xvf8x7TzEfCE9sYnw== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-17.1.0-next.2.tgz#701d810ccecb696f25aa59a31ee6f10c6f1f3917" + integrity sha512-7mfaLpVBlor7Dsh+bN56/14/kdCUb9f5r/zCTXrLtl5jok6jPWC6anBaCCP92Ebjfo2eVwIL9+3IG18MlXbGOQ== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.0.4" - resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-17.0.4.tgz#f7454e955a15a90a76c2bfbd3df5db7768d066cd" - integrity sha512-4kLvkwAI9lVaxKzMVjF/0do/Xfn4r3W1bk9Xzb7fYLS21wz11ouL0aV7umtHT5DOZiwkY/F8rOYaJm5Fkz8ubw== +"@angular/[email protected]": + version "17.0.5" + resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-17.0.5.tgz#ead8a15d81c01888d6cca0dfc3276726ab866c7e" + integrity sha512-9U/nNz490fX5ErDYUgaJIyHb39BvU00SkgfMIQG1O/QRxWZJxcoZ+8+fQFrZCsw/VIiH9sRIyYhM4AJsxC01hQ== dependencies: "@babel/core" "7.23.2" fast-glob "3.3.1" @@ -307,47 +307,47 @@ "@material/typography" "15.0.0-canary.a246a4439.0" tslib "^2.3.0" -"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#581fbc0546738cf4e0ded85d2ba307ba20b781cc": - version "0.0.0-f00131a6ab074797904b905c6a7637af1ce7ce80" - uid "581fbc0546738cf4e0ded85d2ba307ba20b781cc" - resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#581fbc0546738cf4e0ded85d2ba307ba20b781cc" +"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#9bce3bcdeab665b1ed9b2115e803da6af899a2eb": + version "0.0.0-3b93d927624e63c84b79f412fd708e9bcd2092e0" + uid "9bce3bcdeab665b1ed9b2115e803da6af899a2eb" + resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#9bce3bcdeab665b1ed9b2115e803da6af899a2eb" dependencies: "@yarnpkg/lockfile" "^1.1.0" typescript "~4.9.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.1.0-next.1.tgz#e5218563ff85da6873fa7e542921ee199554ac27" - integrity sha512-GENm7eDoWEYTkudgpjnFb8daGI6ESQDb1X0tJETi1D/LRZsVt+wLykREMaDH5+pb5PoXAvvrozf7u4JcyG/6fQ== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-17.1.0-next.2.tgz#276510b225bae17c6e792a7aaea2e7853e716a6d" + integrity sha512-OfVFJOY+X+T1i+yz3I0L7fRbg8Y9085xUjNqbHKMEMN/A2Mm9ajHon1Ic4vpYwXWAkYI0cDztveRQwHi8exe6A== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-17.1.0-next.1.tgz#a6c5e653dbb0c14db6cdc57c67325ba01f8a4d64" - integrity sha512-ytd2QjbBwVWBrFXh9AFliaezLvJIinT5a6ohpKWtNHINPSeV4YYad64e8ATdIn6+Hj6UX/g300n475REE0Yjaw== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-17.1.0-next.2.tgz#1739fc7ab5fc994ea74998091f950d0c237cdec2" + integrity sha512-LzK02w9AFJfPnWxedCzYLn6IZCchEDHceEClPUM+v6/kgYgSQYXjmGGjpyAWpE+ktSPHBLgHSpI9bLGVgDfqUQ== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-17.1.0-next.1.tgz#122afe18038d85b306737c873ea39dd7cd0dc0ab" - integrity sha512-vEsn9kPPm0FTd4yeeeTo+hB+6aXv/tGIMF8j8xlsmoy0PrfYTx2nvv4Y6TLwu1VusYw+kqQae6VjSpKxBWi+5g== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-17.1.0-next.2.tgz#880beb6c212846d1405ff2d48a9cfb1eb1e2910c" + integrity sha512-KbLNnf7HLKKIszLRWxOOcIAeGA71GDI1g23fj4C0K0yOb52ekdds/Vo+mVTkD2vUiG5UMmOtq/lrGM+aZ7bKhg== dependencies: tslib "^2.3.0" xhr2 "^0.2.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-17.1.0-next.1.tgz#8e32c8109aa6d00983a262f2f281de6a4e627489" - integrity sha512-rOk4pqqOfHoK0F0Kyv+in8SHp2mSFxXcGWRWsF4VX0QOkGMWxuXt70KjGtFK+m+d+W64KI7c85MeVVySp5FbXA== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-17.1.0-next.2.tgz#8bc4869c7b85bd9ee7c67ec209444ee37d4b50df" + integrity sha512-p/QeOCQctmNRqESXS9CybQ/Y6czCIMdiPqF+qpBFGl8YodtlXzELnqEO9Z9UqNLy0B+tq+yNZEfLQYTULL1nxA== dependencies: tslib "^2.3.0" -"@angular/[email protected]": - version "17.1.0-next.1" - resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-17.1.0-next.1.tgz#675d8fcc8c5ee98d32ecb5c96e95f91c3f52fa8b" - integrity sha512-hDPQ5t1jdDqvgNdnm5fd2HtTZFVap10RzLC/EnrOs22eSsE3UrMytP/Oh/dYApqUeeSGjTVyLrHYgP5SOFtrLA== +"@angular/[email protected]": + version "17.1.0-next.2" + resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-17.1.0-next.2.tgz#bdf77d481d79ec1c028a0b548a452e26835c8273" + integrity sha512-QS+tS4S4n37R/L3rIsAt3bh7GY054cEKjcyQZkqHbpYrMAdjoZEhKIHXrpWW3LCrZ2Ijczyn31castod5Rpe4g== dependencies: tslib "^2.3.0" @@ -9013,10 +9013,10 @@ marked-mangle@^1.1.4: resolved "https://registry.yarnpkg.com/marked-mangle/-/marked-mangle-1.1.5.tgz#ff1fc4d774eb8362cdc5088a0adbd794ca2b330a" integrity sha512-xso3Pn39JrRi4SZ38upu2Gzfqphs3AvM3SeCoCdAnFNopjqhos0DYCqeNNrzWsLBFslRsgYwndeCNuWphKYfGA== -marked@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-10.0.0.tgz#7fe1805bb908433d760e2de0fcc8841a2b2d745c" - integrity sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA== +marked@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-11.0.0.tgz#02e63c4352a59a268e2e5b3afb7a46851c0b446d" + integrity sha512-2GsW34uXaFEGTQ/+3rCnNC6vUYTAgFuDLGl70v/aWinA5mIJtTrrFAmfbLOfVvgPyxXuDVL9He/7reCK+6j3Sw== [email protected]: version "0.3.0"
99797cebb2b07fce0e5d19cfd4d1fd31e027ab12
2023-02-16 02:23:49
Charles Lyding
docs: release notes for the v15.2.0-rc.0 release
false
release notes for the v15.2.0-rc.0 release
docs
diff --git a/CHANGELOG.md b/CHANGELOG.md index 54bef24a6bbd..c68fe8ecbfc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +<a name="15.2.0-rc.0"></a> + +# 15.2.0-rc.0 (2023-02-15) + +### @angular/cli + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------- | +| [5f407337f](https://github.com/angular/angular-cli/commit/5f407337f9a355a29654f32346f20e070853332a) | fix | add set `SessionEngaged` in GA | +| [545c180e2](https://github.com/angular/angular-cli/commit/545c180e2ba1f2465fa38f264a7a5c1711306406) | fix | convert `before` option in `.npmrc` to Date | +| [522463c42](https://github.com/angular/angular-cli/commit/522463c42ba873a32e85d47d692951537ab10716) | fix | replace `os.version` with `os.release`. | + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| [421417a36](https://github.com/angular/angular-cli/commit/421417a36b13a44d39e0818171482871ea8b895f) | fix | avoid CommonJS warning for zone.js in esbuild | +| [d3f255087](https://github.com/angular/angular-cli/commit/d3f255087ffaa474d37c45fb2db8611f6b437408) | fix | correctly copy `safety-worker.js` contents | +| [c65b026e2](https://github.com/angular/angular-cli/commit/c65b026e2f375f35826d985c8cc558a2729b520e) | fix | update the ECMA output warning message to be more actionable | +| [8356240dd](https://github.com/angular/angular-cli/commit/8356240dda74f772435e7b0a639b2e928b61a657) | fix | use babel default export helper in build optimizer | +| [1e5286326](https://github.com/angular/angular-cli/commit/1e528632629f2d0eb96580a8d7672758f5c23270) | perf | reduce rebuilt times when using the `scripts` option | + +## Special Thanks + +Alan Agius and Charles Lyding + +<!-- CHANGELOG SPLIT MARKER --> + <a name="15.1.6"></a> # 15.1.6 (2023-02-15)
e9139941ca8804da14db4017470d62ed8e1d3521
2017-03-29 15:32:37
David Mendez
docs(@angular/cli): removes mention of --ng4 on ng new
false
removes mention of --ng4 on ng new
docs
diff --git a/docs/documentation/new.md b/docs/documentation/new.md index 65ad4026bca2..886577ee8fb0 100644 --- a/docs/documentation/new.md +++ b/docs/documentation/new.md @@ -48,16 +48,6 @@ Default applications are created in a directory of the same name, with an initia </p> </details> -<details> - <summary>ng4</summary> - <p> - `--ng4` _default value: false_ - </p> - <p> - Create a project with Angular 4 in the template. - </p> -</details> - <details> <summary>prefix</summary> <p>
a95f16de3c9e0b9a1e694055668c32193a2be487
2016-02-27 17:55:28
Filipe Silva
chore(utilities): remove shell-promise
false
remove shell-promise
chore
diff --git a/addon/ng2/utilities/shell-promise.js b/addon/ng2/utilities/shell-promise.js deleted file mode 100644 index 5b74717cbe55..000000000000 --- a/addon/ng2/utilities/shell-promise.js +++ /dev/null @@ -1,16 +0,0 @@ -/* jshint node: true */ -'use strict'; - -var Promise = require('ember-cli/lib/ext/promise'); -var sh = require('shelljs'); - -module.exports = function shellPromise(command) { - return new Promise(function(resolve, reject) { - return sh.exec(command, { - silent: true - }, function(code, stdout, stderr) { - if (code !== 0) reject(stderr); - else resolve(stdout); - }); - }); -};
cba5f6c1bbf69340434d96fe6ec63846fb06b3f7
2022-05-27 00:07:06
Charles Lyding
fix(@angular-devkit/build-angular): add es2015 exports package condition to browser-esbuild
false
add es2015 exports package condition to browser-esbuild
fix
diff --git a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts index fd0016311c09..b8e2e2c2c6cf 100644 --- a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts +++ b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts @@ -281,7 +281,7 @@ async function bundleCode( assetNames: outputNames.media, target: 'es2020', mainFields: ['es2020', 'browser', 'module', 'main'], - conditions: ['es2020', 'module'], + conditions: ['es2020', 'es2015', 'module'], resolveExtensions: ['.ts', '.tsx', '.mjs', '.js'], logLevel: options.verbose ? 'debug' : 'silent', metafile: true,
6fa9c2f5af45859fb9c0f51ce70686eb4c6ac473
2019-12-06 08:26:05
Renovate Bot
build: update browserslist to version 4.8.2
false
update browserslist to version 4.8.2
build
diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 6cdf646a8e2b..0a643ea2159d 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -18,7 +18,7 @@ "ajv": "6.10.2", "autoprefixer": "9.7.3", "babel-loader": "8.0.6", - "browserslist": "4.8.0", + "browserslist": "4.8.2", "cacache": "13.0.1", "caniuse-lite": "1.0.30001015", "circular-dependency-plugin": "5.2.0", diff --git a/yarn.lock b/yarn.lock index 0f70fd37c060..3e155e6c29b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2524,14 +2524,14 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" [email protected], browserslist@^4.8.0: - version "4.8.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.0.tgz#6f06b0f974a7cc3a84babc2ccc56493668e3c789" - integrity sha512-HYnxc/oLRWvJ3TsGegR0SRL/UDnknGq2s/a8dYYEO+kOQ9m9apKoS5oiathLKZdh/e9uE+/J3j92qPlGD/vTqA== [email protected]: + version "4.8.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.2.tgz#b45720ad5fbc8713b7253c20766f701c9a694289" + integrity sha512-+M4oeaTplPm/f1pXDw84YohEv7B1i/2Aisei8s4s6k3QsoSHa7i5sz8u/cGQkkatCPxMASKxPualR4wwYgVboA== dependencies: - caniuse-lite "^1.0.30001012" - electron-to-chromium "^1.3.317" - node-releases "^1.1.41" + caniuse-lite "^1.0.30001015" + electron-to-chromium "^1.3.322" + node-releases "^1.1.42" browserslist@^4.6.0, browserslist@^4.7.0, browserslist@^4.7.2: version "4.7.2" @@ -2542,6 +2542,15 @@ browserslist@^4.6.0, browserslist@^4.7.0, browserslist@^4.7.2: electron-to-chromium "^1.3.295" node-releases "^1.1.38" +browserslist@^4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.0.tgz#6f06b0f974a7cc3a84babc2ccc56493668e3c789" + integrity sha512-HYnxc/oLRWvJ3TsGegR0SRL/UDnknGq2s/a8dYYEO+kOQ9m9apKoS5oiathLKZdh/e9uE+/J3j92qPlGD/vTqA== + dependencies: + caniuse-lite "^1.0.30001012" + electron-to-chromium "^1.3.317" + node-releases "^1.1.41" + browserstack@^1.5.1: version "1.5.3" resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.5.3.tgz#93ab48799a12ef99dbd074dd595410ddb196a7ac" @@ -2770,7 +2779,7 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== [email protected]: [email protected], caniuse-lite@^1.0.30001015: version "1.0.30001015" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001015.tgz#15a7ddf66aba786a71d99626bc8f2b91c6f0f5f0" integrity sha512-/xL2AbW/XWHNu1gnIrO8UitBGoFthcsDgU9VLK1/dpsoxbaD5LscHozKze05R6WLsBvLhqv78dAPozMFQBYLbQ== @@ -4058,6 +4067,11 @@ electron-to-chromium@^1.3.317: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.321.tgz#913869f5ec85daabba0e75c9c314b4bf26cdb01e" integrity sha512-jJy/BZK2s2eAjMPXVMSaCmo7/pSY2aKkfQ+LoAb5Wk39qAhyP9r8KU74c4qTgr9cD/lPUhJgReZxxqU0n5puog== +electron-to-chromium@^1.3.322: + version "1.3.322" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz#a6f7e1c79025c2b05838e8e344f6e89eb83213a8" + integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== + elliptic@^6.0.0: version "6.5.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.1.tgz#c380f5f909bf1b9b4428d028cd18d3b0efd6b52b" @@ -7510,6 +7524,13 @@ node-releases@^1.1.41: dependencies: semver "^6.3.0" +node-releases@^1.1.42: + version "1.1.42" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.42.tgz#a999f6a62f8746981f6da90627a8d2fc090bbad7" + integrity sha512-OQ/ESmUqGawI2PRX+XIRao44qWYBBfN54ImQYdWVTQqUckuejOg76ysSqDBK8NG3zwySRVnX36JwDQ6x+9GxzA== + dependencies: + semver "^6.3.0" + node-sass-tilde-importer@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/node-sass-tilde-importer/-/node-sass-tilde-importer-1.0.2.tgz#1a15105c153f648323b4347693fdb0f331bad1ce"
d69351dbfcd92a737ee491ec279af7bc4f6110c0
2020-05-31 13:43:15
Renovate Bot
build: update karma to version 5.0.9
false
update karma to version 5.0.9
build
diff --git a/integration/express-engine-ivy-prerender/package.json b/integration/express-engine-ivy-prerender/package.json index ba76a9fb8e9b..1124d591fae9 100644 --- a/integration/express-engine-ivy-prerender/package.json +++ b/integration/express-engine-ivy-prerender/package.json @@ -48,7 +48,7 @@ "concurrently": "5.2.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.2", - "karma": "5.0.5", + "karma": "5.0.9", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "3.3.1", diff --git a/integration/express-engine-ivy/package.json b/integration/express-engine-ivy/package.json index 9bdfe2853115..71d0227934f0 100644 --- a/integration/express-engine-ivy/package.json +++ b/integration/express-engine-ivy/package.json @@ -46,7 +46,7 @@ "concurrently": "5.2.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.2", - "karma": "5.0.5", + "karma": "5.0.9", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "3.3.1", diff --git a/integration/express-engine-ve/package.json b/integration/express-engine-ve/package.json index 52f24df5d8d2..945e2b89f6d3 100644 --- a/integration/express-engine-ve/package.json +++ b/integration/express-engine-ve/package.json @@ -46,7 +46,7 @@ "concurrently": "5.2.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.2", - "karma": "5.0.5", + "karma": "5.0.9", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "3.3.1", diff --git a/integration/hapi-engine-ivy/package.json b/integration/hapi-engine-ivy/package.json index 55df1a84ec4f..8543c1873962 100644 --- a/integration/hapi-engine-ivy/package.json +++ b/integration/hapi-engine-ivy/package.json @@ -48,7 +48,7 @@ "concurrently": "5.2.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.2", - "karma": "5.0.5", + "karma": "5.0.9", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "3.3.1", diff --git a/integration/hapi-engine-ve/package.json b/integration/hapi-engine-ve/package.json index af48fd95cb97..d55112da20b9 100644 --- a/integration/hapi-engine-ve/package.json +++ b/integration/hapi-engine-ve/package.json @@ -48,7 +48,7 @@ "concurrently": "5.2.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.2", - "karma": "5.0.5", + "karma": "5.0.9", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-jasmine": "3.3.1",
4ad406ff56cbe25c10a60b2cb5375d1fcda7dafc
2017-02-03 16:01:03
Michał Gołębiowski
fix(readme): point npm badges to @angular/cli instead of angular-cli (#4395)
false
point npm badges to @angular/cli instead of angular-cli (#4395)
fix
diff --git a/README.md b/README.md index c21792b3a2f1..b8feacf4ec67 100644 --- a/README.md +++ b/README.md @@ -467,5 +467,5 @@ MIT [david-badge-url]: https://david-dm.org/angular/angular-cli [david-dev-badge]: https://david-dm.org/angular/angular-cli/dev-status.svg [david-dev-badge-url]: https://david-dm.org/angular/angular-cli?type=dev -[npm-badge]: https://img.shields.io/npm/v/angular-cli.svg -[npm-badge-url]: https://www.npmjs.com/package/angular-cli +[npm-badge]: https://img.shields.io/npm/v/@angular/cli.svg +[npm-badge-url]: https://www.npmjs.com/package/@angular/cli
545db0651f595c4a337fc3cb8db1b5c26cdc4676
2018-08-24 00:14:02
Yi Qi
fix(@angular/cli): fix typing issue in google3
false
fix typing issue in google3
fix
diff --git a/packages/angular/cli/custom-typings.d.ts b/packages/angular/cli/custom-typings.d.ts index 5c5489009bd3..b33ea8011637 100644 --- a/packages/angular/cli/custom-typings.d.ts +++ b/packages/angular/cli/custom-typings.d.ts @@ -14,10 +14,11 @@ declare module 'yargs-parser' { } declare module 'json-schema-traverse' { - export interface TraverseOptions { + import { JsonObject } from '@angular-devkit/core'; + interface TraverseOptions { allKeys?: boolean; } - export type TraverseCallback = ( + type TraverseCallback = ( schema: JsonObject, jsonPointer: string, rootSchema: string, @@ -26,7 +27,7 @@ declare module 'json-schema-traverse' { parentSchema: string, property: string) => void; - export interface TraverseCallbacks { + interface TraverseCallbacks { pre?: TraverseCallback; post?: TraverseCallback; }
6c5e60efbacc5655f110023a031dea67f7ad5406
2017-11-01 22:32:30
Mike Brocchi
fix(@angular/cli): Show detailed help for ng new --help
false
Show detailed help for ng new --help
fix
diff --git a/packages/@angular/cli/commands/help.ts b/packages/@angular/cli/commands/help.ts index b5f4946ebbfb..3d4d55016b1b 100644 --- a/packages/@angular/cli/commands/help.ts +++ b/packages/@angular/cli/commands/help.ts @@ -67,7 +67,9 @@ const HelpCommand = Command.extend({ if (commandOptions.short) { this.ui.writeLine(command.printShortHelp(commandOptions)); } else if (command.printDetailedHelp(commandOptions, rawArgs)) { + this.ui.writeLine('cool'); const result = command.printDetailedHelp(commandOptions, rawArgs); + this.ui.writeLine('not cool', result); if (result instanceof Promise) { result.then(r => this.ui.writeLine(r)); } else { diff --git a/packages/@angular/cli/commands/new.ts b/packages/@angular/cli/commands/new.ts index 233741f8ef3d..997a3ff25e6c 100644 --- a/packages/@angular/cli/commands/new.ts +++ b/packages/@angular/cli/commands/new.ts @@ -3,9 +3,13 @@ import * as path from 'path'; import chalk from 'chalk'; import { CliConfig } from '../models/config'; +import { getCollection, getEngineHost } from '../utilities/schematics'; import { validateProjectName } from '../utilities/validate-project-name'; import { oneLine } from 'common-tags'; import { SchematicAvailableOptions } from '../tasks/schematic-get-options'; +import { outputFile } from 'fs-extra'; + +const { cyan, yellow } = chalk; const Command = require('../ember-cli/lib/models/command'); const SilentError = require('silent-error'); @@ -153,6 +157,28 @@ const NewCommand = Command.extend({ commandOptions.skipGit = commandOptions.skipGit === undefined ? false : commandOptions.skipGit; return initTask.run(commandOptions, rawArgs); + }, + + printDetailedHelp: function (): string | Promise<string> { + const collectionName = this.getCollectionName(); + const schematicName = CliConfig.getValue('defaults.schematics.newApp'); + const SchematicGetHelpOutputTask = require('../tasks/schematic-get-help-output').default; + const getHelpOutputTask = new SchematicGetHelpOutputTask({ + ui: this.ui, + project: this.project + }); + return getHelpOutputTask.run({ + schematicName, + collectionName, + nonSchematicOptions: this.availableOptions.filter((o: any) => !o.hidden) + }) + .then((output: string[]) => { + const outputLines = [ + cyan(`ng new ${cyan('[name]')} ${cyan('<options...>')}`), + ...output + ]; + return outputLines.join('\n'); + }); } }); diff --git a/packages/@angular/cli/tasks/schematic-get-help-output.ts b/packages/@angular/cli/tasks/schematic-get-help-output.ts index b59db4900f66..8949da772f5b 100644 --- a/packages/@angular/cli/tasks/schematic-get-help-output.ts +++ b/packages/@angular/cli/tasks/schematic-get-help-output.ts @@ -6,6 +6,7 @@ const { cyan, grey } = chalk; export interface SchematicGetHelpOptions { collectionName: string; schematicName: string; + nonSchematicOptions: any[]; } export interface SchematicAvailableOptions { @@ -18,21 +19,21 @@ export interface SchematicAvailableOptions { } export default Task.extend({ - run: function ({schematicName, collectionName}: SchematicGetHelpOptions): - Promise<SchematicAvailableOptions[]> { + run: function ({schematicName, collectionName, nonSchematicOptions}: SchematicGetHelpOptions): + Promise<string[]> { const SchematicGetOptionsTask = require('./schematic-get-options').default; const getOptionsTask = new SchematicGetOptionsTask({ ui: this.ui, project: this.project }); - return getOptionsTask.run({ + return Promise.all([getOptionsTask.run({ schematicName: schematicName, collectionName: collectionName, - }) - .then((availableOptions: SchematicAvailableOptions[]) => { + }), nonSchematicOptions]) + .then(([availableOptions, nonSchematicOptions]: [SchematicAvailableOptions[], any[]]) => { const output: string[] = []; - availableOptions + [...(nonSchematicOptions || []), ...availableOptions] .filter(opt => opt.name !== 'name') .forEach(opt => { let text = cyan(` --${opt.name}`); @@ -48,7 +49,7 @@ export default Task.extend({ output.push(text); if (opt.aliases && opt.aliases.length > 0) { const aliasText = opt.aliases.reduce( - (acc, curr) => { + (acc: string, curr: string) => { return acc + ` -${curr}`; }, '');
7a41e8f79290fbc67d99ab85fadc4d3b437f2bf8
2023-10-31 16:20:03
Kristiyan Kostadinov
fix(@ngtools/webpack): remove setClassDebugInfo calls
false
remove setClassDebugInfo calls
fix
diff --git a/goldens/public-api/ngtools/webpack/index.md b/goldens/public-api/ngtools/webpack/index.md index d50f6a068dc1..13ddc85cabd8 100644 --- a/goldens/public-api/ngtools/webpack/index.md +++ b/goldens/public-api/ngtools/webpack/index.md @@ -35,6 +35,8 @@ export interface AngularWebpackPluginOptions { // (undocumented) emitNgModuleScope: boolean; // (undocumented) + emitSetClassDebugInfo?: boolean; + // (undocumented) fileReplacements: Record<string, string>; // (undocumented) inlineStyleFileExtension?: string; diff --git a/packages/ngtools/webpack/src/ivy/plugin.ts b/packages/ngtools/webpack/src/ivy/plugin.ts index 8fc2efb6182c..7ea56ba58cb9 100644 --- a/packages/ngtools/webpack/src/ivy/plugin.ts +++ b/packages/ngtools/webpack/src/ivy/plugin.ts @@ -49,6 +49,7 @@ export interface AngularWebpackPluginOptions { directTemplateLoading: boolean; emitClassMetadata: boolean; emitNgModuleScope: boolean; + emitSetClassDebugInfo?: boolean; jitMode: boolean; inlineStyleFileExtension?: string; } diff --git a/packages/ngtools/webpack/src/ivy/transformation.ts b/packages/ngtools/webpack/src/ivy/transformation.ts index 7308a097a122..b30adfe13604 100644 --- a/packages/ngtools/webpack/src/ivy/transformation.ts +++ b/packages/ngtools/webpack/src/ivy/transformation.ts @@ -14,7 +14,11 @@ import { replaceResources } from '../transformers/replace_resources'; export function createAotTransformers( builder: ts.BuilderProgram, - options: { emitClassMetadata?: boolean; emitNgModuleScope?: boolean }, + options: { + emitClassMetadata?: boolean; + emitNgModuleScope?: boolean; + emitSetClassDebugInfo?: boolean; + }, imageDomains: Set<string>, ): ts.CustomTransformers { const getTypeChecker = () => builder.getProgram().getTypeChecker(); @@ -25,10 +29,16 @@ export function createAotTransformers( const removeClassMetadata = !options.emitClassMetadata; const removeNgModuleScope = !options.emitNgModuleScope; - if (removeClassMetadata || removeNgModuleScope) { + const removeSetClassDebugInfo = !options.emitSetClassDebugInfo; + if (removeClassMetadata || removeNgModuleScope || removeSetClassDebugInfo) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion transformers.before!.push( - removeIvyJitSupportCalls(removeClassMetadata, removeNgModuleScope, getTypeChecker), + removeIvyJitSupportCalls( + removeClassMetadata, + removeNgModuleScope, + removeSetClassDebugInfo, + getTypeChecker, + ), ); } diff --git a/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls.ts b/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls.ts index 0d7e715519bd..55b239dff0c6 100644 --- a/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls.ts +++ b/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls.ts @@ -12,6 +12,7 @@ import { elideImports } from './elide_imports'; export function removeIvyJitSupportCalls( classMetadata: boolean, ngModuleScope: boolean, + debugInfo: boolean, getTypeChecker: () => ts.TypeChecker, ): ts.TransformerFactory<ts.SourceFile> { return (context: ts.TransformationContext) => { @@ -43,6 +44,16 @@ export function removeIvyJitSupportCalls( return undefined; } } + + if ( + debugInfo && + ts.isBinaryExpression(innerExpression) && + isIvyPrivateCallExpression(innerExpression.right, 'ɵsetClassDebugInfo') + ) { + removedNodes.push(innerExpression); + + return undefined; + } } return ts.visitEachChild(node, visitNode, context); diff --git a/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls_spec.ts b/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls_spec.ts index 436a6e673c37..0f14d99a8ec1 100644 --- a/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls_spec.ts +++ b/packages/ngtools/webpack/src/transformers/remove-ivy-jit-support-calls_spec.ts @@ -177,6 +177,16 @@ const inputAsyncArrowFn = tags.stripIndent` }); })(); `; +const inputDebugInfo = tags.stripIndent` + import { Component } from '@angular/core'; + import * as i0 from "@angular/core"; + export class TestCmp { + } + TestCmp.ɵfac = function TestCmp_Factory(t) { return new (t || TestCmp)(); }; + TestCmp.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TestCmp, selectors: [["test-cmp"]], decls: 0, vars: 0, template: function TestCmp_Template(rf, ctx) { }, encapsulation: 2 }); + (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TestCmp, { className: "TestCmp" }); })(); +`; + describe('@ngtools/webpack transformers', () => { describe('remove-ivy-dev-calls', () => { it('should allow removing only set class metadata with pure annotation', () => { @@ -194,7 +204,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(input, (getTypeChecker) => - removeIvyJitSupportCalls(true, false, getTypeChecker), + removeIvyJitSupportCalls(true, false, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -215,7 +225,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputNoPure, (getTypeChecker) => - removeIvyJitSupportCalls(true, false, getTypeChecker), + removeIvyJitSupportCalls(true, false, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -248,7 +258,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(input, (getTypeChecker) => - removeIvyJitSupportCalls(false, true, getTypeChecker), + removeIvyJitSupportCalls(false, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -281,7 +291,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputNoPure, (getTypeChecker) => - removeIvyJitSupportCalls(false, true, getTypeChecker), + removeIvyJitSupportCalls(false, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -299,7 +309,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(input, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -317,7 +327,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputNoPure, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -325,7 +335,7 @@ describe('@ngtools/webpack transformers', () => { it('should allow removing neither set class metadata nor ng module scope with pure annotation', () => { const result = transform(input, (getTypeChecker) => - removeIvyJitSupportCalls(false, false, getTypeChecker), + removeIvyJitSupportCalls(false, false, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${input}`); @@ -333,7 +343,7 @@ describe('@ngtools/webpack transformers', () => { it('should allow removing neither set class metadata nor ng module scope', () => { const result = transform(inputNoPure, (getTypeChecker) => - removeIvyJitSupportCalls(false, false, getTypeChecker), + removeIvyJitSupportCalls(false, false, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${inputNoPure}`); @@ -364,7 +374,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(imports + input, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -395,7 +405,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(imports + inputNoPure, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -413,7 +423,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputArrowFnWithBody, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -431,7 +441,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputArrowFnWithImplicitReturn, (getTypeChecker) => - removeIvyJitSupportCalls(true, true, getTypeChecker), + removeIvyJitSupportCalls(true, true, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -446,7 +456,7 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputAsync, (getTypeChecker) => - removeIvyJitSupportCalls(true, false, getTypeChecker), + removeIvyJitSupportCalls(true, false, false, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); @@ -461,7 +471,22 @@ describe('@ngtools/webpack transformers', () => { `; const result = transform(inputAsyncArrowFn, (getTypeChecker) => - removeIvyJitSupportCalls(true, false, getTypeChecker), + removeIvyJitSupportCalls(true, false, false, getTypeChecker), + ); + + expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`); + }); + + it('should remove setClassDebugInfo calls', () => { + const output = tags.stripIndent` + import * as i0 from "@angular/core"; + export class TestCmp { } + TestCmp.ɵfac = function TestCmp_Factory(t) { return new (t || TestCmp)(); }; + TestCmp.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TestCmp, selectors: [["test-cmp"]], decls: 0, vars: 0, template: function TestCmp_Template(rf, ctx) { }, encapsulation: 2 }); + `; + + const result = transform(inputDebugInfo, (getTypeChecker) => + removeIvyJitSupportCalls(true, false, true, getTypeChecker), ); expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`);
6e8a848074baacd1c28e9cba0b14669243f80b1d
2016-11-23 06:39:23
Hans
fix(aot): lock the angular version to 2.2.1. (#3242)
false
lock the angular version to 2.2.1. (#3242)
fix
diff --git a/package.json b/package.json index 82fbace4747a..6651119baa71 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,10 @@ "homepage": "https://github.com/angular/angular-cli", "dependencies": { "@angular-cli/ast-tools": "^1.0.0", - "@angular/compiler": "^2.1.0", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", - "@angular/tsc-wrapped": "^0.3.0", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", + "@angular/tsc-wrapped": "0.4.0", "angular2-template-loader": "^0.5.0", "autoprefixer": "^6.5.3", "awesome-typescript-loader": "^2.2.3", diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json index c32501f8c134..464ed3361e0a 100644 --- a/packages/angular-cli/blueprints/ng2/files/package.json +++ b/packages/angular-cli/blueprints/ng2/files/package.json @@ -12,28 +12,28 @@ }, "private": true, "dependencies": { - "@angular/common": "^2.1.0", - "@angular/compiler": "^2.1.0", - "@angular/core": "^2.1.0", - "@angular/forms": "^2.1.0", - "@angular/http": "^2.1.0", - "@angular/platform-browser": "^2.1.0", - "@angular/platform-browser-dynamic": "^2.1.0", - "@angular/router": "^3.1.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/core": "2.2.1", + "@angular/forms": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/router": "3.2.1", "core-js": "^2.4.1", "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", "zone.js": "^0.6.23" }, "devDependencies": {<% if(isMobile) { %> - "@angular/platform-server": "~2.1.0", + "@angular/platform-server": "2.2.1", "@angular/service-worker": "0.2.0", "@angular/app-shell": "0.0.0", "angular2-universal":"0.104.5", "angular2-universal-polyfills": "0.4.1", "preboot": "2.1.2", "parse5": "1.5.1",<% } %> - "@angular/compiler-cli": "^2.1.0", + "@angular/compiler-cli": "2.2.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "<%= version %>", diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index abf9d7a0ceeb..07f7e22f18a7 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -27,9 +27,9 @@ "dependencies": { "@angular-cli/ast-tools": "^1.0.1", "@angular-cli/base-href-webpack": "^1.0.0", - "@angular/compiler": "^2.1.0", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", "@ngtools/webpack": "^1.0.0", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index 8f5b6be28264..03915982790d 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -29,8 +29,8 @@ }, "peerDependencies": { "typescript": "^2.0.2", - "@angular/compiler-cli": "^2.1.0", - "@angular/core": "^2.1.0", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", "reflect-metadata": "^0.1.8" } } diff --git a/tests/e2e/assets/webpack/test-app/package.json b/tests/e2e/assets/webpack/test-app/package.json index 3c53508c260d..3820b8170840 100644 --- a/tests/e2e/assets/webpack/test-app/package.json +++ b/tests/e2e/assets/webpack/test-app/package.json @@ -2,15 +2,15 @@ "name": "test", "license": "MIT", "dependencies": { - "@angular/common": "~2.1.0", - "@angular/compiler": "~2.1.0", - "@angular/compiler-cli": "~2.1.0", - "@angular/core": "~2.1.0", - "@angular/http": "~2.1.0", - "@angular/platform-browser": "~2.1.0", - "@angular/platform-browser-dynamic": "~2.1.0", - "@angular/platform-server": "~2.1.0", - "@angular/router": "~3.1.0", + "@angular/common": "2.2.1", + "@angular/compiler": "2.2.1", + "@angular/compiler-cli": "2.2.1", + "@angular/core": "2.2.1", + "@angular/http": "2.2.1", + "@angular/platform-browser": "2.2.1", + "@angular/platform-browser-dynamic": "2.2.1", + "@angular/platform-server": "2.2.1", + "@angular/router": "3.2.1", "core-js": "^2.4.1", "rxjs": "^5.0.0-beta.12", "zone.js": "^0.6.21"
9674ebf2ec167c5dbd43c03578140f30941d3c5d
2019-10-08 02:14:19
Alan Agius
fix(common): update server main option when using `ng add/ng update`
false
update server main option when using `ng add/ng update`
fix
diff --git a/modules/common/schematics/add/index.spec.ts b/modules/common/schematics/add/index.spec.ts index 792b522a3918..cc8d91c2ed57 100644 --- a/modules/common/schematics/add/index.spec.ts +++ b/modules/common/schematics/add/index.spec.ts @@ -34,6 +34,7 @@ describe('Add Schematic Rule', () => { expect(architect.build.configurations.production).toBeDefined(); expect(architect.build.options.outputPath).toBe('dist/test-app/browser'); expect(architect.server.options.outputPath).toBe('dist/test-app/server'); + expect(architect.server.options.main).toBe('projects/test-app/server.ts'); const productionConfig = architect.server.configurations.production; expect(productionConfig.fileReplacements).toBeDefined(); diff --git a/modules/common/schematics/add/index.ts b/modules/common/schematics/add/index.ts index a036bae489b3..971541e840f4 100644 --- a/modules/common/schematics/add/index.ts +++ b/modules/common/schematics/add/index.ts @@ -12,13 +12,14 @@ import { SchematicsException, noop, } from '@angular-devkit/schematics'; -import {parseJsonAst, JsonParseMode} from '@angular-devkit/core'; +import {parseJsonAst, JsonParseMode, normalize, join} from '@angular-devkit/core'; import { findPropertyInAstObject, appendValueInAstArray, } from '@schematics/angular/utility/json-utils'; import {Schema as UniversalOptions} from '@schematics/angular/universal/schema'; import {stripTsExtension, getOutputPath, getProject} from '../utils'; +import {updateWorkspace} from '@schematics/angular/utility/workspace'; export interface AddUniversalOptions extends UniversalOptions { serverFileName?: string; @@ -34,6 +35,7 @@ export function addUniversalCommonRule(options: AddUniversalOptions): Rule { : externalSchematic('@schematics/angular', 'universal', options), addScriptsRule(options), updateServerTsConfigRule(options), + updateWorkspaceConfigRule(options), ]); }; } @@ -58,6 +60,23 @@ function addScriptsRule(options: AddUniversalOptions): Rule { }; } +function updateWorkspaceConfigRule(options: AddUniversalOptions): Rule { + return () => { + return updateWorkspace(workspace => { + const project = workspace.projects.get(options.clientProject); + if (!project) { + return; + } + + const serverTarget = project.targets.get('server'); + serverTarget.options.main = join( + normalize(project.root), + stripTsExtension(options.serverFileName) + '.ts', + ); + }); + }; +} + function updateServerTsConfigRule(options: AddUniversalOptions): Rule { return async host => { const clientProject = await getProject(host, options.clientProject); @@ -102,17 +121,3 @@ function updateServerTsConfigRule(options: AddUniversalOptions): Rule { } }; } - -export default function (options: UniversalOptions): Rule { - return async host => { - const clientProject = await getProject(host, options.clientProject); - - return chain([ - clientProject.targets.has('server') - ? noop() - : externalSchematic('@schematics/angular', 'universal', options), - addScriptsRule(options), - updateServerTsConfigRule(options), - ]); - }; -}
cf47948dcc601be7522eab6483ced4a4ed4e2ee8
2019-10-23 02:53:06
vikerman
release: v9.0.0-next.14
false
v9.0.0-next.14
release
diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 9b09e70c9e1d..3d285e7bc47a 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -15,9 +15,9 @@ export const latestVersions = { TsLib: '^1.10.0', // The versions below must be manually updated when making a new devkit release. - DevkitBuildAngular: '~0.900.0-next.13', - DevkitBuildNgPackagr: '~0.900.0-next.13', - DevkitBuildWebpack: '~0.900.0-next.13', + DevkitBuildAngular: '~0.900.0-next.14', + DevkitBuildNgPackagr: '~0.900.0-next.14', + DevkitBuildWebpack: '~0.900.0-next.14', ngPackagr: '^9.0.0-rc.0', };
4f62105164e097cfa793c13ea68ca6769d407a88
2019-11-27 02:40:54
Renovate Bot
build: update @babel/core to version 7.7.4
false
update @babel/core to version 7.7.4
build
diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 409eb20825b6..a6ba6a7c6166 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -11,9 +11,9 @@ "@angular-devkit/build-optimizer": "0.0.0", "@angular-devkit/build-webpack": "0.0.0", "@angular-devkit/core": "0.0.0", - "@babel/core": "7.7.2", - "@babel/generator": "7.7.2", - "@babel/preset-env": "7.7.1", + "@babel/core": "7.7.4", + "@babel/generator": "7.7.4", + "@babel/preset-env": "7.7.4", "@ngtools/webpack": "0.0.0", "ajv": "6.10.2", "autoprefixer": "9.7.2", diff --git a/yarn.lock b/yarn.lock index 424365274ad4..216854695d92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -103,7 +103,27 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/[email protected]", "@babel/core@^7.5.5": +"@babel/[email protected]": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.4.tgz#37e864532200cb6b50ee9a4045f5f817840166ab" + integrity sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.4" + "@babel/helpers" "^7.7.4" + "@babel/parser" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + convert-source-map "^1.7.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/core@^7.5.5": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== @@ -123,7 +143,17 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/[email protected]", "@babel/generator@^7.4.0", "@babel/generator@^7.7.2": +"@babel/[email protected]", "@babel/generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369" + integrity sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg== + dependencies: + "@babel/types" "^7.7.4" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + +"@babel/generator@^7.4.0", "@babel/generator@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== @@ -133,54 +163,54 @@ lodash "^4.17.13" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.0.0", "@babel/helper-annotate-as-pure@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz#efc54032d43891fe267679e63f6860aa7dbf4a5e" - integrity sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg== +"@babel/helper-annotate-as-pure@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz#bb3faf1e74b74bd547e867e48f551fa6b098b6ce" + integrity sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.0.tgz#32dd9551d6ed3a5fc2edc50d6912852aa18274d9" - integrity sha512-Cd8r8zs4RKDwMG/92lpZcnn5WPQ3LAMQbCw42oqUh4s7vsSN5ANUZjMel0OOnxDLq57hoDDbai+ryygYfCTOsw== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.4.tgz#5f73f2b28580e224b5b9bd03146a4015d6217f5f" + integrity sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ== dependencies: - "@babel/helper-explode-assignable-expression" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-explode-assignable-expression" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-call-delegate@^7.4.4": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.7.0.tgz#df8942452c2c1a217335ca7e393b9afc67f668dc" - integrity sha512-Su0Mdq7uSSWGZayGMMQ+z6lnL00mMCnGAbO/R0ZO9odIdB/WNU/VfQKqMQU0fdIsxQYbRjDM4BixIa93SQIpvw== +"@babel/helper-call-delegate@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.7.4.tgz#621b83e596722b50c0066f9dc37d3232e461b801" + integrity sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA== dependencies: - "@babel/helper-hoist-variables" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-hoist-variables" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-create-regexp-features-plugin@^7.7.0": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.2.tgz#6f20443778c8fce2af2ff4206284afc0ced65db6" - integrity sha512-pAil/ZixjTlrzNpjx+l/C/wJk002Wo7XbbZ8oujH/AoJ3Juv0iN/UTcPUHXKMFLqsfS0Hy6Aow8M31brUYBlQQ== +"@babel/helper-create-regexp-features-plugin@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59" + integrity sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A== dependencies: "@babel/helper-regex" "^7.4.4" regexpu-core "^4.6.0" -"@babel/helper-define-map@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz#60b0e9fd60def9de5054c38afde8c8ee409c7529" - integrity sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA== +"@babel/helper-define-map@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz#2841bf92eb8bd9c906851546fe6b9d45e162f176" + integrity sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg== dependencies: - "@babel/helper-function-name" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-function-name" "^7.7.4" + "@babel/types" "^7.7.4" lodash "^4.17.13" -"@babel/helper-explode-assignable-expression@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.0.tgz#db2a6705555ae1f9f33b4b8212a546bc7f9dc3ef" - integrity sha512-CDs26w2shdD1urNUAji2RJXyBFCaR+iBEGnFz3l7maizMkQe3saVw9WtjG1tz8CwbjvlFnaSLVhgnu1SWaherg== +"@babel/helper-explode-assignable-expression@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.4.tgz#fa700878e008d85dc51ba43e9fb835cddfe05c84" + integrity sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg== dependencies: - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" "@babel/helper-function-name@^7.7.0": version "7.7.0" @@ -191,52 +221,68 @@ "@babel/template" "^7.7.0" "@babel/types" "^7.7.0" -"@babel/helper-get-function-arity@^7.0.0", "@babel/helper-get-function-arity@^7.7.0": +"@babel/helper-function-name@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e" + integrity sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ== + dependencies: + "@babel/helper-get-function-arity" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-get-function-arity@^7.7.0": version "7.7.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz#c604886bc97287a1d1398092bc666bc3d7d7aa2d" integrity sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw== dependencies: "@babel/types" "^7.7.0" -"@babel/helper-hoist-variables@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz#b4552e4cfe5577d7de7b183e193e84e4ec538c81" - integrity sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ== +"@babel/helper-get-function-arity@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" + integrity sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-member-expression-to-functions@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz#472b93003a57071f95a541ea6c2b098398bcad8a" - integrity sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA== +"@babel/helper-hoist-variables@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz#612384e3d823fdfaaf9fce31550fe5d4db0f3d12" + integrity sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-module-imports@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz#99c095889466e5f7b6d66d98dffc58baaf42654d" - integrity sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw== +"@babel/helper-member-expression-to-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz#356438e2569df7321a8326644d4b790d2122cb74" + integrity sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz#154a69f0c5b8fd4d39e49750ff7ac4faa3f36786" - integrity sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ== +"@babel/helper-module-imports@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz#e5a92529f8888bf319a6376abfbd1cebc491ad91" + integrity sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ== dependencies: - "@babel/helper-module-imports" "^7.7.0" - "@babel/helper-simple-access" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" + +"@babel/helper-module-transforms@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.4.tgz#8d7cdb1e1f8ea3d8c38b067345924ac4f8e0879a" + integrity sha512-ehGBu4mXrhs0FxAqN8tWkzF8GSIGAiEumu4ONZ/hD9M88uHcD+Yu2ttKfOCgwzoesJOJrtQh7trI5YPbRtMmnA== + dependencies: + "@babel/helper-module-imports" "^7.7.4" + "@babel/helper-simple-access" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" lodash "^4.17.13" -"@babel/helper-optimise-call-expression@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz#4f66a216116a66164135dc618c5d8b7a959f9365" - integrity sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg== +"@babel/helper-optimise-call-expression@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz#034af31370d2995242aa4df402c3b7794b2dcdf2" + integrity sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" @@ -250,34 +296,34 @@ dependencies: lodash "^4.17.13" -"@babel/helper-remap-async-to-generator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz#4d69ec653e8bff5bce62f5d33fc1508f223c75a7" - integrity sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw== +"@babel/helper-remap-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz#c68c2407350d9af0e061ed6726afb4fff16d0234" + integrity sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw== dependencies: - "@babel/helper-annotate-as-pure" "^7.7.0" - "@babel/helper-wrap-function" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-wrap-function" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-replace-supers@^7.5.5", "@babel/helper-replace-supers@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz#d5365c8667fe7cbd13b8ddddceb9bd7f2b387512" - integrity sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg== +"@babel/helper-replace-supers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" + integrity sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg== dependencies: - "@babel/helper-member-expression-to-functions" "^7.7.0" - "@babel/helper-optimise-call-expression" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-simple-access@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz#97a8b6c52105d76031b86237dc1852b44837243d" - integrity sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g== +"@babel/helper-simple-access@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" + integrity sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A== dependencies: - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" "@babel/helper-split-export-declaration@^7.7.0": version "7.7.0" @@ -286,15 +332,22 @@ dependencies: "@babel/types" "^7.7.0" -"@babel/helper-wrap-function@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz#15af3d3e98f8417a60554acbb6c14e75e0b33b74" - integrity sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w== +"@babel/helper-split-export-declaration@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" + integrity sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== dependencies: - "@babel/helper-function-name" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" + +"@babel/helper-wrap-function@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" + integrity sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg== + dependencies: + "@babel/helper-function-name" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" "@babel/helpers@^7.7.0": version "7.7.0" @@ -305,6 +358,15 @@ "@babel/traverse" "^7.7.0" "@babel/types" "^7.7.0" +"@babel/helpers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" + integrity sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg== + dependencies: + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + "@babel/highlight@^7.0.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" @@ -319,392 +381,397 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.3.tgz#5fad457c2529de476a248f75b0f090b3060af043" integrity sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A== -"@babel/plugin-proposal-async-generator-functions@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.0.tgz#83ef2d6044496b4c15d8b4904e2219e6dccc6971" - integrity sha512-ot/EZVvf3mXtZq0Pd0+tSOfGWMizqmOohXmNZg6LNFjHOV+wOPv7BvVYh8oPR8LhpIP3ye8nNooKL50YRWxpYA== +"@babel/parser@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.4.tgz#75ab2d7110c2cf2fa949959afb05fa346d2231bb" + integrity sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g== + +"@babel/plugin-proposal-async-generator-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" + integrity sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.7.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" + "@babel/plugin-syntax-async-generators" "^7.7.4" -"@babel/plugin-proposal-dynamic-import@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz#dc02a8bad8d653fb59daf085516fa416edd2aa7f" - integrity sha512-7poL3Xi+QFPC7sGAzEIbXUyYzGJwbc2+gSD0AkiC5k52kH2cqHdqxm5hNFfLW3cRSTcx9bN0Fl7/6zWcLLnKAQ== +"@babel/plugin-proposal-dynamic-import@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.4.tgz#dde64a7f127691758cbfed6cf70de0fa5879d52d" + integrity sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-syntax-dynamic-import" "^7.7.4" -"@babel/plugin-proposal-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== +"@babel/plugin-proposal-json-strings@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.7.4.tgz#7700a6bfda771d8dc81973249eac416c6b4c697d" + integrity sha512-wQvt3akcBTfLU/wYoqm/ws7YOAQKu8EVJEvHip/mzkNtjaclQoCCIqKXFP5/eyfnfbQCDV3OLRIK3mIVyXuZlw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/plugin-syntax-json-strings" "^7.7.4" -"@babel/plugin-proposal-object-rest-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz#8ffccc8f3a6545e9f78988b6bf4fe881b88e8096" - integrity sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw== +"@babel/plugin-proposal-object-rest-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" + integrity sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.7.4" -"@babel/plugin-proposal-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== +"@babel/plugin-proposal-optional-catch-binding@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz#ec21e8aeb09ec6711bc0a39ca49520abee1de379" + integrity sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.7.4" -"@babel/plugin-proposal-unicode-property-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.0.tgz#549fe1717a1bd0a2a7e63163841cb37e78179d5d" - integrity sha512-mk34H+hp7kRBWJOOAR0ZMGCydgKMD4iN9TpDRp3IIcbunltxEY89XSimc6WbtSLCDrwcdy/EEw7h5CFCzxTchw== +"@babel/plugin-proposal-unicode-property-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.4.tgz#7c239ccaf09470dbe1d453d50057460e84517ebb" + integrity sha512-cHgqHgYvffluZk85dJ02vloErm3Y6xtH+2noOBOJ2kXOJH3aVCDnj5eR/lVNlTnYu4hndAPJD3rTFjW3qee0PA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-async-generators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== +"@babel/plugin-syntax-async-generators@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz#331aaf310a10c80c44a66b238b6e49132bd3c889" + integrity sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-dynamic-import@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== +"@babel/plugin-syntax-dynamic-import@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz#29ca3b4415abfe4a5ec381e903862ad1a54c3aec" + integrity sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== +"@babel/plugin-syntax-json-strings@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.7.4.tgz#86e63f7d2e22f9e27129ac4e83ea989a382e86cc" + integrity sha512-QpGupahTQW1mHRXddMG5srgpHWqRLwJnJZKXTigB9RPFCCGbDGCgBeM/iC82ICXp414WeYx/tD54w7M2qRqTMg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== +"@babel/plugin-syntax-object-rest-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz#47cf220d19d6d0d7b154304701f468fc1cc6ff46" + integrity sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== +"@babel/plugin-syntax-optional-catch-binding@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz#a3e38f59f4b6233867b4a92dcb0ee05b2c334aa6" + integrity sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-top-level-await@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.0.tgz#f5699549f50bbe8d12b1843a4e82f0a37bb65f4d" - integrity sha512-hi8FUNiFIY1fnUI2n1ViB1DR0R4QeK4iHcTlW6aJkrPoTdb8Rf1EMQ6GT3f67DDkYyWgew9DFoOZ6gOoEsdzTA== +"@babel/plugin-syntax-top-level-await@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.4.tgz#bd7d8fa7b9fee793a36e4027fd6dd1aa32f946da" + integrity sha512-wdsOw0MvkL1UIgiQ/IFr3ETcfv1xb8RMM0H9wbiDyLaJFyiDg5oZvDLCXosIXmFeIlweML5iOBXAkqddkYNizg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-arrow-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== +"@babel/plugin-transform-arrow-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz#76309bd578addd8aee3b379d809c802305a98a12" + integrity sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz#e2b84f11952cf5913fe3438b7d2585042772f492" - integrity sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw== +"@babel/plugin-transform-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz#694cbeae6d613a34ef0292713fa42fb45c4470ba" + integrity sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg== dependencies: - "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.7.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" -"@babel/plugin-transform-block-scoped-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== +"@babel/plugin-transform-block-scoped-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.7.4.tgz#d0d9d5c269c78eaea76227ace214b8d01e4d837b" + integrity sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a" - integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw== +"@babel/plugin-transform-block-scoping@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz#200aad0dcd6bb80372f94d9e628ea062c58bf224" + integrity sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz#b411ecc1b8822d24b81e5d184f24149136eddd4a" - integrity sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA== +"@babel/plugin-transform-classes@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz#c92c14be0a1399e15df72667067a8f510c9400ec" + integrity sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg== dependencies: - "@babel/helper-annotate-as-pure" "^7.7.0" - "@babel/helper-define-map" "^7.7.0" - "@babel/helper-function-name" "^7.7.0" - "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-define-map" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/helper-replace-supers" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== +"@babel/plugin-transform-computed-properties@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.7.4.tgz#e856c1628d3238ffe12d668eb42559f79a81910d" + integrity sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" - integrity sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ== +"@babel/plugin-transform-destructuring@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz#2b713729e5054a1135097b6a67da1b6fe8789267" + integrity sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.0.tgz#c5c9ecacab3a5e0c11db6981610f0c32fd698b3b" - integrity sha512-3QQlF7hSBnSuM1hQ0pS3pmAbWLax/uGNCbPBND9y+oJ4Y776jsyujG2k0Sn2Aj2a0QwVOiOFL5QVPA7spjvzSA== +"@babel/plugin-transform-dotall-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.4.tgz#f7ccda61118c5b7a2599a72d5e3210884a021e96" + integrity sha512-mk0cH1zyMa/XHeb6LOTXTbG7uIJ8Rrjlzu91pUx/KS3JpcgaTDwMS8kM+ar8SLOvlL2Lofi4CGBAjCo3a2x+lw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-duplicate-keys@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" - integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== +"@babel/plugin-transform-duplicate-keys@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.7.4.tgz#3d21731a42e3f598a73835299dd0169c3b90ac91" + integrity sha512-g1y4/G6xGWMD85Tlft5XedGaZBCIVN+/P0bs6eabmcPP9egFleMAo65OOjlhcz1njpwagyY3t0nsQC9oTFegJA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-exponentiation-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== +"@babel/plugin-transform-exponentiation-operator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.7.4.tgz#dd30c0191e3a1ba19bcc7e389bdfddc0729d5db9" + integrity sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-for-of@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" - integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== +"@babel/plugin-transform-for-of@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz#248800e3a5e507b1f103d8b4ca998e77c63932bc" + integrity sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz#0fa786f1eef52e3b7d4fc02e54b2129de8a04c2a" - integrity sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA== +"@babel/plugin-transform-function-name@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz#75a6d3303d50db638ff8b5385d12451c865025b1" + integrity sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g== dependencies: - "@babel/helper-function-name" "^7.7.0" + "@babel/helper-function-name" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== +"@babel/plugin-transform-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.7.4.tgz#27fe87d2b5017a2a5a34d1c41a6b9f6a6262643e" + integrity sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-member-expression-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" - integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== +"@babel/plugin-transform-member-expression-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.7.4.tgz#aee127f2f3339fc34ce5e3055d7ffbf7aa26f19a" + integrity sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" - integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== +"@babel/plugin-transform-modules-amd@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.7.4.tgz#276b3845ca2b228f2995e453adc2e6f54d72fb71" + integrity sha512-/542/5LNA18YDtg1F+QHvvUSlxdvjZoD/aldQwkq+E3WCkbEjNSN9zdrOXaSlfg3IfGi22ijzecklF/A7kVZFQ== dependencies: - "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz#3e5ffb4fd8c947feede69cbe24c9554ab4113fe3" - integrity sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg== +"@babel/plugin-transform-modules-commonjs@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.4.tgz#bee4386e550446343dd52a571eda47851ff857a3" + integrity sha512-k8iVS7Jhc367IcNF53KCwIXtKAH7czev866ThsTgy8CwlXjnKZna2VHwChglzLleYrcHz1eQEIJlGRQxB53nqA== dependencies: - "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.7.0" + "@babel/helper-simple-access" "^7.7.4" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.0.tgz#9baf471213af9761c1617bb12fd278e629041417" - integrity sha512-ZAuFgYjJzDNv77AjXRqzQGlQl4HdUM6j296ee4fwKVZfhDR9LAGxfvXjBkb06gNETPnN0sLqRm9Gxg4wZH6dXg== +"@babel/plugin-transform-modules-systemjs@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.4.tgz#cd98152339d3e763dfe838b7d4273edaf520bb30" + integrity sha512-y2c96hmcsUi6LrMqvmNDPBBiGCiQu0aYqpHatVVu6kD4mFEXKjyNxd/drc18XXAf9dv7UXjrZwBVmTTGaGP8iw== dependencies: - "@babel/helper-hoist-variables" "^7.7.0" + "@babel/helper-hoist-variables" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.0.tgz#d62c7da16670908e1d8c68ca0b5d4c0097b69966" - integrity sha512-u7eBA03zmUswQ9LQ7Qw0/ieC1pcAkbp5OQatbWUzY1PaBccvuJXUkYzoN1g7cqp7dbTu6Dp9bXyalBvD04AANA== +"@babel/plugin-transform-modules-umd@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.4.tgz#1027c355a118de0aae9fee00ad7813c584d9061f" + integrity sha512-u2B8TIi0qZI4j8q4C51ktfO7E3cQ0qnaXFI1/OXITordD40tt17g/sXqgNNCcMTcBFKrUPcGDx+TBJuZxLx7tw== dependencies: - "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.0.tgz#358e6fd869b9a4d8f5cbc79e4ed4fc340e60dcaf" - integrity sha512-+SicSJoKouPctL+j1pqktRVCgy+xAch1hWWTMy13j0IflnyNjaoskj+DwRQFimHbLqO3sq2oN2CXMvXq3Bgapg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.4.tgz#fb3bcc4ee4198e7385805007373d6b6f42c98220" + integrity sha512-jBUkiqLKvUWpv9GLSuHUFYdmHg0ujC1JEYoZUfeOOfNydZXp1sXObgyPatpcwjWgsdBGsagWW0cdJpX/DO2jMw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" -"@babel/plugin-transform-new-target@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" - integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== +"@babel/plugin-transform-new-target@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.7.4.tgz#4a0753d2d60639437be07b592a9e58ee00720167" + integrity sha512-CnPRiNtOG1vRodnsyGX37bHQleHE14B9dnnlgSeEs3ek3fHN1A1SScglTCg1sfbe7sRQ2BUcpgpTpWSfMKz3gg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" - integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== +"@babel/plugin-transform-object-super@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz#48488937a2d586c0148451bf51af9d7dda567262" + integrity sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" + "@babel/helper-replace-supers" "^7.7.4" -"@babel/plugin-transform-parameters@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" - integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== +"@babel/plugin-transform-parameters@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.4.tgz#da4555c97f39b51ac089d31c7380f03bca4075ce" + integrity sha512-VJwhVePWPa0DqE9vcfptaJSzNDKrWU/4FbYCjZERtmqEs05g3UMXnYMZoXja7JAJ7Y7sPZipwm/pGApZt7wHlw== dependencies: - "@babel/helper-call-delegate" "^7.4.4" - "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-call-delegate" "^7.7.4" + "@babel/helper-get-function-arity" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-property-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" - integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== +"@babel/plugin-transform-property-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.7.4.tgz#2388d6505ef89b266103f450f9167e6bd73f98c2" + integrity sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-regenerator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz#f1b20b535e7716b622c99e989259d7dd942dd9cc" - integrity sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg== +"@babel/plugin-transform-regenerator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.4.tgz#d18eac0312a70152d7d914cbed2dc3999601cfc0" + integrity sha512-e7MWl5UJvmPEwFJTwkBlPmqixCtr9yAASBqff4ggXTNicZiwbF8Eefzm6NVgfiBp7JdAGItecnctKTgH44q2Jw== dependencies: regenerator-transform "^0.14.0" -"@babel/plugin-transform-reserved-words@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" - integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== +"@babel/plugin-transform-reserved-words@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.7.4.tgz#6a7cf123ad175bb5c69aec8f6f0770387ed3f1eb" + integrity sha512-OrPiUB5s5XvkCO1lS7D8ZtHcswIC57j62acAnJZKqGGnHP+TIc/ljQSrgdX/QyOTdEK5COAhuc820Hi1q2UgLQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-shorthand-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== +"@babel/plugin-transform-shorthand-properties@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.7.4.tgz#74a0a9b2f6d67a684c6fbfd5f0458eb7ba99891e" + integrity sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz#fc77cf798b24b10c46e1b51b1b88c2bf661bb8dd" - integrity sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg== +"@babel/plugin-transform-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz#aa673b356fe6b7e70d69b6e33a17fef641008578" + integrity sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-sticky-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== +"@babel/plugin-transform-sticky-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.7.4.tgz#ffb68c05090c30732076b1285dc1401b404a123c" + integrity sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" -"@babel/plugin-transform-template-literals@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" - integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== +"@babel/plugin-transform-template-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.7.4.tgz#1eb6411736dd3fe87dbd20cc6668e5121c17d604" + integrity sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-typeof-symbol@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== +"@babel/plugin-transform-typeof-symbol@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.7.4.tgz#3174626214f2d6de322882e498a38e8371b2140e" + integrity sha512-KQPUQ/7mqe2m0B8VecdyaW5XcQYaePyl9R7IsKd+irzj6jvbhoGnRE+M0aNkyAzI07VfUQ9266L5xMARitV3wg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-unicode-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz#743d9bcc44080e3cc7d49259a066efa30f9187a3" - integrity sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA== +"@babel/plugin-transform-unicode-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz#a3c0f65b117c4c81c5b6484f2a5e7b95346b83ae" + integrity sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/[email protected]": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.1.tgz#04a2ff53552c5885cf1083e291c8dd5490f744bb" - integrity sha512-/93SWhi3PxcVTDpSqC+Dp4YxUu3qZ4m7I76k0w73wYfn7bGVuRIO4QUz95aJksbS+AD1/mT1Ie7rbkT0wSplaA== +"@babel/[email protected]": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.4.tgz#ccaf309ae8d1ee2409c85a4e2b5e280ceee830f8" + integrity sha512-Dg+ciGJjwvC1NIe/DGblMbcGq1HOtKbw8RLl4nIjlfcILKEOkWT/vRqPpumswABEBVudii6dnVwrBtzD7ibm4g== dependencies: - "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.7.0" - "@babel/plugin-proposal-dynamic-import" "^7.7.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.6.2" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.7.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - "@babel/plugin-syntax-top-level-await" "^7.7.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.7.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.6.3" - "@babel/plugin-transform-classes" "^7.7.0" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.6.0" - "@babel/plugin-transform-dotall-regex" "^7.7.0" - "@babel/plugin-transform-duplicate-keys" "^7.5.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.4" - "@babel/plugin-transform-function-name" "^7.7.0" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.5.0" - "@babel/plugin-transform-modules-commonjs" "^7.7.0" - "@babel/plugin-transform-modules-systemjs" "^7.7.0" - "@babel/plugin-transform-modules-umd" "^7.7.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.0" - "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.5.5" - "@babel/plugin-transform-parameters" "^7.4.4" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.7.0" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.6.2" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.4.4" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.7.0" - "@babel/types" "^7.7.1" + "@babel/plugin-proposal-async-generator-functions" "^7.7.4" + "@babel/plugin-proposal-dynamic-import" "^7.7.4" + "@babel/plugin-proposal-json-strings" "^7.7.4" + "@babel/plugin-proposal-object-rest-spread" "^7.7.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.7.4" + "@babel/plugin-proposal-unicode-property-regex" "^7.7.4" + "@babel/plugin-syntax-async-generators" "^7.7.4" + "@babel/plugin-syntax-dynamic-import" "^7.7.4" + "@babel/plugin-syntax-json-strings" "^7.7.4" + "@babel/plugin-syntax-object-rest-spread" "^7.7.4" + "@babel/plugin-syntax-optional-catch-binding" "^7.7.4" + "@babel/plugin-syntax-top-level-await" "^7.7.4" + "@babel/plugin-transform-arrow-functions" "^7.7.4" + "@babel/plugin-transform-async-to-generator" "^7.7.4" + "@babel/plugin-transform-block-scoped-functions" "^7.7.4" + "@babel/plugin-transform-block-scoping" "^7.7.4" + "@babel/plugin-transform-classes" "^7.7.4" + "@babel/plugin-transform-computed-properties" "^7.7.4" + "@babel/plugin-transform-destructuring" "^7.7.4" + "@babel/plugin-transform-dotall-regex" "^7.7.4" + "@babel/plugin-transform-duplicate-keys" "^7.7.4" + "@babel/plugin-transform-exponentiation-operator" "^7.7.4" + "@babel/plugin-transform-for-of" "^7.7.4" + "@babel/plugin-transform-function-name" "^7.7.4" + "@babel/plugin-transform-literals" "^7.7.4" + "@babel/plugin-transform-member-expression-literals" "^7.7.4" + "@babel/plugin-transform-modules-amd" "^7.7.4" + "@babel/plugin-transform-modules-commonjs" "^7.7.4" + "@babel/plugin-transform-modules-systemjs" "^7.7.4" + "@babel/plugin-transform-modules-umd" "^7.7.4" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.4" + "@babel/plugin-transform-new-target" "^7.7.4" + "@babel/plugin-transform-object-super" "^7.7.4" + "@babel/plugin-transform-parameters" "^7.7.4" + "@babel/plugin-transform-property-literals" "^7.7.4" + "@babel/plugin-transform-regenerator" "^7.7.4" + "@babel/plugin-transform-reserved-words" "^7.7.4" + "@babel/plugin-transform-shorthand-properties" "^7.7.4" + "@babel/plugin-transform-spread" "^7.7.4" + "@babel/plugin-transform-sticky-regex" "^7.7.4" + "@babel/plugin-transform-template-literals" "^7.7.4" + "@babel/plugin-transform-typeof-symbol" "^7.7.4" + "@babel/plugin-transform-unicode-regex" "^7.7.4" + "@babel/types" "^7.7.4" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -727,6 +794,15 @@ "@babel/parser" "^7.7.0" "@babel/types" "^7.7.0" +"@babel/template@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" + integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" + "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" @@ -742,7 +818,22 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": +"@babel/traverse@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" + integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.7.0", "@babel/types@^7.7.2": version "7.7.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== @@ -751,6 +842,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" + integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@bazel/[email protected]": version "1.1.0" resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-1.1.0.tgz#9402ecadfaf0383bc366ef5b37b933e0d0e804fc"
bbf871c8178bf0aaf9ad0b50bca877c0da6f374a
2023-04-12 03:03:57
Angular Robot
build: update all non-major dependencies
false
update all non-major dependencies
build
diff --git a/package.json b/package.json index 89938f2586c9..35b5c6e2a094 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@types/parse5-html-rewriting-stream/@types/parse5-sax-parser": "^5.0.2" }, "devDependencies": { - "@ampproject/remapping": "2.2.0", + "@ampproject/remapping": "2.2.1", "@angular/animations": "16.0.0-next.7", "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#fb897a1ae4b084da69f77b3fc09848b57a321421", "@angular/cdk": "15.2.6", @@ -122,8 +122,8 @@ "@types/yargs": "^17.0.20", "@types/yargs-parser": "^21.0.0", "@types/yarnpkg__lockfile": "^1.1.5", - "@typescript-eslint/eslint-plugin": "5.57.1", - "@typescript-eslint/parser": "5.57.1", + "@typescript-eslint/eslint-plugin": "5.58.0", + "@typescript-eslint/parser": "5.58.0", "@yarnpkg/lockfile": "1.1.0", "@vitejs/plugin-basic-ssl": "1.0.1", "ajv": "8.12.0", @@ -141,9 +141,9 @@ "critters": "0.0.16", "css-loader": "6.7.3", "debug": "^4.1.1", - "esbuild": "0.17.15", - "esbuild-wasm": "0.17.15", - "eslint": "8.37.0", + "esbuild": "0.17.16", + "esbuild-wasm": "0.17.16", + "eslint": "8.38.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.27.5", @@ -185,17 +185,17 @@ "piscina": "3.2.0", "popper.js": "^1.14.1", "postcss": "8.4.21", - "postcss-loader": "7.2.3", + "postcss-loader": "7.2.4", "prettier": "^2.0.0", "protractor": "~7.0.0", "puppeteer": "18.2.1", "quicktype-core": "23.0.19", "resolve-url-loader": "5.0.0", "rxjs": "7.8.0", - "sass": "1.60.0", + "sass": "1.61.0", "sass-loader": "13.2.2", "sauce-connect-proxy": "https://saucelabs.com/downloads/sc-4.8.1-linux.tar.gz", - "semver": "7.3.8", + "semver": "7.4.0", "shelljs": "^0.8.5", "source-map": "0.7.4", "source-map-loader": "4.0.1", @@ -203,7 +203,7 @@ "spdx-satisfies": "^5.0.0", "symbol-observable": "4.0.0", "tar": "^6.1.6", - "terser": "5.16.8", + "terser": "5.16.9", "text-table": "0.2.0", "tree-kill": "1.2.2", "ts-node": "^10.9.1", @@ -212,7 +212,7 @@ "verdaccio": "5.23.2", "verdaccio-auth-memory": "^10.0.0", "vite": "4.2.1", - "webpack": "5.77.0", + "webpack": "5.78.0", "webpack-dev-middleware": "6.0.2", "webpack-dev-server": "4.13.2", "webpack-merge": "5.8.0", diff --git a/packages/angular/cli/package.json b/packages/angular/cli/package.json index 141d1c55b60b..d30f7635c66c 100644 --- a/packages/angular/cli/package.json +++ b/packages/angular/cli/package.json @@ -36,8 +36,8 @@ "open": "8.4.2", "ora": "5.4.1", "pacote": "15.1.1", - "resolve": "1.22.1", - "semver": "7.3.8", + "resolve": "1.22.2", + "semver": "7.4.0", "symbol-observable": "4.0.0", "yargs": "17.7.1" }, diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 006841588cd1..f841c5f6d43f 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -6,7 +6,7 @@ "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { - "@ampproject/remapping": "2.2.0", + "@ampproject/remapping": "2.2.1", "@angular-devkit/architect": "0.0.0-EXPERIMENTAL-PLACEHOLDER", "@angular-devkit/build-webpack": "0.0.0-EXPERIMENTAL-PLACEHOLDER", "@angular-devkit/core": "0.0.0-PLACEHOLDER", @@ -33,7 +33,7 @@ "copy-webpack-plugin": "11.0.0", "critters": "0.0.16", "css-loader": "6.7.3", - "esbuild-wasm": "0.17.15", + "esbuild-wasm": "0.17.16", "glob": "8.1.0", "https-proxy-agent": "5.0.1", "inquirer": "8.2.4", @@ -50,27 +50,27 @@ "parse5-html-rewriting-stream": "7.0.0", "piscina": "3.2.0", "postcss": "8.4.21", - "postcss-loader": "7.2.3", + "postcss-loader": "7.2.4", "resolve-url-loader": "5.0.0", "rxjs": "7.8.0", - "sass": "1.60.0", + "sass": "1.61.0", "sass-loader": "13.2.2", - "semver": "7.3.8", + "semver": "7.4.0", "source-map-loader": "4.0.1", "source-map-support": "0.5.21", - "terser": "5.16.8", + "terser": "5.16.9", "text-table": "0.2.0", "tree-kill": "1.2.2", "tslib": "2.5.0", "vite": "4.2.1", - "webpack": "5.77.0", + "webpack": "5.78.0", "webpack-dev-middleware": "6.0.2", "webpack-dev-server": "4.13.2", "webpack-merge": "5.8.0", "webpack-subresource-integrity": "5.1.0" }, "optionalDependencies": { - "esbuild": "0.17.15" + "esbuild": "0.17.16" }, "peerDependencies": { "@angular/compiler-cli": "^16.0.0-next.0", diff --git a/packages/angular_devkit/build_webpack/package.json b/packages/angular_devkit/build_webpack/package.json index 35bb09aad161..03c5e64a8de1 100644 --- a/packages/angular_devkit/build_webpack/package.json +++ b/packages/angular_devkit/build_webpack/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@angular-devkit/core": "0.0.0-PLACEHOLDER", "node-fetch": "2.6.7", - "webpack": "5.77.0" + "webpack": "5.78.0" }, "peerDependencies": { "webpack": "^5.30.0", diff --git a/packages/ngtools/webpack/package.json b/packages/ngtools/webpack/package.json index 23fbe2961b33..1e7690623c4b 100644 --- a/packages/ngtools/webpack/package.json +++ b/packages/ngtools/webpack/package.json @@ -31,6 +31,6 @@ "@angular/compiler": "16.0.0-next.7", "@angular/compiler-cli": "16.0.0-next.7", "typescript": "~5.0.2", - "webpack": "5.77.0" + "webpack": "5.78.0" } } diff --git a/yarn.lock b/yarn.lock index c6ab6f821bb6..b40bb6cf1108 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,6 +10,14 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" +"@ampproject/[email protected]": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + "@angular-devkit/[email protected]": version "0.1600.0-next.4" resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1600.0-next.4.tgz#c9a5196e5a9437a1db5ad9ec2ba8a24b44721fe4" @@ -1543,10 +1551,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.12.tgz#15a8e2b407d03989b899e325151dc2e96d19c620" integrity sha512-WQ9p5oiXXYJ33F2EkE3r0FRDFVpEdcDiwNX3u7Xaibxfx6vQE0Sb8ytrfQsA5WO6kDn6mDfKLh6KrPBjvkk7xA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.15.tgz#893ad71f3920ccb919e1757c387756a9bca2ef42" - integrity sha512-0kOB6Y7Br3KDVgHeg8PRcvfLkq+AccreK///B4Z6fNZGr/tNHX0z2VywCc7PTeWp+bPvjA5WMvNXltHw5QjAIA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.16.tgz#7b18cab5f4d93e878306196eed26b6d960c12576" + integrity sha512-QX48qmsEZW+gcHgTmAj+x21mwTz8MlYQBnzF6861cNdQGvj2jzzFjqH0EBabrIa/WVZ2CHolwMoqxVryqKt8+Q== "@esbuild/[email protected]": version "0.17.11" @@ -1558,10 +1566,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.12.tgz#677a09297e1f4f37aba7b4fc4f31088b00484985" integrity sha512-E/sgkvwoIfj4aMAPL2e35VnUJspzVYl7+M1B2cqeubdBhADV4uPon0KCc8p2G+LqSJ6i8ocYPCqY3A4GGq0zkQ== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.15.tgz#143e0d4e4c08c786ea410b9a7739779a9a1315d8" - integrity sha512-sRSOVlLawAktpMvDyJIkdLI/c/kdRTOqo8t6ImVxg8yT7LQDUYV5Rp2FKeEosLr6ZCja9UjYAzyRSxGteSJPYg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.16.tgz#5c47f6a7c2cada6ed4b4d4e72d8c66e76d812812" + integrity sha512-baLqRpLe4JnKrUXLJChoTN0iXZH7El/mu58GE3WIA6/H834k0XWvLRmGLG8y8arTRS9hJJibPnF0tiGhmWeZgw== "@esbuild/[email protected]": version "0.17.11" @@ -1573,10 +1581,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.12.tgz#b292729eef4e0060ae1941f6a021c4d2542a3521" integrity sha512-m4OsaCr5gT+se25rFPHKQXARMyAehHTQAz4XX1Vk3d27VtqiX0ALMBPoXZsGaB6JYryCLfgGwUslMqTfqeLU0w== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.15.tgz#d2d12a7676b2589864281b2274355200916540bc" - integrity sha512-MzDqnNajQZ63YkaUWVl9uuhcWyEyh69HGpMIrf+acR4otMkfLJ4sUCxqwbCyPGicE9dVlrysI3lMcDBjGiBBcQ== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.16.tgz#8686a6e98359071ffd5312046551943e7244c51a" + integrity sha512-G4wfHhrrz99XJgHnzFvB4UwwPxAWZaZBOFXh+JH1Duf1I4vIVfuYY9uVLpx4eiV2D/Jix8LJY+TAdZ3i40tDow== "@esbuild/[email protected]": version "0.17.11" @@ -1588,10 +1596,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.12.tgz#efa35318df931da05825894e1787b976d55adbe3" integrity sha512-O3GCZghRIx+RAN0NDPhyyhRgwa19MoKlzGonIb5hgTj78krqp9XZbYCvFr9N1eUxg0ZQEpiiZ4QvsOQwBpP+lg== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.15.tgz#2e88e79f1d327a2a7d9d06397e5232eb0a473d61" - integrity sha512-7siLjBc88Z4+6qkMDxPT2juf2e8SJxmsbNVKFY2ifWCDT72v5YJz9arlvBw5oB4W/e61H1+HDB/jnu8nNg0rLA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.16.tgz#aa79fbf447630ca0696a596beba962a775bbf394" + integrity sha512-/Ofw8UXZxuzTLsNFmz1+lmarQI6ztMZ9XktvXedTbt3SNWDn0+ODTwxExLYQ/Hod91EZB4vZPQJLoqLF0jvEzA== "@esbuild/[email protected]": version "0.17.11" @@ -1603,10 +1611,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.12.tgz#e7b54bb3f6dc81aadfd0485cd1623c648157e64d" integrity sha512-5D48jM3tW27h1qjaD9UNRuN+4v0zvksqZSPZqeSWggfMlsVdAhH3pwSfQIFJwcs9QJ9BRibPS4ViZgs3d2wsCA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.15.tgz#9384e64c0be91388c57be6d3a5eaf1c32a99c91d" - integrity sha512-NbImBas2rXwYI52BOKTW342Tm3LTeVlaOQ4QPZ7XuWNKiO226DisFk/RyPk3T0CKZkKMuU69yOvlapJEmax7cg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.16.tgz#d5d68ee510507104da7e7503224c647c957e163e" + integrity sha512-SzBQtCV3Pdc9kyizh36Ol+dNVhkDyIrGb/JXZqFq8WL37LIyrXU0gUpADcNV311sCOhvY+f2ivMhb5Tuv8nMOQ== "@esbuild/[email protected]": version "0.17.11" @@ -1618,10 +1626,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.12.tgz#99a18a8579d6299c449566fe91d9b6a54cf2a591" integrity sha512-OWvHzmLNTdF1erSvrfoEBGlN94IE6vCEaGEkEH29uo/VoONqPnoDFfShi41Ew+yKimx4vrmmAJEGNoyyP+OgOQ== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.15.tgz#2ad5a35bc52ebd9ca6b845dbc59ba39647a93c1a" - integrity sha512-Xk9xMDjBVG6CfgoqlVczHAdJnCs0/oeFOspFap5NkYAmRCT2qTn1vJWA2f419iMtsHSLm+O8B6SLV/HlY5cYKg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.16.tgz#b00b4cc8c2e424907cfe3a607384ab24794edd52" + integrity sha512-ZqftdfS1UlLiH1DnS2u3It7l4Bc3AskKeu+paJSfk7RNOMrOxmeFDhLTMQqMxycP1C3oj8vgkAT6xfAuq7ZPRA== "@esbuild/[email protected]": version "0.17.11" @@ -1633,10 +1641,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.12.tgz#0e090190fede307fb4022f671791a50dd5121abd" integrity sha512-A0Xg5CZv8MU9xh4a+7NUpi5VHBKh1RaGJKqjxe4KG87X+mTjDE6ZvlJqpWoeJxgfXHT7IMP9tDFu7IZ03OtJAw== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.15.tgz#b513a48446f96c75fda5bef470e64d342d4379cd" - integrity sha512-3TWAnnEOdclvb2pnfsTWtdwthPfOz7qAfcwDLcfZyGJwm1SRZIMOeB5FODVhnM93mFSPsHB9b/PmxNNbSnd0RQ== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.16.tgz#84af4430a07730b50bbc945a90cf7036c1853b76" + integrity sha512-rHV6zNWW1tjgsu0dKQTX9L0ByiJHHLvQKrWtnz8r0YYJI27FU3Xu48gpK2IBj1uCSYhJ+pEk6Y0Um7U3rIvV8g== "@esbuild/[email protected]": version "0.17.11" @@ -1648,10 +1656,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.12.tgz#7fe2a69f8a1a7153fa2b0f44aabcadb59475c7e0" integrity sha512-cK3AjkEc+8v8YG02hYLQIQlOznW+v9N+OI9BAFuyqkfQFR+DnDLhEM5N8QRxAUz99cJTo1rLNXqRrvY15gbQUg== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.15.tgz#9697b168175bfd41fa9cc4a72dd0d48f24715f31" - integrity sha512-T0MVnYw9KT6b83/SqyznTs/3Jg2ODWrZfNccg11XjDehIved2oQfrX/wVuev9N936BpMRaTR9I1J0tdGgUgpJA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.16.tgz#35571d15de6272c862d9ce6341372fb3cef0f266" + integrity sha512-8yoZhGkU6aHu38WpaM4HrRLTFc7/VVD9Q2SvPcmIQIipQt2I/GMTZNdEHXoypbbGao5kggLcxg0iBKjo0SQYKA== "@esbuild/[email protected]": version "0.17.11" @@ -1663,10 +1671,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.12.tgz#b87c76ebf1fe03e01fd6bb5cfc2f3c5becd5ee93" integrity sha512-WsHyJ7b7vzHdJ1fv67Yf++2dz3D726oO3QCu8iNYik4fb5YuuReOI9OtA+n7Mk0xyQivNTPbl181s+5oZ38gyA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.15.tgz#5b22062c54f48cd92fab9ffd993732a52db70cd3" - integrity sha512-MLTgiXWEMAMr8nmS9Gigx43zPRmEfeBfGCwxFQEMgJ5MC53QKajaclW6XDPjwJvhbebv+RzK05TQjvH3/aM4Xw== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.16.tgz#b65c7cd5b0eadd08f91aab66b9dda81b6a4b2a70" + integrity sha512-n4O8oVxbn7nl4+m+ISb0a68/lcJClIbaGAoXwqeubj/D1/oMMuaAXmJVfFlRjJLu/ZvHkxoiFJnmbfp4n8cdSw== "@esbuild/[email protected]": version "0.17.11" @@ -1678,10 +1686,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.12.tgz#9e9357090254524d32e6708883a47328f3037858" integrity sha512-jdOBXJqcgHlah/nYHnj3Hrnl9l63RjtQ4vn9+bohjQPI2QafASB5MtHAoEv0JQHVb/xYQTFOeuHnNYE1zF7tYw== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.15.tgz#eb28a13f9b60b5189fcc9e98e1024f6b657ba54c" - integrity sha512-wp02sHs015T23zsQtU4Cj57WiteiuASHlD7rXjKUyAGYzlOKDAjqK6bk5dMi2QEl/KVOcsjwL36kD+WW7vJt8Q== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.16.tgz#673a68cb251ce44a00a6422ada29064c5a1cd2c0" + integrity sha512-9ZBjlkdaVYxPNO8a7OmzDbOH9FMQ1a58j7Xb21UfRU29KcEEU3VTHk+Cvrft/BNv0gpWJMiiZ/f4w0TqSP0gLA== "@esbuild/[email protected]": version "0.17.11" @@ -1693,10 +1701,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.12.tgz#9deb605f9e2c82f59412ddfefb4b6b96d54b5b5b" integrity sha512-GTOEtj8h9qPKXCyiBBnHconSCV9LwFyx/gv3Phw0pa25qPYjVuuGZ4Dk14bGCfGX3qKF0+ceeQvwmtI+aYBbVA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.15.tgz#32454bdfe144cf74b77895a8ad21a15cb81cfbe5" - integrity sha512-k7FsUJjGGSxwnBmMh8d7IbObWu+sF/qbwc+xKZkBe/lTAF16RqxRCnNHA7QTd3oS2AfGBAnHlXL67shV5bBThQ== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.16.tgz#477e2da34ab46ffdbf4740fa6441e80045249385" + integrity sha512-TIZTRojVBBzdgChY3UOG7BlPhqJz08AL7jdgeeu+kiObWMFzGnQD7BgBBkWRwOtKR1i2TNlO7YK6m4zxVjjPRQ== "@esbuild/[email protected]": version "0.17.11" @@ -1708,10 +1716,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.12.tgz#6ef170b974ddf5e6acdfa5b05f22b6e9dfd2b003" integrity sha512-o8CIhfBwKcxmEENOH9RwmUejs5jFiNoDw7YgS0EJTF6kgPgcqLFjgoc5kDey5cMHRVCIWc6kK2ShUePOcc7RbA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.15.tgz#af12bde0d775a318fad90eb13a0455229a63987c" - integrity sha512-ZLWk6czDdog+Q9kE/Jfbilu24vEe/iW/Sj2d8EVsmiixQ1rM2RKH2n36qfxK4e8tVcaXkvuV3mU5zTZviE+NVQ== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.16.tgz#e1e9687bbdaa831d7c34edc9278200982c1a4bf4" + integrity sha512-UPeRuFKCCJYpBbIdczKyHLAIU31GEm0dZl1eMrdYeXDH+SJZh/i+2cAmD3A1Wip9pIc5Sc6Kc5cFUrPXtR0XHA== "@esbuild/[email protected]": version "0.17.11" @@ -1723,10 +1731,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.12.tgz#1638d3d4acf1d34aaf37cf8908c2e1cefed16204" integrity sha512-biMLH6NR/GR4z+ap0oJYb877LdBpGac8KfZoEnDiBKd7MD/xt8eaw1SFfYRUeMVx519kVkAOL2GExdFmYnZx3A== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.15.tgz#34c5ed145b2dfc493d3e652abac8bd3baa3865a5" - integrity sha512-mY6dPkIRAiFHRsGfOYZC8Q9rmr8vOBZBme0/j15zFUKM99d4ILY4WpOC7i/LqoY+RE7KaMaSfvY8CqjJtuO4xg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.16.tgz#2f19075d63622987e86e83a4b7866cd57b796c60" + integrity sha512-io6yShgIEgVUhExJejJ21xvO5QtrbiSeI7vYUnr7l+v/O9t6IowyhdiYnyivX2X5ysOVHAuyHW+Wyi7DNhdw6Q== "@esbuild/[email protected]": version "0.17.11" @@ -1738,10 +1746,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.12.tgz#135b6e9270a8e2de2b9094bb21a287517df520ef" integrity sha512-jkphYUiO38wZGeWlfIBMB72auOllNA2sLfiZPGDtOBb1ELN8lmqBrlMiucgL8awBw1zBXN69PmZM6g4yTX84TA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.15.tgz#87bd515e837f2eb004b45f9e6a94dc5b93f22b92" - integrity sha512-EcyUtxffdDtWjjwIH8sKzpDRLcVtqANooMNASO59y+xmqqRYBBM7xVLQhqF7nksIbm2yHABptoioS9RAbVMWVA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.16.tgz#bbf40a38f03ba2434fe69b5ceeec5d13c742b329" + integrity sha512-WhlGeAHNbSdG/I2gqX2RK2gfgSNwyJuCiFHMc8s3GNEMMHUI109+VMBfhVqRb0ZGzEeRiibi8dItR3ws3Lk+cA== "@esbuild/[email protected]": version "0.17.11" @@ -1753,10 +1761,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.12.tgz#21e40830770c5d08368e300842bde382ce97d615" integrity sha512-j3ucLdeY9HBcvODhCY4b+Ds3hWGO8t+SAidtmWu/ukfLLG/oYDMaA+dnugTVAg5fnUOGNbIYL9TOjhWgQB8W5g== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.15.tgz#20bf7947197f199ddac2ec412029a414ceae3aa3" - integrity sha512-BuS6Jx/ezxFuHxgsfvz7T4g4YlVrmCmg7UAwboeyNNg0OzNzKsIZXpr3Sb/ZREDXWgt48RO4UQRDBxJN3B9Rbg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.16.tgz#d2b8c0779ccd2b7917cdf0fab8831a468e0f9c01" + integrity sha512-gHRReYsJtViir63bXKoFaQ4pgTyah4ruiMRQ6im9YZuv+gp3UFJkNTY4sFA73YDynmXZA6hi45en4BGhNOJUsw== "@esbuild/[email protected]": version "0.17.11" @@ -1768,10 +1776,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.12.tgz#76c1c199871d48e1aaa47a762fb9e0dca52e1f7a" integrity sha512-uo5JL3cgaEGotaqSaJdRfFNSCUJOIliKLnDGWaVCgIKkHxwhYMm95pfMbWZ9l7GeW9kDg0tSxcy9NYdEtjwwmA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.15.tgz#31b93f9c94c195e852c20cd3d1914a68aa619124" - integrity sha512-JsdS0EgEViwuKsw5tiJQo9UdQdUJYuB+Mf6HxtJSPN35vez1hlrNb1KajvKWF5Sa35j17+rW1ECEO9iNrIXbNg== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.16.tgz#da48b39cfdc1b12a74976625f583f031eac43590" + integrity sha512-mfiiBkxEbUHvi+v0P+TS7UnA9TeGXR48aK4XHkTj0ZwOijxexgMF01UDFaBX7Q6CQsB0d+MFNv9IiXbIHTNd4g== "@esbuild/[email protected]": version "0.17.11" @@ -1783,10 +1791,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.12.tgz#c7c3b3017a4b938c76c35f66af529baf62eac527" integrity sha512-DNdoRg8JX+gGsbqt2gPgkgb00mqOgOO27KnrWZtdABl6yWTST30aibGJ6geBq3WM2TIeW6COs5AScnC7GwtGPg== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.15.tgz#8da299b3ac6875836ca8cdc1925826498069ac65" - integrity sha512-R6fKjtUysYGym6uXf6qyNephVUQAGtf3n2RCsOST/neIwPqRWcnc3ogcielOd6pT+J0RDR1RGcy0ZY7d3uHVLA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.16.tgz#ddef985aed37cc81908d2573b66c0299dbc49037" + integrity sha512-n8zK1YRDGLRZfVcswcDMDM0j2xKYLNXqei217a4GyBxHIuPMGrrVuJ+Ijfpr0Kufcm7C1k/qaIrGy6eG7wvgmA== "@esbuild/[email protected]": version "0.17.11" @@ -1798,10 +1806,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.12.tgz#05d04217d980e049001afdbeacbb58d31bb5cefb" integrity sha512-aVsENlr7B64w8I1lhHShND5o8cW6sB9n9MUtLumFlPhG3elhNWtE7M1TFpj3m7lT3sKQUMkGFjTQBrvDDO1YWA== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.15.tgz#04a1ec3d4e919714dba68dcf09eeb1228ad0d20c" - integrity sha512-mVD4PGc26b8PI60QaPUltYKeSX0wxuy0AltC+WCTFwvKCq2+OgLP4+fFd+hZXzO2xW1HPKcytZBdjqL6FQFa7w== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.16.tgz#85035bf89efd66e9068bc72aa6bb85a2c317d090" + integrity sha512-lEEfkfsUbo0xC47eSTBqsItXDSzwzwhKUSsVaVjVji07t8+6KA5INp2rN890dHZeueXJAI8q0tEIfbwVRYf6Ew== "@esbuild/[email protected]": version "0.17.11" @@ -1813,10 +1821,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.12.tgz#cf3862521600e4eb6c440ec3bad31ed40fb87ef3" integrity sha512-qbHGVQdKSwi0JQJuZznS4SyY27tYXYF0mrgthbxXrZI3AHKuRvU+Eqbg/F0rmLDpW/jkIZBlCO1XfHUBMNJ1pg== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.15.tgz#6694ebe4e16e5cd7dab6505ff7c28f9c1c695ce5" - integrity sha512-U6tYPovOkw3459t2CBwGcFYfFRjivcJJc1WC8Q3funIwX8x4fP+R6xL/QuTPNGOblbq/EUDxj9GU+dWKX0oWlQ== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.16.tgz#16338ecab854cb2d831cc9ee9cc21ef69566e1f3" + integrity sha512-jlRjsuvG1fgGwnE8Afs7xYDnGz0dBgTNZfgCK6TlvPH3Z13/P5pi6I57vyLE8qZYLrGVtwcm9UbUx1/mZ8Ukag== "@esbuild/[email protected]": version "0.17.11" @@ -1828,10 +1836,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.12.tgz#43dd7fb5be77bf12a1550355ab2b123efd60868e" integrity sha512-zsCp8Ql+96xXTVTmm6ffvoTSZSV2B/LzzkUXAY33F/76EajNw1m+jZ9zPfNJlJ3Rh4EzOszNDHsmG/fZOhtqDg== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.15.tgz#1f95b2564193c8d1fee8f8129a0609728171d500" - integrity sha512-W+Z5F++wgKAleDABemiyXVnzXgvRFs+GVKThSI+mGgleLWluv0D7Diz4oQpgdpNzh4i2nNDzQtWbjJiqutRp6Q== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.16.tgz#423f46bb744aff897a5f74435469e1ef4952e343" + integrity sha512-TzoU2qwVe2boOHl/3KNBUv2PNUc38U0TNnzqOAcgPiD/EZxT2s736xfC2dYQbszAwo4MKzzwBV0iHjhfjxMimg== "@esbuild/[email protected]": version "0.17.11" @@ -1843,10 +1851,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.12.tgz#9940963d0bff4ea3035a84e2b4c6e41c5e6296eb" integrity sha512-FfrFjR4id7wcFYOdqbDfDET3tjxCozUgbqdkOABsSFzoZGFC92UK7mg4JKRc/B3NNEf1s2WHxJ7VfTdVDPN3ng== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.15.tgz#c362b88b3df21916ed7bcf75c6d09c6bf3ae354a" - integrity sha512-Muz/+uGgheShKGqSVS1KsHtCyEzcdOn/W/Xbh6H91Etm+wiIfwZaBn1W58MeGtfI8WA961YMHFYTthBdQs4t+w== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.16.tgz#1978be5b192c7063bd2c8d5960eb213e1964740e" + integrity sha512-B8b7W+oo2yb/3xmwk9Vc99hC9bNolvqjaTZYEfMQhzdpBsjTvZBlXQ/teUE55Ww6sg//wlcDjOaqldOKyigWdA== "@esbuild/[email protected]": version "0.17.11" @@ -1858,10 +1866,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.12.tgz#3a11d13e9a5b0c05db88991b234d8baba1f96487" integrity sha512-JOOxw49BVZx2/5tW3FqkdjSD/5gXYeVGPDcB0lvap0gLQshkh1Nyel1QazC+wNxus3xPlsYAgqU1BUmrmCvWtw== -"@esbuild/[email protected]": - version "0.17.15" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.15.tgz#c2e737f3a201ebff8e2ac2b8e9f246b397ad19b8" - integrity sha512-DjDa9ywLUUmjhV2Y9wUTIF+1XsmuFGvZoCmOWkli1XcNAh5t25cc7fgsCx4Zi/Uurep3TTLyDiKATgGEg61pkA== +"@esbuild/[email protected]": + version "0.17.16" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.16.tgz#260f19b0a3300d22c3a3f52722c671dc561edaa3" + integrity sha512-xJ7OH/nanouJO9pf03YsL9NAFQBHd8AqfrQd7Pf5laGyyTt/gToul6QYOA/i5i/q8y9iaM5DQFNTgpi995VkOg== "@eslint-community/eslint-utils@^4.2.0": version "4.3.0" @@ -1890,10 +1898,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/[email protected]": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" - integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== +"@eslint/[email protected]": + version "8.38.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" + integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== "@gar/promisify@^1.1.3": version "1.1.3" @@ -3696,15 +3704,15 @@ dependencies: "@types/node" "*" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz#d1ab162a3cd2671b8a1c9ddf6e2db73b14439735" - integrity sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.58.0.tgz#b1d4b0ad20243269d020ef9bbb036a40b0849829" + integrity sha512-vxHvLhH0qgBd3/tW6/VccptSfc8FxPQIkmNTVLWcCOVqSBvqpnKkBTYrhcGlXfSnd78azwe+PsjYFj0X34/njA== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/type-utils" "5.57.1" - "@typescript-eslint/utils" "5.57.1" + "@typescript-eslint/scope-manager" "5.58.0" + "@typescript-eslint/type-utils" "5.58.0" + "@typescript-eslint/utils" "5.58.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -3712,72 +3720,72 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" - integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.58.0.tgz#2ac4464cf48bef2e3234cb178ede5af352dddbc6" + integrity sha512-ixaM3gRtlfrKzP8N6lRhBbjTow1t6ztfBvQNGuRM8qH1bjFFXIJ35XY+FC0RRBKn3C6cT+7VW1y8tNm7DwPHDQ== dependencies: - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/scope-manager" "5.58.0" + "@typescript-eslint/types" "5.58.0" + "@typescript-eslint/typescript-estree" "5.58.0" debug "^4.3.4" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz#5d28799c0fc8b501a29ba1749d827800ef22d710" - integrity sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.58.0.tgz#5e023a48352afc6a87be6ce3c8e763bc9e2f0bc8" + integrity sha512-b+w8ypN5CFvrXWQb9Ow9T4/6LC2MikNf1viLkYTiTbkQl46CnR69w7lajz1icW0TBsYmlpg+mRzFJ4LEJ8X9NA== dependencies: - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/visitor-keys" "5.57.1" + "@typescript-eslint/types" "5.58.0" + "@typescript-eslint/visitor-keys" "5.58.0" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz#235daba621d3f882b8488040597b33777c74bbe9" - integrity sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.58.0.tgz#f7d5b3971483d4015a470d8a9e5b8a7d10066e52" + integrity sha512-FF5vP/SKAFJ+LmR9PENql7fQVVgGDOS+dq3j+cKl9iW/9VuZC/8CFmzIP0DLKXfWKpRHawJiG70rVH+xZZbp8w== dependencies: - "@typescript-eslint/typescript-estree" "5.57.1" - "@typescript-eslint/utils" "5.57.1" + "@typescript-eslint/typescript-estree" "5.58.0" + "@typescript-eslint/utils" "5.58.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.1.tgz#d9989c7a9025897ea6f0550b7036027f69e8a603" - integrity sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.58.0.tgz#54c490b8522c18986004df7674c644ffe2ed77d8" + integrity sha512-JYV4eITHPzVQMnHZcYJXl2ZloC7thuUHrcUmxtzvItyKPvQ50kb9QXBkgNAt90OYMqwaodQh2kHutWZl1fc+1g== -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz#10d9643e503afc1ca4f5553d9bbe672ea4050b71" - integrity sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.58.0.tgz#4966e6ff57eaf6e0fce2586497edc097e2ab3e61" + integrity sha512-cRACvGTodA+UxnYM2uwA2KCwRL7VAzo45syNysqlMyNyjw0Z35Icc9ihPJZjIYuA5bXJYiJ2YGUB59BqlOZT1Q== dependencies: - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/visitor-keys" "5.57.1" + "@typescript-eslint/types" "5.58.0" + "@typescript-eslint/visitor-keys" "5.58.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.1.tgz#0f97b0bbd88c2d5e2036869f26466be5f4c69475" - integrity sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.58.0.tgz#430d7c95f23ec457b05be5520c1700a0dfd559d5" + integrity sha512-gAmLOTFXMXOC+zP1fsqm3VceKSBQJNzV385Ok3+yzlavNHZoedajjS4UyS21gabJYcobuigQPs/z71A9MdJFqQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/scope-manager" "5.58.0" + "@typescript-eslint/types" "5.58.0" + "@typescript-eslint/typescript-estree" "5.58.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/[email protected]": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz#585e5fa42a9bbcd9065f334fd7c8a4ddfa7d905e" - integrity sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA== +"@typescript-eslint/[email protected]": + version "5.58.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.58.0.tgz#eb9de3a61d2331829e6761ce7fd13061781168b4" + integrity sha512-/fBraTlPj0jwdyTwLyrRTxv/3lnU2H96pNTVM6z3esTWLtA5MZ9ghSMJ7Rb+TtUAdtEw9EyJzJ0EydIMKxQ9gA== dependencies: - "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/types" "5.58.0" eslint-visitor-keys "^3.3.0" "@verdaccio/[email protected]": @@ -5919,10 +5927,10 @@ [email protected]: resolved "https://registry.yarnpkg.com/esbuild-wasm/-/esbuild-wasm-0.17.11.tgz#7385be5eb53b010817e258b180be52dc951deff0" integrity sha512-QVKUEoCj6R0LCRGugue1yaT0Uk+vjIDuqOntUCC9AR22dguB5+Zd8ch/ySkil62HeGCeGmSgnKWhTxUhGrhONw== [email protected]: - version "0.17.15" - resolved "https://registry.yarnpkg.com/esbuild-wasm/-/esbuild-wasm-0.17.15.tgz#e8c9c9d46bd6a0c1ed100cf85c4265f3c9b14cac" - integrity sha512-ZETv4K3rvtKu8gXMxFZ0YgrPWO0MQl4bC9TCXkmjHAiw3vdDccRPwVDjnOaTs5LUPhy6kiBK7QnjcjnVjHt8Aw== [email protected]: + version "0.17.16" + resolved "https://registry.yarnpkg.com/esbuild-wasm/-/esbuild-wasm-0.17.16.tgz#d50c2a937ea637cdb52a3c62c3fc4b3f2106c06f" + integrity sha512-o5DNFwnYThm9LXYIEoZEnJrk7cI08GwVjHKMUHDFSN8vo0y8eKdEOAgNH3rSoBK/8E34PeKr1UO0liEBIH/GFQ== esbuild-wasm@^0.17.0: version "0.17.12" @@ -5957,33 +5965,33 @@ [email protected]: "@esbuild/win32-ia32" "0.17.11" "@esbuild/win32-x64" "0.17.11" [email protected]: - version "0.17.15" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.15.tgz#209ebc87cb671ffb79574db93494b10ffaf43cbc" - integrity sha512-LBUV2VsUIc/iD9ME75qhT4aJj0r75abCVS0jakhFzOtR7TQsqQA5w0tZ+KTKnwl3kXE0MhskNdHDh/I5aCR1Zw== [email protected]: + version "0.17.16" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.16.tgz#5efec24a8ff29e0c157359f27e1b5532a728b720" + integrity sha512-aeSuUKr9aFVY9Dc8ETVELGgkj4urg5isYx8pLf4wlGgB0vTFjxJQdHnNH6Shmx4vYYrOTLCHtRI5i1XZ9l2Zcg== optionalDependencies: - "@esbuild/android-arm" "0.17.15" - "@esbuild/android-arm64" "0.17.15" - "@esbuild/android-x64" "0.17.15" - "@esbuild/darwin-arm64" "0.17.15" - "@esbuild/darwin-x64" "0.17.15" - "@esbuild/freebsd-arm64" "0.17.15" - "@esbuild/freebsd-x64" "0.17.15" - "@esbuild/linux-arm" "0.17.15" - "@esbuild/linux-arm64" "0.17.15" - "@esbuild/linux-ia32" "0.17.15" - "@esbuild/linux-loong64" "0.17.15" - "@esbuild/linux-mips64el" "0.17.15" - "@esbuild/linux-ppc64" "0.17.15" - "@esbuild/linux-riscv64" "0.17.15" - "@esbuild/linux-s390x" "0.17.15" - "@esbuild/linux-x64" "0.17.15" - "@esbuild/netbsd-x64" "0.17.15" - "@esbuild/openbsd-x64" "0.17.15" - "@esbuild/sunos-x64" "0.17.15" - "@esbuild/win32-arm64" "0.17.15" - "@esbuild/win32-ia32" "0.17.15" - "@esbuild/win32-x64" "0.17.15" + "@esbuild/android-arm" "0.17.16" + "@esbuild/android-arm64" "0.17.16" + "@esbuild/android-x64" "0.17.16" + "@esbuild/darwin-arm64" "0.17.16" + "@esbuild/darwin-x64" "0.17.16" + "@esbuild/freebsd-arm64" "0.17.16" + "@esbuild/freebsd-x64" "0.17.16" + "@esbuild/linux-arm" "0.17.16" + "@esbuild/linux-arm64" "0.17.16" + "@esbuild/linux-ia32" "0.17.16" + "@esbuild/linux-loong64" "0.17.16" + "@esbuild/linux-mips64el" "0.17.16" + "@esbuild/linux-ppc64" "0.17.16" + "@esbuild/linux-riscv64" "0.17.16" + "@esbuild/linux-s390x" "0.17.16" + "@esbuild/linux-x64" "0.17.16" + "@esbuild/netbsd-x64" "0.17.16" + "@esbuild/openbsd-x64" "0.17.16" + "@esbuild/sunos-x64" "0.17.16" + "@esbuild/win32-arm64" "0.17.16" + "@esbuild/win32-ia32" "0.17.16" + "@esbuild/win32-x64" "0.17.16" esbuild@^0.17.0, esbuild@^0.17.5: version "0.17.12" @@ -6106,15 +6114,15 @@ eslint-visitor-keys@^3.4.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== [email protected]: - version "8.37.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" - integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== [email protected]: + version "8.38.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" + integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.37.0" + "@eslint/js" "8.38.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -9606,10 +9614,10 @@ [email protected]: klona "^2.0.5" semver "^7.3.8" [email protected]: - version "7.2.3" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-7.2.3.tgz#c2d491a769102e0aac228d53fb1ad376cc158bb2" - integrity sha512-H/PIjgbn2q7zFnmUMPvEupIFnOAg+fYWC/4F6DugK8uPITVYyEflnSjLFV0u20B3Qi88PzPiAlzn8hBSu3f8oA== [email protected]: + version "7.2.4" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-7.2.4.tgz#2884f4ca172de633b2cf1f93dc852968f0632ba9" + integrity sha512-F88rpxxNspo5hatIc+orYwZDtHFaVFOSIVAx+fBfJC1GmhWbVmPWtmg2gXKE1OxJbneOSGn8PWdIwsZFcruS+w== dependencies: cosmiconfig "^8.1.3" cosmiconfig-typescript-loader "^4.3.0" @@ -10227,7 +10235,16 @@ [email protected]: postcss "^8.2.14" source-map "0.6.1" [email protected], resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.1, resolve@~1.22.1: [email protected]: + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== + dependencies: + is-core-module "^2.11.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.1, resolve@~1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -10405,10 +10422,10 @@ [email protected], sass@^1.55.0: immutable "^4.0.0" source-map-js ">=0.6.2 <2.0.0" [email protected]: - version "1.60.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.60.0.tgz#657f0c23a302ac494b09a5ba8497b739fb5b5a81" - integrity sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ== [email protected]: + version "1.61.0" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.61.0.tgz#d1f6761bb833887b8fdab32a24e052c40531d02b" + integrity sha512-PDsN7BrVkNZK2+dj/dpKQAWZavbAQ87IXqVvw2+oEYI+GwlTWkvbQtL7F2cCNbMqJEYKPh1EcjSxsnqIb/kyaQ== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" @@ -10497,6 +10514,13 @@ [email protected], semver@^7.0.0, semver@^7.1.1, semver@^7.3.5, semver@^7.3.7, semver dependencies: lru-cache "^6.0.0" [email protected]: + version "7.4.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" + integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== + dependencies: + lru-cache "^6.0.0" + semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -11163,10 +11187,10 @@ [email protected], terser@^5.16.5: commander "^2.20.0" source-map-support "~0.5.20" [email protected]: - version "5.16.8" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.8.tgz#ccde583dabe71df3f4ed02b65eb6532e0fae15d5" - integrity sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA== [email protected]: + version "5.16.9" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.9.tgz#7a28cb178e330c484369886f2afd623d9847495f" + integrity sha512-HPa/FdTB9XGI2H1/keLFZHxl6WNvAI4YalHGtDQTlMnJcoqSab1UwL4l1hGEhs6/GmLHBZIg/YgB++jcbzoOEg== dependencies: "@jridgewell/source-map" "^0.3.2" acorn "^8.5.0" @@ -11943,10 +11967,10 @@ [email protected]: watchpack "^2.4.0" webpack-sources "^3.2.3" [email protected]: - version "5.77.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.77.0.tgz#dea3ad16d7ea6b84aa55fa42f4eac9f30e7eb9b4" - integrity sha512-sbGNjBr5Ya5ss91yzjeJTLKyfiwo5C628AFjEa6WSXcZa4E+F57om3Cc8xLb1Jh0b243AWuSYRf3dn7HVeFQ9Q== [email protected]: + version "5.78.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.78.0.tgz#836452a12416af2a7beae906b31644cb2562f9e6" + integrity sha512-gT5DP72KInmE/3azEaQrISjTvLYlSM0j1Ezhht/KLVkrqtv10JoP/RXhwmX/frrutOPuSq3o5Vq0ehR/4Vmd1g== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51"
b7a612f14a24fee897314ef4b0be3494f0c55131
2020-04-06 22:28:42
Alan Agius
feat(@schematics/angular): change `browserslist` file name to `.browserslistrc`
false
change `browserslist` file name to `.browserslistrc`
feat
diff --git a/packages/angular_devkit/build_angular/test/browser/scripts-array_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/scripts-array_spec_large.ts index 18b183588747..1b0db06852de 100644 --- a/packages/angular_devkit/build_angular/test/browser/scripts-array_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/scripts-array_spec_large.ts @@ -95,7 +95,7 @@ describe('Browser Builder scripts array', () => { host.appendToFile('src/main.ts', '\nimport \'./input-script.js\';'); // Enable differential loading - host.appendToFile('browserslist', '\nIE 10'); + host.appendToFile('.browserslistrc', '\nIE 10'); // Remove styles so we don't have to account for them in the index.html order check. const { files } = await browserBuild(architect, host, target, { diff --git a/packages/schematics/angular/application/files/browserslist.template b/packages/schematics/angular/application/files/browserslist.template deleted file mode 100644 index 80848532e47d..000000000000 --- a/packages/schematics/angular/application/files/browserslist.template +++ /dev/null @@ -1,12 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -> 0.5% -last 2 versions -Firefox ESR -not dead -not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/packages/schematics/angular/migrations/migration-collection.json b/packages/schematics/angular/migrations/migration-collection.json index c5b8912e3c34..060b8cb57fd7 100644 --- a/packages/schematics/angular/migrations/migration-collection.json +++ b/packages/schematics/angular/migrations/migration-collection.json @@ -59,6 +59,11 @@ "version": "10.0.0-beta.0", "factory": "./update-10/update-tslint", "description": "Update tslint to version 6." + }, + "rename-browserslist-config": { + "version": "10.0.0-beta.0", + "factory": "./update-10/rename-browserslist-config", + "description": "Renaming Browserslist configurations to '.browserslistrc'." } } } diff --git a/packages/schematics/angular/migrations/update-10/rename-browserslist-config.ts b/packages/schematics/angular/migrations/update-10/rename-browserslist-config.ts new file mode 100644 index 000000000000..f5e2efd74500 --- /dev/null +++ b/packages/schematics/angular/migrations/update-10/rename-browserslist-config.ts @@ -0,0 +1,39 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { Path, join } from '@angular-devkit/core'; +import { DirEntry, Rule } from '@angular-devkit/schematics'; + +function visit(directory: DirEntry): Path[] { + const files: Path[] = []; + + for (const path of directory.subfiles) { + if (path !== 'browserslist') { + continue; + } + + files.push(join(directory.path, path)); + } + + for (const path of directory.subdirs) { + if (path === 'node_modules') { + continue; + } + + files.push(...visit(directory.dir(path))); + } + + return files; +} + +export default function (): Rule { + return tree => { + for (const path of visit(tree.root)) { + tree.rename(path, path.replace(/browserslist$/, '.browserslistrc')); + } + }; +} diff --git a/packages/schematics/angular/migrations/update-10/rename-browserslist-config_spec.ts b/packages/schematics/angular/migrations/update-10/rename-browserslist-config_spec.ts new file mode 100644 index 000000000000..7162b1921032 --- /dev/null +++ b/packages/schematics/angular/migrations/update-10/rename-browserslist-config_spec.ts @@ -0,0 +1,50 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { EmptyTree } from '@angular-devkit/schematics'; +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; + +describe('Migration to rename Browserslist configurations', () => { + const schematicName = 'rename-browserslist-config'; + + const schematicRunner = new SchematicTestRunner( + 'migrations', + require.resolve('../migration-collection.json'), + ); + + let tree: UnitTestTree; + beforeEach(() => { + tree = new UnitTestTree(new EmptyTree()); + }); + + it(`should rename file 'browserslist' to 'browserslistrc'`, async () => { + tree.create('/browserslist', 'IE9'); + tree.create('/src/app/home/browserslist', 'IE9'); + + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + expect(newTree.exists('/.browserslistrc')).toBeTruthy(); + expect(newTree.exists('/browserslist')).toBeFalsy(); + + expect(newTree.exists('/src/app/home/.browserslistrc')).toBeTruthy(); + expect(newTree.exists('/src/app/home/browserslist')).toBeFalsy(); + }); + + it(`should not rename "browserslist" file in 'node_modules'`, async () => { + tree.create('/node_modules/browserslist', 'IE9'); + + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + expect(newTree.exists('/node_modules/browserslist')).toBeTruthy(); + expect(newTree.exists('/node_modules/.browserslistrc')).toBeFalsy(); + }); + + it(`should not rename a folder which is named 'browserslist'`, async () => { + tree.create('/app/browserslist/file.txt', 'content'); + + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + expect(newTree.exists('/app/browserslist/file.txt')).toBeTruthy(); + }); +}); diff --git a/packages/schematics/angular/migrations/update-8/differential-loading_spec.ts b/packages/schematics/angular/migrations/update-8/differential-loading_spec.ts index 70360efb121c..874687ff6d38 100644 --- a/packages/schematics/angular/migrations/update-8/differential-loading_spec.ts +++ b/packages/schematics/angular/migrations/update-8/differential-loading_spec.ts @@ -105,14 +105,12 @@ describe('Migration to version 8', () => { }); it(`should create browserslist file if it doesn't exist`, async () => { - tree.delete('/browserslist'); const tree2 = await schematicRunner.runSchematicAsync('migration-07', {}, tree.branch()).toPromise(); expect(tree2.exists('/browserslist')).toBe(true); }); it('should move browserslist file if it exists in the sourceRoot', async () => { tree.create('/src/browserslist', 'last 2 Chrome versions'); - tree.delete('/browserslist'); const tree2 = await schematicRunner.runSchematicAsync('migration-07', {}, tree.branch()).toPromise(); expect(tree2.exists('/browserslist')).toBe(true); }); @@ -191,7 +189,6 @@ describe('Migration to version 8', () => { }); it(`should not update projects which browser builder is not 'build-angular:browser'`, async () => { - tree.delete('/browserslist'); const config = JSON.parse(tree.readContent('angular.json')); config.projects['migration-test'].architect.build.builder = '@dummy/builders:browser'; @@ -201,8 +198,7 @@ describe('Migration to version 8', () => { }); it(`should move 'browserslist' to root when 'sourceRoot' is not defined`, async () => { - tree.rename('/browserslist', '/src/browserslist'); - expect(tree.exists('/src/browserslist')).toBe(true); + tree.create('/src/browserslist', 'content'); const config = JSON.parse(tree.readContent('angular.json')); config.projects['migration-test'].sourceRoot = undefined;
e9b29be33e54427bc270ae736058a3e821b46f6f
2024-10-01 15:02:18
Charles Lyding
refactor(@angular/build): remove deprecated Vite node server hot field usage
false
remove deprecated Vite node server hot field usage
refactor
diff --git a/packages/angular/build/src/builders/dev-server/vite-server.ts b/packages/angular/build/src/builders/dev-server/vite-server.ts index ac983f9e8a37..3d147872f7a5 100644 --- a/packages/angular/build/src/builders/dev-server/vite-server.ts +++ b/packages/angular/build/src/builders/dev-server/vite-server.ts @@ -181,7 +181,7 @@ export async function* serveWithVite( case ResultKind.Failure: if (result.errors.length && server) { hadError = true; - server.hot.send({ + server.ws.send({ type: 'error', err: { message: result.errors[0].text, @@ -230,7 +230,7 @@ export async function* serveWithVite( if (hadError && server) { hadError = false; // Send an empty update to clear the error overlay - server.hot.send({ + server.ws.send({ 'type': 'update', updates: [], }); @@ -369,7 +369,7 @@ export async function* serveWithVite( key: 'r', description: 'force reload browser', action(server) { - server.hot.send({ + server.ws.send({ type: 'full-reload', path: '*', }); @@ -433,7 +433,7 @@ async function handleUpdate( if (serverOptions.liveReload || serverOptions.hmr) { if (updatedFiles.every((f) => f.endsWith('.css'))) { const timestamp = Date.now(); - server.hot.send({ + server.ws.send({ type: 'update', updates: updatedFiles.flatMap((filePath) => { // For component styles, an HMR update must be sent for each one with the corresponding @@ -468,7 +468,7 @@ async function handleUpdate( // Send reload command to clients if (serverOptions.liveReload) { - server.hot.send({ + server.ws.send({ type: 'full-reload', path: '*', });
320d7526987b51919f9cc6b42f75bed38f8243ba
2021-07-22 04:30:40
Joey Perrott
docs: release notes for the v12.1.3 release
false
release notes for the v12.1.3 release
docs
diff --git a/CHANGELOG.md b/CHANGELOG.md index 08b777b7838a..0a64525b600d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +<a name="12.1.3"></a> + +# 12.1.3 (2021-07-21) + +### @angular/cli + +| Commit | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| [eaa2378b6](https://github.com/angular/angular-cli/commit/eaa2378b6bc69a2485cce742ef95b0b94ae994c6) | fix(@angular/cli): handle `YARN_` environment variables during `ng update` and `ng add` | +| [4b9a41bde](https://github.com/angular/angular-cli/commit/4b9a41bdedcdc4e115e8956d31126c5bf6f442ca) | fix(@angular/cli): handle NPM_CONFIG environment variables during ng update and ng add | + +### @angular-devkit/build-angular + +| Commit | Description | +| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| [04e9ffe4f](https://github.com/angular/angular-cli/commit/04e9ffe4f6b262ce5ef630310bed318e1466d238) | fix(@angular-devkit/build-angular): allow classes with pure annotated static properties to be optimized | +| [6ae17e265](https://github.com/angular/angular-cli/commit/6ae17e26547a0174f7a8910c514016db60fe4c7a) | fix(@angular-devkit/build-angular): dasherize disable-host-check suggestion | + +## Special Thanks: + +Alan Agius, Charles Lyding, Joey Perrott, LeonEck and Mike Jancar + <a name="v12.2.0-next.2"></a> # v12.2.0-next.2 (2021-07-14)
8a2b48c02034849a9dd421f682b81c89526425c7
2017-03-21 05:37:19
Stephen Cavaliere
fix(@angular/cli): update warning message when @angular/cli not found in devDependencies
false
update warning message when @angular/cli not found in devDependencies
fix
diff --git a/packages/@angular/cli/bin/ng b/packages/@angular/cli/bin/ng index ee45c6a93e08..4520b80193c0 100755 --- a/packages/@angular/cli/bin/ng +++ b/packages/@angular/cli/bin/ng @@ -94,22 +94,33 @@ if (packageJsonProjectPath && fs.existsSync(packageJsonProjectPath)) { const deps = packageJsonProject['dependencies'] || {}; const devDeps = packageJsonProject['devDependencies'] || {}; const hasOldDep = !!deps['angular-cli']; + const hasDep = !!deps['@angular/cli']; const hasOldDevDep = !!devDeps['angular-cli']; const hasDevDep = !!devDeps['@angular/cli']; - if (hasOldDep || hasOldDevDep || !hasDevDep) { + if (hasOldDep || hasOldDevDep || !hasDevDep || !hasDep) { const warnings = [ - 'The package "angular-cli" has been renamed to "@angular/cli". The old package will be ' - + 'deprecated soon.', - '', - 'Please take the following steps to avoid issues:' + 'Unable to find "@angular/cli" in devDependencies.', + '' ]; + + if (hasOldDep || hasOldDevDep) { + warnings.push( + 'The package "angular-cli" has been deprecated and renamed to "@angular/cli".', + ''); + } + + warnings.push('Please take the following steps to avoid issues:'); + if (hasOldDep) { warnings.push('"npm uninstall --save angular-cli"'); } if (hasOldDevDep) { warnings.push('"npm uninstall --save-dev angular-cli"'); } + if (hasDep) { + warnings.push('"npm uninstall --save @angular/cli"') + } if (!hasDevDep) { warnings.push('"npm install --save-dev @angular/cli@latest"'); } @@ -148,7 +159,7 @@ resolve('@angular/cli', { basedir: process.cwd() }, console.log(yellow(stripIndents` Your global Angular CLI version (${globalVersion}) is greater than your local version (${localVersion}). The local Angular CLI version is used. - + To disable this warning use "ng set --global warnings.versionMismatch=false". `)); }
755fb6f1cdd1a390f774fb4cd35b8678ad1372d1
2016-03-21 02:15:22
gdi2290
fix(polyfills): remove ie-shim
false
remove ie-shim
fix
diff --git a/modules/polyfills/src/polyfills-node.ts b/modules/polyfills/src/polyfills-node.ts index 4c655f5f29b0..1029c5a71a9d 100644 --- a/modules/polyfills/src/polyfills-node.ts +++ b/modules/polyfills/src/polyfills-node.ts @@ -1,7 +1,6 @@ // polyfills import 'es6-promise'; import 'es6-shim'; -import 'ie-shim'; // typescript emit metadata import 'reflect-metadata'; // zone.js to track promises diff --git a/modules/universal/package.json b/modules/universal/package.json index 8f9fe2bf2b96..3e341adae42c 100644 --- a/modules/universal/package.json +++ b/modules/universal/package.json @@ -1,6 +1,6 @@ { "name": "angular2-universal-preview", - "version": "0.80.0", + "version": "0.81.0", "description": "Universal (isomorphic) javascript support for Angular2", "homepage": "https://github.com/angular/universal", "license": "MIT", @@ -25,7 +25,7 @@ "mock.js" ], "scripts": { - "remove-modules": "rm -rf dist node_modules/angular2-universal-preview node_modules/angular2-express-engine node_modules/preboot node_modules/angular2-hapi-engine", + "remove-modules": "rm -rf node_modules/angular2-universal-preview node_modules/angular2-universal node_modules/angular2-express-engine node_modules/preboot node_modules/angular2-hapi-engine node_modules/angular2-universal-polyfills", "reload": "npm run remove-modules && npm install", "prebuild": "rm -rf dist", "build": "tsc || true", @@ -33,20 +33,22 @@ }, "devDependencies": { "angular2-universal-preview": "file:.", + "angular2-universal-polyfills": "file:../polyfills", "angular2-express-engine": "file:../express-engine", "angular2-hapi-engine": "file:../hapi-engine", - "angular2": "2.0.0-beta.10", + "angular2": "2.0.0-beta.11", "preboot": "file:../preboot", "zone.js": "~0.6.4", - "es6-shim": "^0.33.3", + "es6-shim": "^0.35.0", "es6-promise": "^3.0.2", "reflect-metadata": "0.1.2", - "typescript": "^1.8.7", + "typescript": "~1.8.9", "rxjs": "~5.0.0-beta.2", "css": "^2.2.1", "parse5": "^1.5.0" }, "dependencies": { + "angular2-universal-polyfills": "~0.1.1", "angular2-express-engine": "*", "angular2-hapi-engine": "*", "xhr2": "^0.1.3", @@ -54,14 +56,11 @@ "parse5": "^1.5.0" }, "peerDependencies": { - "es6-promise": "^3.0.2", - "reflect-metadata": "0.1.2", - "preboot": ">=1.1.0", - "angular2-express-engine": ">=0.5.5", - "angular2-hapi-engine": ">=0.5.1", + "preboot": ">=2.0.4", + "angular2-express-engine": ">=0.6.1", + "angular2-hapi-engine": ">=0.5.2", "rxjs": "~5.0.0-beta.2", "angular2": "2.0.0-beta.8 - 2.0.0-beta.11", - "es6-shim": "^0.33.3", "zone.js": "0.5.15 - 0.6.5", "css": "^2.2.1", "parse5": "^1.5.0"
192bf876b7d5d236493056bad8d92e4e26c10e72
2016-05-12 09:43:59
Jeff Cross
test(config): disable config spec
false
disable config spec
test
diff --git a/tests/models/config.spec.ts b/tests/models/config.spec.ts index 1825584f8e10..d9a78da3c921 100644 --- a/tests/models/config.spec.ts +++ b/tests/models/config.spec.ts @@ -10,7 +10,8 @@ function getContents() { return require(configCopy); } -describe('Config Tests', () => { +// TODO: revisit this test to make non-valid-JSON-friendly. +describe.skip('Config Tests', () => { before(() => { process.chdir(process.cwd()); }); @@ -73,7 +74,7 @@ describe('Config Tests', () => { it('Throws an error if try to use `number` on property of type `string`', () => { let c = new CliConfig(configCopy); - + let fn = () => { c.set('project.name', 42); c.save();
a52fc53f0461c506c436b3a0450a2ba2984f8811
2019-01-15 00:36:54
cexbrayat
feat(@schematics/angular): activate recommended tslint rules
false
activate recommended tslint rules
feat
diff --git a/packages/schematics/angular/workspace/files/tslint.json b/packages/schematics/angular/workspace/files/tslint.json index 91c17188f18d..868ecba0db1b 100644 --- a/packages/schematics/angular/workspace/files/tslint.json +++ b/packages/schematics/angular/workspace/files/tslint.json @@ -4,21 +4,16 @@ "codelyzer" ], "rules": { - "adjacent-overload-signatures": false, - "align": false, "array-type": false, "arrow-parens": false, - "ban-types": false, "deprecation": { "severity": "warn" }, - "function-constructor": false, "import-blacklist": [ true, "rxjs/Rx" ], "interface-name": false, - "jsdoc-format": false, "max-classes-per-file": false, "max-line-length": [ true, @@ -36,9 +31,6 @@ ] } ], - "new-parens": false, - "no-angle-bracket-type-assertion": false, - "no-conditional-assignment": false, "no-consecutive-blank-lines": false, "no-console": [ true, @@ -53,56 +45,22 @@ true, "ignore-params" ], - "no-namespace": false, "no-non-null-assertion": true, "no-redundant-jsdoc": true, - "no-reference": false, - "no-reference-import": false, - "no-string-literal": false, "no-switch-case-fall-through": true, - "no-unsafe-finally": false, "no-use-before-declare": true, "no-var-requires": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "object-literal-sort-keys": false, - "one-line": [ + "object-literal-key-quotes": [ true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" + "as-needed" ], - "one-variable-per-declaration": false, - "only-arrow-functions": false, + "object-literal-sort-keys": false, "ordered-imports": false, - "prefer-for-of": false, "quotemark": [ true, "single" ], - "space-before-function-paren": false, "trailing-comma": false, - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "use-isnan": false, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], "no-output-on-prefix": true, "use-input-property-decorator": true, "use-output-property-decorator": true,
7fd02e814060f3397b840e26269ae717152f7e61
2018-02-28 23:23:37
Charles Lyding
fix(@angular/cli): disable webpack performance hints
false
disable webpack performance hints
fix
diff --git a/packages/@angular/cli/models/webpack-configs/common.ts b/packages/@angular/cli/models/webpack-configs/common.ts index d7d6f66cb08b..a2974fbc6d7c 100644 --- a/packages/@angular/cli/models/webpack-configs/common.ts +++ b/packages/@angular/cli/models/webpack-configs/common.ts @@ -218,6 +218,9 @@ export function getCommonConfig(wco: WebpackConfigOptions) { publicPath: buildOptions.deployUrl, filename: `[name]${hashFormat.chunk}.js`, }, + performance: { + hints: false, + }, module: { rules: [ { test: /\.html$/, loader: 'raw-loader' },
78d48be9d3ff777326d8e85381b921da4651bd6e
2018-02-22 01:06:42
Yaroslav Admin
fix(@angular/cli): shut down after first Ctrl+C received
false
shut down after first Ctrl+C received
fix
diff --git a/packages/@ngtools/webpack/src/angular_compiler_plugin.ts b/packages/@ngtools/webpack/src/angular_compiler_plugin.ts index bbf2fb0aa481..92d6ce699cd5 100644 --- a/packages/@ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/@ngtools/webpack/src/angular_compiler_plugin.ts @@ -507,28 +507,24 @@ export class AngularCompilerPlugin implements Tapable { forkOptions); // Handle child process exit. - const handleChildProcessExit = () => { - this._killForkedTypeChecker(); - const msg = 'AngularCompilerPlugin: Forked Type Checker exited unexpectedly. ' + - 'Falling back to type checking on main thread.'; - this._warnings.push(msg); - }; - this._typeCheckerProcess.once('exit', handleChildProcessExit); - this._typeCheckerProcess.once('SIGINT', handleChildProcessExit); - this._typeCheckerProcess.once('uncaughtException', handleChildProcessExit); - - // Handle parent process exit. - const handleParentProcessExit = () => this._killForkedTypeChecker(); - process.once('exit', handleParentProcessExit); - process.once('SIGINT', handleParentProcessExit); - process.once('uncaughtException', handleParentProcessExit); + this._typeCheckerProcess.once('exit', (_, signal) => { + this._typeCheckerProcess = undefined; + + // If process exited not because of SIGTERM (see _killForkedTypeChecker), than something + // went wrong and it should fallback to type checking on the main thread. + if (signal !== 'SIGTERM') { + this._forkTypeChecker = false; + const msg = 'AngularCompilerPlugin: Forked Type Checker exited unexpectedly. ' + + 'Falling back to type checking on main thread.'; + this._warnings.push(msg); + } + }); } private _killForkedTypeChecker() { if (this._typeCheckerProcess && this._typeCheckerProcess.pid) { treeKill(this._typeCheckerProcess.pid, 'SIGTERM'); this._typeCheckerProcess = undefined; - this._forkTypeChecker = false; } }
636ff36b3a1789be392698f254d91a80d854f6ea
2019-04-23 20:37:56
Alan Agius
feat(@schematics/angular): update scaffolding rxjs version to 6.5.1
false
update scaffolding rxjs version to 6.5.1
feat
diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 912cd82eb6a6..e4d4aa1b725b 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -9,7 +9,7 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. Angular: '~8.0.0-beta.12', - RxJs: '~6.4.0', + RxJs: '~6.5.1', ZoneJs: '~0.9.0', TypeScript: '~3.4.3', TsLib: '^1.9.0',
28b6f6826adc0b3c9a2829919ae6338e10674077
2016-09-01 11:37:27
PatrickJS
chore(examples): include IDs
false
include IDs
chore
diff --git a/examples/hello-world/src/main.node.ts b/examples/hello-world/src/main.node.ts index 4561f693c2ae..c45003f32fc7 100644 --- a/examples/hello-world/src/main.node.ts +++ b/examples/hello-world/src/main.node.ts @@ -17,7 +17,10 @@ class AnotherComponent {} export const platform = platformDynamicNode(); +var count = 0; export function main(document, config?: any) { + count++ + console.time('ngApp '+ count) @NgModule({ bootstrap: [ App, AnotherComponent ], @@ -57,6 +60,7 @@ export function main(document, config?: any) { return platform .serializeModule(MainModule, config) .then((html) => { + console.timeEnd('ngApp ' + count) console.log('\n -- serializeModule FINISHED --'); return html; }); diff --git a/examples/hello-world/src/server-express.ts b/examples/hello-world/src/server-express.ts index 7e98bb9c3695..cd18a82d0f1b 100644 --- a/examples/hello-world/src/server-express.ts +++ b/examples/hello-world/src/server-express.ts @@ -61,8 +61,7 @@ app.get('/', function (req, res, next) { </html> `; - return ngApp(documentHtml).then(html => { - // console.log(html); + return ngApp(documentHtml, {time: true}).then(html => { res.status(200).send(html); next(); return html; diff --git a/modules/platform-node/node-platform.ts b/modules/platform-node/node-platform.ts index 860bed6befaa..f841b4747fc5 100644 --- a/modules/platform-node/node-platform.ts +++ b/modules/platform-node/node-platform.ts @@ -94,6 +94,10 @@ export function _resolveDefaultAnimationDriver(): AnimationDriver { // Hold Reference export var __PLATFORM_REF: PlatformRef = null; +function s4() { + return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); +} + export class NodePlatform implements PlatformRef { static _noop = () => {}; static _cache = new Map<any, any>(); @@ -108,6 +112,10 @@ export class NodePlatform implements PlatformRef { serializeModule<T>(moduleType: any, config: any = {}) { + if (config && !config.id) { + config.id = s4(); + } + // TODO(gdi2290): make stateless. allow for many instances of modules // TODO(gdi2290): refactor to ZoneLocalStore var _map = new Map<any, any>(); @@ -124,17 +132,17 @@ export class NodePlatform implements PlatformRef { } }; - config.time && console.time('bootstrapModule: ' + config.id); + config.time && console.time('id: ' + config.id + ' bootstrapModule: '); return this.platformRef.bootstrapModule<T>(moduleType, config.compilerOptions) .then((moduleRef: NgModuleRef<T>) => { - config.time && console.timeEnd('bootstrapModule: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' bootstrapModule: '); let modInjector = moduleRef.injector; let instance: any = moduleRef.instance; // lifecycle hooks - di.set('ngOnInit', instance.ngOnInit, NodePlatform._noop); - di.set('ngDoCheck', instance.ngDoCheck, NodePlatform._noop); - di.set('ngOnStable', instance.ngOnStable, NodePlatform._noop); - di.set('ngOnRendered', instance.ngOnRendered, NodePlatform._noop); + di.set('universalOnInit', instance.universalOnInit, NodePlatform._noop); + di.set('universalDoCheck', instance.universalDoCheck, NodePlatform._noop); + di.set('universalOnStable', instance.universalOnStable, NodePlatform._noop); + di.set('universalOnRendered', instance.universalOnRendered, NodePlatform._noop); // global config di.set('config', modInjector.get(UNIVERSAL_CONFIG, {})); di.set('ApplicationRef', modInjector.get(ApplicationRef)); @@ -146,15 +154,15 @@ export class NodePlatform implements PlatformRef { return moduleRef; }) .then((moduleRef: NgModuleRef<T>) => { - config.time && console.time('stable: ' + config.id); + config.time && console.time('id: ' + config.id + ' stable: '); let _config = di.get('config'); - let ngDoCheck = di.get('ngDoCheck'); - let ngOnInit = di.get('ngOnInit'); + let universalDoCheck = di.get('universalDoCheck'); + let universalOnInit = di.get('universalOnInit'); let rootNgZone = di.get('NgZone'); let appRef = di.get('ApplicationRef'); let components = appRef.components; - ngOnInit(); + universalOnInit(); // lifecycle hooks function outsideNg(compRef, ngZone, config, http, jsonp) { @@ -167,10 +175,10 @@ export class NodePlatform implements PlatformRef { if (http && http._async > 0) { return checkStable(done, ref); } if (jsonp && jsonp._async > 0) { return checkStable(done, ref); } if (ngZone.isStable === true) { - let isStable = ngDoCheck(ref, ngZone, config); - if (ngDoCheck !== NodePlatform._noop) { + let isStable = universalDoCheck(ref, ngZone, config); + if (universalDoCheck !== NodePlatform._noop) { if (typeof isStable !== 'boolean') { - console.warn('\nWARNING: ngDoCheck must return a boolean value of either true or false\n'); + console.warn('\nWARNING: universalDoCheck must return a boolean value of either true or false\n'); } else if (isStable !== true) { return checkStable(done, ref); } @@ -203,12 +211,12 @@ export class NodePlatform implements PlatformRef { return Promise.all<Promise<ComponentRef<any>>>(stableComponents); }) .then(() => { - config.time && console.timeEnd('stable: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' stable: '); return moduleRef; }); }) .then((moduleRef: NgModuleRef<T>) => { - config.time && console.time('preboot: ' + config.id); + config.time && console.time('id: ' + config.id + ' preboot: '); // parseFragment used // getInlineCode used let DOM = di.get('DOM'); @@ -226,7 +234,7 @@ export class NodePlatform implements PlatformRef { prebootEl = NodePlatform._cache.get(key).prebootEl; // prebootCode = NodePlatform._cache.get(key); } else if (key && !prebootEl) { - config.time && console.time('preboot insert: ' + config.id); + config.time && console.time('id: ' + config.id + ' preboot insert: '); prebootCode = parseFragment('' + '<script>\n' + getInlineCode(_config.preboot) + @@ -238,7 +246,7 @@ export class NodePlatform implements PlatformRef { DOM.appendChild(prebootEl, prebootCode.childNodes[i]); } NodePlatform._cache.set(key, {prebootCode, prebootEl}); - config.time && console.timeEnd('preboot insert: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' preboot insert: '); } // else { // prebootCode = getInlineCode(_config.preboot); @@ -252,17 +260,17 @@ export class NodePlatform implements PlatformRef { } catch (e) { console.log(e); // if there's an error don't inject preboot - config.time && console.timeEnd('preboot: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' preboot: '); return moduleRef; } - config.time && console.timeEnd('preboot: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' preboot: '); return moduleRef; }) .then((moduleRef: NgModuleRef<T>) => { - config.time && console.time('serialize: ' + config.id); + config.time && console.time('id: ' + config.id + ' serialize: '); // serializeDocument used - let ngOnRendered = di.get('ngOnRendered'); + let universalOnRendered = di.get('universalOnRendered'); let document = di.get('DOCUMENT'); let appRef = di.get('ApplicationRef'); let _appId = di.get('APP_ID', null); @@ -281,10 +289,10 @@ export class NodePlatform implements PlatformRef { appRef = null; moduleRef = null; di.clear(); - config.time && console.timeEnd('serialize: ' + config.id); + config.time && console.timeEnd('id: ' + config.id + ' serialize: '); html = html.replace(new RegExp(_appId, 'gi'), appId); - ngOnRendered(html); + universalOnRendered(html); return html; });
b611e7fc58805c0b8e793ec6c5828f9651157a19
2019-02-14 04:50:41
hrocha16
fix(@angular-devkit/build-angular): added warning for ES2017
false
added warning for ES2017
fix
diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts index 372a5e05e330..1a40ab83023f 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts @@ -5,6 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ +import { tags } from '@angular-devkit/core'; import * as CopyWebpackPlugin from 'copy-webpack-plugin'; import * as path from 'path'; import { HashedModuleIdsPlugin, debug } from 'webpack'; @@ -272,6 +273,14 @@ export function getCommonConfig(wco: WebpackConfigOptions) { ); } + if (wco.tsConfig.options.target === 4) { + wco.logger.warn(tags.stripIndent` + WARNING: Zone.js does not support native async/await in ES2017. + These blocks are not intercepted by zone.js and will not triggering change detection. + See: https://github.com/angular/zone.js/pull/1140 for more information. + `); + } + return { mode: scriptsOptimization || stylesOptimization ? 'production'
7229a3d31d4d1934cb13883cce32dfd1cac5d0d1
2023-10-24 04:24:18
Charles Lyding
fix(@angular-devkit/build-angular): use component style load result caching information for file watching
false
use component style load result caching information for file watching
fix
diff --git a/packages/angular_devkit/build_angular/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts b/packages/angular_devkit/build_angular/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts new file mode 100644 index 000000000000..a0958bb13eea --- /dev/null +++ b/packages/angular_devkit/build_angular/src/builders/application/tests/behavior/rebuild-component_styles_spec.ts @@ -0,0 +1,77 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { concatMap, count, timeout } from 'rxjs'; +import { buildApplication } from '../../index'; +import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setup'; + +/** + * Maximum time in milliseconds for single build/rebuild + * This accounts for CI variability. + */ +export const BUILD_TIMEOUT = 30_000; + +describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { + describe('Behavior: "Rebuilds when component stylesheets change"', () => { + it('updates component when imported sass changes', async () => { + harness.useTarget('build', { + ...BASE_OPTIONS, + watch: true, + }); + + await harness.modifyFile('src/app/app.component.ts', (content) => + content.replace('app.component.css', 'app.component.scss'), + ); + await harness.writeFile('src/app/app.component.scss', "@import './a';"); + await harness.writeFile('src/app/a.scss', '$primary: aqua;\\nh1 { color: $primary; }'); + + const builderAbort = new AbortController(); + const buildCount = await harness + .execute({ signal: builderAbort.signal }) + .pipe( + timeout(30000), + concatMap(async ({ result }, index) => { + expect(result?.success).toBe(true); + + switch (index) { + case 0: + harness.expectFile('dist/browser/main.js').content.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); + + await harness.writeFile( + 'src/app/a.scss', + '$primary: blue;\\nh1 { color: $primary; }', + ); + break; + case 1: + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.toContain('color: blue'); + + await harness.writeFile( + 'src/app/a.scss', + '$primary: green;\\nh1 { color: $primary; }', + ); + break; + case 2: + harness.expectFile('dist/browser/main.js').content.not.toContain('color: aqua'); + harness.expectFile('dist/browser/main.js').content.not.toContain('color: blue'); + harness.expectFile('dist/browser/main.js').content.toContain('color: green'); + + // Test complete - abort watch mode + builderAbort.abort(); + break; + } + }), + count(), + ) + .toPromise(); + + expect(buildCount).toBe(3); + }); + }); +}); diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts index 935ebd72f34f..c5f15b406ddb 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts @@ -98,7 +98,6 @@ export function createCompilerPlugin( const stylesheetBundler = new ComponentStylesheetBundler( styleOptions, pluginOptions.incremental, - pluginOptions.loadResultCache, ); let sharedTSCompilationState: SharedTSCompilationState | undefined; @@ -131,6 +130,7 @@ export function createCompilerPlugin( // TODO: Differentiate between changed input files and stale output files modifiedFiles = referencedFileTracker.update(pluginOptions.sourceFileCache.modifiedFiles); pluginOptions.sourceFileCache.invalidate(modifiedFiles); + stylesheetBundler.invalidate(modifiedFiles); } if ( diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts index 849f1a5b0cde..5a85646c9ce2 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/component-stylesheets.ts @@ -10,7 +10,6 @@ import { OutputFile } from 'esbuild'; import { createHash } from 'node:crypto'; import path from 'node:path'; import { BuildOutputFileType, BundleContextResult, BundlerContext } from '../bundler-context'; -import { LoadResultCache } from '../load-result-cache'; import { BundleStylesheetOptions, createStylesheetBundleOptions, @@ -46,15 +45,16 @@ export class ComponentStylesheetBundler { constructor( private readonly options: BundleStylesheetOptions, private readonly incremental: boolean, - private readonly cache?: LoadResultCache, ) {} async bundleFile(entry: string) { const bundlerContext = this.#fileContexts.getOrCreate(entry, () => { - const buildOptions = createStylesheetBundleOptions(this.options, this.cache); - buildOptions.entryPoints = [entry]; + return new BundlerContext(this.options.workspaceRoot, this.incremental, (loadCache) => { + const buildOptions = createStylesheetBundleOptions(this.options, loadCache); + buildOptions.entryPoints = [entry]; - return new BundlerContext(this.options.workspaceRoot, this.incremental, buildOptions); + return buildOptions; + }); }); return extractResult(await bundlerContext.bundle(), bundlerContext.watchFiles); @@ -69,40 +69,56 @@ export class ComponentStylesheetBundler { const bundlerContext = this.#inlineContexts.getOrCreate(entry, () => { const namespace = 'angular:styles/component'; - const buildOptions = createStylesheetBundleOptions(this.options, this.cache, { - [entry]: data, - }); - buildOptions.entryPoints = [`${namespace};${entry}`]; - buildOptions.plugins.push({ - name: 'angular-component-styles', - setup(build) { - build.onResolve({ filter: /^angular:styles\/component;/ }, (args) => { - if (args.kind !== 'entry-point') { - return null; - } - - return { - path: entry, - namespace, - }; - }); - build.onLoad({ filter: /^css;/, namespace }, async () => { - return { - contents: data, - loader: 'css', - resolveDir: path.dirname(filename), - }; - }); - }, - }); - return new BundlerContext(this.options.workspaceRoot, this.incremental, buildOptions); + return new BundlerContext(this.options.workspaceRoot, this.incremental, (loadCache) => { + const buildOptions = createStylesheetBundleOptions(this.options, loadCache, { + [entry]: data, + }); + buildOptions.entryPoints = [`${namespace};${entry}`]; + buildOptions.plugins.push({ + name: 'angular-component-styles', + setup(build) { + build.onResolve({ filter: /^angular:styles\/component;/ }, (args) => { + if (args.kind !== 'entry-point') { + return null; + } + + return { + path: entry, + namespace, + }; + }); + build.onLoad({ filter: /^css;/, namespace }, async () => { + return { + contents: data, + loader: 'css', + resolveDir: path.dirname(filename), + }; + }); + }, + }); + + return buildOptions; + }); }); // Extract the result of the bundling from the output files return extractResult(await bundlerContext.bundle(), bundlerContext.watchFiles); } + invalidate(files: Iterable<string>) { + if (!this.incremental) { + return; + } + + for (const bundler of this.#fileContexts.values()) { + bundler.invalidate(files); + } + for (const bundler of this.#inlineContexts.values()) { + bundler.invalidate(files); + } + } + async dispose(): Promise<void> { const contexts = [...this.#fileContexts.values(), ...this.#inlineContexts.values()]; this.#fileContexts.clear(); diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts index ba7a2bc457b8..ef0d8f76aaf2 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts @@ -17,6 +17,7 @@ import { context, } from 'esbuild'; import { basename, dirname, extname, join, relative } from 'node:path'; +import { LoadResultCache, MemoryLoadResultCache } from './load-result-cache'; import { convertOutputFile } from './utils'; export type BundleContextResult = @@ -49,6 +50,10 @@ export interface BuildOutputFile extends OutputFile { clone: () => BuildOutputFile; } +export type BundlerOptionsFactory<T extends BuildOptions = BuildOptions> = ( + loadCache: LoadResultCache | undefined, +) => T; + /** * Determines if an unknown value is an esbuild BuildFailure error object thrown by esbuild. * @param value A potential esbuild BuildFailure error object. @@ -60,20 +65,26 @@ function isEsBuildFailure(value: unknown): value is BuildFailure { export class BundlerContext { #esbuildContext?: BuildContext<{ metafile: true; write: false }>; - #esbuildOptions: BuildOptions & { metafile: true; write: false }; + #esbuildOptions?: BuildOptions & { metafile: true; write: false }; + #optionsFactory: BundlerOptionsFactory<BuildOptions & { metafile: true; write: false }>; + #loadCache?: MemoryLoadResultCache; readonly watchFiles = new Set<string>(); constructor( private workspaceRoot: string, private incremental: boolean, - options: BuildOptions, + options: BuildOptions | BundlerOptionsFactory, private initialFilter?: (initial: Readonly<InitialFileRecord>) => boolean, ) { - this.#esbuildOptions = { - ...options, - metafile: true, - write: false, + this.#optionsFactory = (...args) => { + const baseOptions = typeof options === 'function' ? options(...args) : options; + + return { + ...baseOptions, + metafile: true, + write: false, + }; }; } @@ -131,6 +142,14 @@ export class BundlerContext { * warnings and errors for the attempted build. */ async bundle(): Promise<BundleContextResult> { + // Create esbuild options if not present + if (this.#esbuildOptions === undefined) { + if (this.incremental) { + this.#loadCache = new MemoryLoadResultCache(); + } + this.#esbuildOptions = this.#optionsFactory(this.#loadCache); + } + let result; try { if (this.#esbuildContext) { @@ -162,7 +181,15 @@ export class BundlerContext { // Add input files except virtual angular files which do not exist on disk Object.keys(result.metafile.inputs) .filter((input) => !input.startsWith('angular:')) + // input file paths are always relative to the workspace root .forEach((input) => this.watchFiles.add(join(this.workspaceRoot, input))); + // Also add any files from the load result cache + if (this.#loadCache) { + this.#loadCache.watchFiles + .filter((file) => !file.startsWith('angular:')) + // watch files are fully resolved paths + .forEach((file) => this.watchFiles.add(file)); + } } // Return if the build encountered any errors @@ -254,6 +281,24 @@ export class BundlerContext { }; } + invalidate(files: Iterable<string>): boolean { + if (!this.incremental) { + return false; + } + + let invalid = false; + for (const file of files) { + if (this.#loadCache?.invalidate(file)) { + invalid = true; + continue; + } + + invalid ||= this.watchFiles.has(file); + } + + return invalid; + } + /** * Disposes incremental build resources present in the context. * @@ -261,7 +306,9 @@ export class BundlerContext { */ async dispose(): Promise<void> { try { - return this.#esbuildContext?.dispose(); + this.#esbuildOptions = undefined; + this.#loadCache = undefined; + await this.#esbuildContext?.dispose(); } finally { this.#esbuildContext = undefined; } diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/load-result-cache.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/load-result-cache.ts index dd80342c270b..987aea40caf1 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/load-result-cache.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/load-result-cache.ts @@ -12,6 +12,7 @@ import { normalize } from 'node:path'; export interface LoadResultCache { get(path: string): OnLoadResult | undefined; put(path: string, result: OnLoadResult): Promise<void>; + readonly watchFiles: ReadonlyArray<string>; } export function createCachedLoad( @@ -76,4 +77,8 @@ export class MemoryLoadResultCache implements LoadResultCache { return found; } + + get watchFiles(): string[] { + return [...this.#loadResults.keys(), ...this.#fileDependencies.keys()]; + } }
334ec0f363e7defba8c848d281471374bea561d5
2025-01-22 01:38:07
Alan Agius
fix(@angular/build): only issue invalid i18n config error for duplicate `subPaths` with inlined locales
false
only issue invalid i18n config error for duplicate `subPaths` with inlined locales
fix
diff --git a/packages/angular/build/src/utils/i18n-options.ts b/packages/angular/build/src/utils/i18n-options.ts index dc80bf8cc1d7..822683bef03d 100644 --- a/packages/angular/build/src/utils/i18n-options.ts +++ b/packages/angular/build/src/utils/i18n-options.ts @@ -199,8 +199,24 @@ export function createI18nOptions( } } - // Check that subPaths are unique. - const localesData = Object.entries(i18n.locales); + if (inline === true) { + i18n.inlineLocales.add(i18n.sourceLocale); + Object.keys(i18n.locales).forEach((locale) => i18n.inlineLocales.add(locale)); + } else if (inline) { + for (const locale of inline) { + if (!i18n.locales[locale] && i18n.sourceLocale !== locale) { + throw new Error(`Requested locale '${locale}' is not defined for the project.`); + } + + i18n.inlineLocales.add(locale); + } + } + + // Check that subPaths are unique only the locales that we are inlining. + const localesData = Object.entries(i18n.locales).filter(([locale]) => + i18n.inlineLocales.has(locale), + ); + for (let i = 0; i < localesData.length; i++) { const [localeA, { subPath: subPathA }] = localesData[i]; @@ -215,19 +231,6 @@ export function createI18nOptions( } } - if (inline === true) { - i18n.inlineLocales.add(i18n.sourceLocale); - Object.keys(i18n.locales).forEach((locale) => i18n.inlineLocales.add(locale)); - } else if (inline) { - for (const locale of inline) { - if (!i18n.locales[locale] && i18n.sourceLocale !== locale) { - throw new Error(`Requested locale '${locale}' is not defined for the project.`); - } - - i18n.inlineLocales.add(locale); - } - } - return i18n; }
452907efdb3d3aceaae2135d64194911f1b92afc
2020-02-28 00:52:15
Renovate Bot
build: update @types/find-cache-dir to version ^3.0.0
false
update @types/find-cache-dir to version ^3.0.0
build
diff --git a/package.json b/package.json index 944669c85aae..bb5b6ddd5c49 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@types/cssnano": "^4.0.0", "@types/debug": "^4.1.2", "@types/express": "^4.16.0", - "@types/find-cache-dir": "^2.0.0", + "@types/find-cache-dir": "^3.0.0", "@types/glob": "^7.0.3", "@types/inquirer": "^0.0.44", "@types/jasmine": "~3.5.0", diff --git a/yarn.lock b/yarn.lock index 01d2bd9f5f58..fa1aee41a517 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1208,10 +1208,10 @@ "@types/express-serve-static-core" "*" "@types/serve-static" "*" -"@types/find-cache-dir@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-2.0.0.tgz#6ee79b947b8e51ce8c565fc8278822b2605609db" - integrity sha512-LHAReDNv7IVTE2Q+nPcRBgUZAUKPJIvR7efMrWgx69442KMoMK+QYjtTtK9WGUdaqUYVLkd/0cvCfb55LFWsVw== +"@types/find-cache-dir@^3.0.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-3.2.0.tgz#eaaf331699dccf52c47926e4d4f8f3ed8db33f3c" + integrity sha512-+JeT9qb2Jwzw72WdjU+TSvD5O1QRPWCeRpDJV+guiIq+2hwR0DFGw+nZNbTFjMIVe6Bf4GgAKeB/6Ytx6+MbeQ== "@types/glob@*", "@types/glob@^7.0.3", "@types/glob@^7.1.1": version "7.1.1"
538bb187c5ba358ce7e3fc6e4712e10c96552fcd
2021-01-12 13:58:34
Renovate Bot
build: update sass to version 1.32.4
false
update sass to version 1.32.4
build
diff --git a/package.json b/package.json index 4821bb062e6f..92242bfc7fd8 100644 --- a/package.json +++ b/package.json @@ -202,7 +202,7 @@ "rimraf": "3.0.2", "rollup": "2.36.1", "rxjs": "6.6.3", - "sass": "1.32.2", + "sass": "1.32.4", "sass-loader": "10.1.0", "sauce-connect-proxy": "https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz", "semver": "7.3.4", diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index fe4cf9480566..e55e16c86d87 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -56,7 +56,7 @@ "rimraf": "3.0.2", "rollup": "2.36.1", "rxjs": "6.6.3", - "sass": "1.32.2", + "sass": "1.32.4", "sass-loader": "10.1.0", "semver": "7.3.4", "source-map": "0.7.3", diff --git a/yarn.lock b/yarn.lock index f4154d4052b7..5aa4a145ec5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10457,7 +10457,14 @@ [email protected]: schema-utils "^3.0.0" semver "^7.3.2" [email protected], sass@^1.23.0: [email protected]: + version "1.32.4" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.4.tgz#308bf29dd7f53d44ae4f06580e9a910ad9aa411e" + integrity sha512-N0BT0PI/t3+gD8jKa83zJJUb7ssfQnRRfqN+GIErokW6U4guBpfYl8qYB+OFLEho+QvnV5ZH1R9qhUC/Z2Ch9w== + dependencies: + chokidar ">=2.0.0 <4.0.0" + +sass@^1.23.0: version "1.32.2" resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.2.tgz#66dc0250bc86c15d19ddee7135e93d0cf3d3257b" integrity sha512-u1pUuzqwz3SAgvHSWp1k0mRhX82b2DdlVnP6UIetQPZtYbuJUDaPQhZE12jyjB7vYeOScfz9WPsZJB6Rpk7heA==
846725536a4543e01223862dd0d0d83c727407bc
2016-05-04 21:18:05
Hans
chore: fix issues. (#627)
false
fix issues. (#627)
chore
diff --git a/addon/ng2/blueprints/ng2/files/__path__/main.ts b/addon/ng2/blueprints/ng2/files/__path__/main.ts index 397104953cf9..3d11825cb61c 100644 --- a/addon/ng2/blueprints/ng2/files/__path__/main.ts +++ b/addon/ng2/blueprints/ng2/files/__path__/main.ts @@ -1,6 +1,6 @@ -import {bootstrap} from '@angular/platform-browser-dynamic'; -import {enableProdMode} from '@angular/core'; -import {<%= jsComponentName %>AppComponent, environment} from './app/'; +import { bootstrap } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from '@angular/core'; +import { <%= jsComponentName %>AppComponent, environment } from './app/'; if (environment.production) { enableProdMode(); diff --git a/addon/ng2/blueprints/ng2/files/__path__/system-config.ts b/addon/ng2/blueprints/ng2/files/__path__/system-config.ts index 5c1d80bd798d..d2af1aac0c59 100644 --- a/addon/ng2/blueprints/ng2/files/__path__/system-config.ts +++ b/addon/ng2/blueprints/ng2/files/__path__/system-config.ts @@ -32,9 +32,9 @@ const barrels: string[] = [ /** @cli-barrel */ ]; -const _cliSystemConfig: any = {}; +const cliSystemConfigPackages: any = {}; barrels.forEach((barrelName: string) => { - _cliSystemConfig[barrelName] = { main: 'index' }; + cliSystemConfigPackages[barrelName] = { main: 'index' }; }); /** Type declaration for ambient System. */ @@ -47,7 +47,7 @@ System.config({ 'rxjs': 'vendor/rxjs', 'main': 'main.js' }, - packages: _cliSystemConfig + packages: cliSystemConfigPackages }); // Apply the user's configuration.
f4349c5d0352ce27571c49ae084181eb78db1e2a
2021-12-06 20:23:04
Alan Agius
refactor(@ngtools/webpack): remove ESM workarounds
false
remove ESM workarounds
refactor
diff --git a/packages/ngtools/webpack/src/ivy/plugin.ts b/packages/ngtools/webpack/src/ivy/plugin.ts index 17eaed1ab8d7..ae771f3817ee 100644 --- a/packages/ngtools/webpack/src/ivy/plugin.ts +++ b/packages/ngtools/webpack/src/ivy/plugin.ts @@ -734,24 +734,7 @@ export class AngularWebpackPlugin { // this, a Function constructor is used to prevent TypeScript from changing the dynamic import. // Once TypeScript provides support for keeping the dynamic import this workaround can // be dropped. - const compilerCliModule = await new Function(`return import('@angular/compiler-cli');`)(); - let compilerNgccModule; - try { - compilerNgccModule = await new Function(`return import('@angular/compiler-cli/ngcc');`)(); - } catch { - // If the `exports` field entry is not present then try the file directly. - // TODO_ESM: This try/catch can be removed once the `exports` field is present in `@angular/compiler-cli` - compilerNgccModule = await new Function( - `return import('@angular/compiler-cli/ngcc/index.js');`, - )(); - } - // If it is not ESM then the functions needed will be stored in the `default` property. - // TODO_ESM: This conditional can be removed when `@angular/compiler-cli` is ESM only. - this.compilerCliModule = compilerCliModule.readConfiguration - ? compilerCliModule - : compilerCliModule.default; - this.compilerNgccModule = compilerNgccModule.process - ? compilerNgccModule - : compilerNgccModule.default; + this.compilerCliModule = await new Function(`return import('@angular/compiler-cli');`)(); + this.compilerNgccModule = await new Function(`return import('@angular/compiler-cli/ngcc');`)(); } } diff --git a/packages/ngtools/webpack/src/ngcc_processor.ts b/packages/ngtools/webpack/src/ngcc_processor.ts index 9c299ced47b3..5c9a9a79453b 100644 --- a/packages/ngtools/webpack/src/ngcc_processor.ts +++ b/packages/ngtools/webpack/src/ngcc_processor.ts @@ -120,14 +120,6 @@ export class NgccProcessor { const timeLabel = 'NgccProcessor.process'; time(timeLabel); - // Temporary workaround during transition to ESM-only @angular/compiler-cli - // TODO_ESM: This workaround should be removed prior to the final release of v13 - // and replaced with only `this.compilerNgcc.ngccMainFilePath`. - const ngccExecutablePath = - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this.compilerNgcc as any).ngccMainFilePath ?? - require.resolve('@angular/compiler-cli/ngcc/main-ngcc.js'); - // We spawn instead of using the API because: // - NGCC Async uses clustering which is problematic when used via the API which means // that we cannot setup multiple cluster masters with different options. @@ -136,7 +128,7 @@ export class NgccProcessor { const { status, error } = spawnSync( process.execPath, [ - ngccExecutablePath, + this.compilerNgcc.ngccMainFilePath, '--source' /** basePath */, this._nodeModulesDirectory, '--properties' /** propertiesToConsider */,
c6d145bf3268c897fff1ee4d7f27de66ad8ae349
2019-04-02 23:01:24
Charles Lyding
test(@angular-devkit/build-angular): cleanup unused imports
false
cleanup unused imports
test
diff --git a/packages/angular_devkit/build_angular/test/browser/aot_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/aot_spec_large.ts index 75403f6f7a32..506ce1968b38 100644 --- a/packages/angular_devkit/build_angular/test/browser/aot_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/aot_spec_large.ts @@ -7,11 +7,9 @@ */ import { Architect } from '@angular-devkit/architect/src/index2'; -import { runTargetSpec } from '@angular-devkit/architect/testing'; import { join, normalize, virtualFs } from '@angular-devkit/core'; -import { tap } from 'rxjs/operators'; import { BrowserBuilderOutput } from '../../src/browser'; -import { browserTargetSpec, createArchitect, host } from '../utils'; +import { createArchitect, host } from '../utils'; describe('Browser Builder AOT', () => { diff --git a/packages/angular_devkit/build_angular/test/browser/base-href_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/base-href_spec_large.ts index 37d7dc1570af..ea47ac08447b 100644 --- a/packages/angular_devkit/build_angular/test/browser/base-href_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/base-href_spec_large.ts @@ -7,11 +7,9 @@ */ import { Architect } from '@angular-devkit/architect/src/index2'; -import { runTargetSpec } from '@angular-devkit/architect/testing'; import { join, normalize, tags, virtualFs } from '@angular-devkit/core'; -import { tap } from 'rxjs/operators'; import { BrowserBuilderOutput } from '../../src/browser'; -import { browserTargetSpec, createArchitect, host } from '../utils'; +import { createArchitect, host } from '../utils'; describe('Browser Builder base href', () => { diff --git a/packages/angular_devkit/build_angular/test/browser/tsconfig-paths_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/tsconfig-paths_spec_large.ts index 3c051fce1765..4cdc0b667390 100644 --- a/packages/angular_devkit/build_angular/test/browser/tsconfig-paths_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/tsconfig-paths_spec_large.ts @@ -7,9 +7,7 @@ */ import { Architect } from '@angular-devkit/architect/src/index2'; -import { runTargetSpec } from '@angular-devkit/architect/testing'; -import { tap } from 'rxjs/operators'; -import { browserBuild, browserTargetSpec, createArchitect, host } from '../utils'; +import { browserBuild, createArchitect, host } from '../utils'; describe('Browser Builder tsconfig paths', () => { diff --git a/packages/angular_devkit/build_angular/test/browser/works_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/works_spec_large.ts index 5cc8ecbeb3d0..59a885581cf7 100644 --- a/packages/angular_devkit/build_angular/test/browser/works_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/works_spec_large.ts @@ -7,10 +7,8 @@ */ import { Architect } from '@angular-devkit/architect/src/index2'; -import { runTargetSpec } from '@angular-devkit/architect/testing'; -import { join, normalize } from '@angular-devkit/core'; -import { tap } from 'rxjs/operators'; -import { browserBuild, browserTargetSpec, createArchitect, host } from '../utils'; +import { normalize } from '@angular-devkit/core'; +import { browserBuild, createArchitect, host } from '../utils'; describe('Browser Builder basic test', () => {
9d255cac2f29279e719fcad72f4f65b711fc5bc2
2016-09-13 22:32:30
Mike Brocchi
chore: update angular to rc7 (#2084)
false
update angular to rc7 (#2084)
chore
diff --git a/package.json b/package.json index 8d200a1964a9..6bf630e3a821 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "homepage": "https://github.com/angular/angular-cli", "dependencies": { "@angular-cli/ast-tools": "^1.0.0", - "@angular/compiler": "^2.0.0-rc.6", + "@angular/compiler": "^2.0.0-rc.7", "@angular/compiler-cli": "^0.6.0", - "@angular/core": "^2.0.0-rc.6", + "@angular/core": "^2.0.0-rc.7", "@angular/tsc-wrapped": "^0.3.0", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", @@ -89,7 +89,7 @@ "remap-istanbul": "^0.6.4", "resolve": "^1.1.7", "rimraf": "^2.5.3", - "rxjs": "^5.0.0-beta.11", + "rxjs": "^5.0.0-beta.12", "sass-loader": "^3.2.0", "script-loader": "^0.7.0", "shelljs": "^0.7.0", diff --git a/packages/angular-cli/blueprints/ng2/files/package.json b/packages/angular-cli/blueprints/ng2/files/package.json index 414e164ac89c..04902950fe82 100644 --- a/packages/angular-cli/blueprints/ng2/files/package.json +++ b/packages/angular-cli/blueprints/ng2/files/package.json @@ -12,21 +12,21 @@ }, "private": true, "dependencies": { - "@angular/common": "2.0.0-rc.6", - "@angular/compiler": "2.0.0-rc.6", - "@angular/core": "2.0.0-rc.6", - "@angular/forms": "2.0.0-rc.6", - "@angular/http": "2.0.0-rc.6", - "@angular/platform-browser": "2.0.0-rc.6", - "@angular/platform-browser-dynamic": "2.0.0-rc.6", - "@angular/router": "3.0.0-rc.2", + "@angular/common": "2.0.0-rc.7", + "@angular/compiler": "2.0.0-rc.7", + "@angular/core": "2.0.0-rc.7", + "@angular/forms": "2.0.0-rc.7", + "@angular/http": "2.0.0-rc.7", + "@angular/platform-browser": "2.0.0-rc.7", + "@angular/platform-browser-dynamic": "2.0.0-rc.7", + "@angular/router": "3.0.0-rc.3", "core-js": "^2.4.1", - "rxjs": "5.0.0-beta.11", + "rxjs": "5.0.0-beta.12", "ts-helpers": "^1.1.1", - "zone.js": "^0.6.17" + "zone.js": "^0.6.21" }, "devDependencies": {<% if(isMobile) { %> - "@angular/platform-server": "2.0.0-rc.6", + "@angular/platform-server": "2.0.0-rc.7", "@angular/service-worker": "0.2.0", "@angular/app-shell": "0.0.0", "angular2-universal":"0.104.5", diff --git a/packages/angular-cli/package.json b/packages/angular-cli/package.json index 9f6c25521a79..ae57b7c0dc4e 100644 --- a/packages/angular-cli/package.json +++ b/packages/angular-cli/package.json @@ -25,9 +25,9 @@ "homepage": "https://github.com/angular/angular-cli", "dependencies": { "@angular-cli/ast-tools": "^1.0.0", - "@angular/compiler": "^2.0.0-rc.6", + "@angular/compiler": "^2.0.0-rc.7", "@angular/compiler-cli": "^0.6.0", - "@angular/core": "^2.0.0-rc.6", + "@angular/core": "^2.0.0-rc.7", "@angular/tsc-wrapped": "^0.3.0", "angular2-template-loader": "^0.5.0", "awesome-typescript-loader": "^2.2.3", @@ -70,7 +70,7 @@ "remap-istanbul": "^0.6.4", "resolve": "^1.1.7", "rimraf": "^2.5.3", - "rxjs": "^5.0.0-beta.11", + "rxjs": "^5.0.0-beta.12", "sass-loader": "^3.2.0", "script-loader": "^0.7.0", "shelljs": "^0.7.0",
888ac92127c5cc73cf336097f6105bc9000bbc40
2021-03-19 16:12:41
Charles Lyding
test(@angular-devkit/build-angular): add dev-server builder disableHostCheck option
false
add dev-server builder disableHostCheck option
test
diff --git a/packages/angular_devkit/build_angular/src/dev-server/tests/options/disable-host-check_spec.ts b/packages/angular_devkit/build_angular/src/dev-server/tests/options/disable-host-check_spec.ts new file mode 100644 index 000000000000..ce583fb96d23 --- /dev/null +++ b/packages/angular_devkit/build_angular/src/dev-server/tests/options/disable-host-check_spec.ts @@ -0,0 +1,69 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { serveWebpackBrowser } from '../../index'; +import { executeOnceAndFetch } from '../execute-fetch'; +import { + BASE_OPTIONS, + DEV_SERVER_BUILDER_INFO, + describeBuilder, + setupBrowserTarget, +} from '../setup'; + +const FETCH_HEADERS = Object.freeze({ host: 'example.com' }); + +describeBuilder(serveWebpackBrowser, DEV_SERVER_BUILDER_INFO, (harness) => { + describe('option: "disableHostCheck"', () => { + beforeEach(async () => { + setupBrowserTarget(harness); + + // Application code is not needed for these tests + await harness.writeFile('src/main.ts', ''); + }); + + it('does not allow an invalid host when option is not present', async () => { + harness.useTarget('serve', { + ...BASE_OPTIONS, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/', { + request: { headers: FETCH_HEADERS }, + }); + + expect(result?.success).toBeTrue(); + expect(await response?.text()).toBe('Invalid Host header'); + }); + + it('does not allow an invalid host when option is false', async () => { + harness.useTarget('serve', { + ...BASE_OPTIONS, + disableHostCheck: false, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/', { + request: { headers: FETCH_HEADERS }, + }); + + expect(result?.success).toBeTrue(); + expect(await response?.text()).toBe('Invalid Host header'); + }); + + it('allows a host when option is true', async () => { + harness.useTarget('serve', { + ...BASE_OPTIONS, + disableHostCheck: true, + }); + + const { result, response } = await executeOnceAndFetch(harness, '/', { + request: { headers: FETCH_HEADERS }, + }); + + expect(result?.success).toBeTrue(); + expect(await response?.text()).toContain('<title>'); + }); + }); +});
15c14f7e5b053a2e78c1c31060585fd62ecde36d
2023-06-07 16:48:15
Alan Agius
docs: release notes for the v16.0.5 release
false
release notes for the v16.0.5 release
docs
diff --git a/CHANGELOG.md b/CHANGELOG.md index 70e0f0e820ef..22dc597ab110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +<a name="16.0.5"></a> + +# 16.0.5 (2023-06-07) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------- | +| [9817b984b](https://github.com/angular/angular-cli/commit/9817b984b15e352caedac6e347cc662117b9e0f8) | fix | ignore .git folder in browser-esbuild watcher | +| [ce95d2545](https://github.com/angular/angular-cli/commit/ce95d254510ffa93a9bd4230f6447530d511ef5f) | fix | ignore folders starting with a dot in browser-esbuild watcher | + +<!-- CHANGELOG SPLIT MARKER --> + <a name="16.1.0-next.2"></a> # 16.1.0-next.2 (2023-06-01)
d133ba68c0e2bc05472712fbe7eecd63a54f142c
2019-10-15 02:10:31
Alan Agius
feat(@angular/cli): add support for ng-add packages that should not be saved as `dependencies`
false
add support for ng-add packages that should not be saved as `dependencies`
feat
diff --git a/packages/angular/cli/commands/add-impl.ts b/packages/angular/cli/commands/add-impl.ts index 790a8618115d..9e0e213eabe4 100644 --- a/packages/angular/cli/commands/add-impl.ts +++ b/packages/angular/cli/commands/add-impl.ts @@ -13,9 +13,11 @@ import { isPackageNameSafeForAnalytics } from '../models/analytics'; import { Arguments } from '../models/interface'; import { RunSchematicOptions, SchematicCommand } from '../models/schematic-command'; import npmInstall from '../tasks/npm-install'; +import npmUninstall from '../tasks/npm-uninstall'; import { colors } from '../utilities/color'; import { getPackageManager } from '../utilities/package-manager'; import { + NgAddSaveDepedency, PackageManifest, fetchPackageManifest, fetchPackageMetadata, @@ -113,31 +115,39 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> { } let collectionName = packageIdentifier.name; - if (!packageIdentifier.registry) { - try { - const manifest = await fetchPackageManifest(packageIdentifier, this.logger, { - registry: options.registry, - verbose: options.verbose, - usingYarn, - }); + let dependencyType: NgAddSaveDepedency | undefined; - collectionName = manifest.name; + try { + const manifest = await fetchPackageManifest(packageIdentifier, this.logger, { + registry: options.registry, + verbose: options.verbose, + usingYarn, + }); - if (await this.hasMismatchedPeer(manifest)) { - this.logger.warn( - 'Package has unmet peer dependencies. Adding the package may not succeed.', - ); - } - } catch (e) { - this.logger.error('Unable to fetch package manifest: ' + e.message); + dependencyType = manifest['ng-add'] && manifest['ng-add'].save; + collectionName = manifest.name; - return 1; + if (await this.hasMismatchedPeer(manifest)) { + this.logger.warn( + 'Package has unmet peer dependencies. Adding the package may not succeed.', + ); } + } catch (e) { + this.logger.error('Unable to fetch package manifest: ' + e.message); + + return 1; } - await npmInstall(packageIdentifier.raw, this.logger, packageManager, this.workspace.root); + await npmInstall(packageIdentifier.raw, this.logger, packageManager, dependencyType); + + const schematicResult = await this.executeSchematic(collectionName, options['--']); + + if (dependencyType === false) { + // Uninstall the package if it was not meant to be retained. + return npmUninstall(packageIdentifier.raw, this.logger, packageManager); + } - return this.executeSchematic(collectionName, options['--']); + return schematicResult; } async reportAnalytics( diff --git a/packages/angular/cli/tasks/npm-install.ts b/packages/angular/cli/tasks/npm-install.ts index f60fce0f8991..33deaabd3964 100644 --- a/packages/angular/cli/tasks/npm-install.ts +++ b/packages/angular/cli/tasks/npm-install.ts @@ -9,13 +9,13 @@ import { logging } from '@angular-devkit/core'; import { spawn } from 'child_process'; import { colors } from '../utilities/color'; +import { NgAddSaveDepedency } from '../utilities/package-metadata'; export default async function( packageName: string, logger: logging.Logger, packageManager: string, - projectRoot: string, - save = true, + save: NgAddSaveDepedency = true, ) { const installArgs: string[] = []; switch (packageManager) { @@ -42,9 +42,14 @@ export default async function( } if (!save) { + // IMP: yarn doesn't have a no-save option installArgs.push('--no-save'); } + if (save === 'devDependencies') { + installArgs.push(packageManager === 'yarn' ? '--dev' : '--save-dev'); + } + installArgs.push('--quiet'); await new Promise((resolve, reject) => { diff --git a/packages/angular/cli/tasks/npm-uninstall.ts b/packages/angular/cli/tasks/npm-uninstall.ts new file mode 100644 index 000000000000..a30160195a0d --- /dev/null +++ b/packages/angular/cli/tasks/npm-uninstall.ts @@ -0,0 +1,53 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { logging } from '@angular-devkit/core'; +import { spawn } from 'child_process'; +import { colors } from '../utilities/color'; + +export default async function( + packageName: string, + logger: logging.Logger, + packageManager: string, +) { + const installArgs: string[] = []; + switch (packageManager) { + case 'cnpm': + case 'pnpm': + case 'npm': + installArgs.push('uninstall'); + break; + + case 'yarn': + installArgs.push('remove'); + break; + + default: + packageManager = 'npm'; + installArgs.push('uninstall'); + break; + } + + installArgs.push(packageName, '--quiet'); + + logger.info(colors.green(`Uninstalling packages for tooling via ${packageManager}.`)); + + await new Promise((resolve, reject) => { + spawn(packageManager, installArgs, { stdio: 'inherit', shell: true }).on( + 'close', + (code: number) => { + if (code === 0) { + logger.info(colors.green(`Uninstalling packages for tooling via ${packageManager}.`)); + resolve(); + } else { + reject('Package uninstallation failed, see above.'); + } + }, + ); + }); +} diff --git a/packages/angular/cli/utilities/package-metadata.ts b/packages/angular/cli/utilities/package-metadata.ts index 0be552aa09a9..303468da908d 100644 --- a/packages/angular/cli/utilities/package-metadata.ts +++ b/packages/angular/cli/utilities/package-metadata.ts @@ -18,6 +18,8 @@ export interface PackageDependencies { [dependency: string]: string; } +export type NgAddSaveDepedency = 'dependencies' | 'devDependencies' | boolean; + export interface PackageIdentifier { type: 'git' | 'tag' | 'version' | 'range' | 'file' | 'directory' | 'remote'; name: string; @@ -39,8 +41,9 @@ export interface PackageManifest { devDependencies: PackageDependencies; peerDependencies: PackageDependencies; optionalDependencies: PackageDependencies; - - 'ng-add'?: {}; + 'ng-add'?: { + save?: NgAddSaveDepedency; + }; 'ng-update'?: { migrations: string; packageGroup: { [name: string]: string }; diff --git a/packages/angular/cli/utilities/package-tree.ts b/packages/angular/cli/utilities/package-tree.ts index afff17122046..48af91ceadab 100644 --- a/packages/angular/cli/utilities/package-tree.ts +++ b/packages/angular/cli/utilities/package-tree.ts @@ -5,6 +5,10 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ + + +import { NgAddSaveDepedency } from './package-metadata'; + export interface PackageTreeNodeBase { name: string; path: string; @@ -22,6 +26,9 @@ export interface PackageTreeNodeBase { 'ng-update'?: { migrations?: string; }; + 'ng-add'?: { + save?: NgAddSaveDepedency; + }; }; parent?: PackageTreeNode; children: PackageTreeNode[]; diff --git a/packages/angular/pwa/package.json b/packages/angular/pwa/package.json index a9ef0a0996b6..7ccefc72d2be 100644 --- a/packages/angular/pwa/package.json +++ b/packages/angular/pwa/package.json @@ -9,6 +9,9 @@ "schematics" ], "schematics": "./collection.json", + "ng-add": { + "save": false + }, "dependencies": { "@angular-devkit/core": "0.0.0", "@angular-devkit/schematics": "0.0.0", diff --git a/tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts b/tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts new file mode 100644 index 000000000000..330297ec1866 --- /dev/null +++ b/tests/legacy-cli/e2e/tests/commands/add/add-pwa.ts @@ -0,0 +1,20 @@ +import { join } from 'path'; +import { expectFileToExist, expectFileToMatch, rimraf, readFile } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; + +export default async function () { + // forcibly remove in case another test doesn't clean itself up + await rimraf('node_modules/@angular/pwa'); + + await ng('add', '@angular/pwa'); + + await expectFileToExist(join(process.cwd(), 'src/manifest.webmanifest')); + + // Angular PWA doesn't install as a dependency + const { dependencies, devDependencies } = JSON.parse(await readFile(join(process.cwd(), 'package.json'))); + const hasPWADep = Object.keys({ ...dependencies, ...devDependencies }) + .some(d => d === '@angular/pwa'); + if (hasPWADep) { + throw new Error(`Expected 'package.json' not to contain a dependency on '@angular/pwa'.`); + } +}
b07ccfbb1b2045d285c23dd4b654e1380892fcb2
2022-05-04 02:34:47
Charles Lyding
feat(@schematics/angular): introduce a utility subpath export for Angular rules and utilities
false
introduce a utility subpath export for Angular rules and utilities
feat
diff --git a/packages/schematics/angular/e2e/index.ts b/packages/schematics/angular/e2e/index.ts index de24c20c2514..7bd48bf2c5de 100644 --- a/packages/schematics/angular/e2e/index.ts +++ b/packages/schematics/angular/e2e/index.ts @@ -19,11 +19,11 @@ import { strings, url, } from '@angular-devkit/schematics'; +import { readWorkspace, writeWorkspace } from '../utility'; import { NodeDependencyType, addPackageJsonDependency } from '../utility/dependencies'; import { JSONFile } from '../utility/json-file'; import { latestVersions } from '../utility/latest-versions'; import { relativePathToWorkspaceRoot } from '../utility/paths'; -import { getWorkspace, updateWorkspace } from '../utility/workspace'; import { Builders } from '../utility/workspace-models'; import { Schema as E2eOptions } from './schema'; @@ -41,7 +41,7 @@ function addScriptsToPackageJson(): Rule { export default function (options: E2eOptions): Rule { return async (host: Tree) => { const appProject = options.relatedAppName; - const workspace = await getWorkspace(host); + const workspace = await readWorkspace(host); const project = workspace.projects.get(appProject); if (!project) { throw new SchematicsException(`Project name "${appProject}" doesn't not exist.`); @@ -66,8 +66,9 @@ export default function (options: E2eOptions): Rule { }, }); + await writeWorkspace(host, workspace); + return chain([ - updateWorkspace(workspace), mergeWith( apply(url('./files'), [ applyTemplates({ diff --git a/packages/schematics/angular/package.json b/packages/schematics/angular/package.json index 7845c5c03aa9..ba8e7cb75650 100644 --- a/packages/schematics/angular/package.json +++ b/packages/schematics/angular/package.json @@ -8,6 +8,13 @@ "code generation", "schematics" ], + "exports": { + "./package.json": "./package.json", + "./utility": "./utility/index.js", + "./utility/*": "./utility/*.js", + "./migrations/migration-collection.json": "./migrations/migration-collection.json", + "./*": "./*.js" + }, "schematics": "./collection.json", "dependencies": { "@angular-devkit/core": "0.0.0-PLACEHOLDER", diff --git a/packages/schematics/angular/service-worker/index.ts b/packages/schematics/angular/service-worker/index.ts index f35e47019d5f..765bad7c4f9d 100644 --- a/packages/schematics/angular/service-worker/index.ts +++ b/packages/schematics/angular/service-worker/index.ts @@ -21,6 +21,7 @@ import { } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript'; +import { readWorkspace, writeWorkspace } from '../utility'; import { addSymbolToNgModuleMetadata, getEnvironmentExportName, @@ -32,7 +33,6 @@ import { addPackageJsonDependency, getPackageJsonDependency } from '../utility/d import { getAppModulePath } from '../utility/ng-ast-utils'; import { relativePathToWorkspaceRoot } from '../utility/paths'; import { targetBuildNotFoundError } from '../utility/project-targets'; -import { getWorkspace, updateWorkspace } from '../utility/workspace'; import { BrowserBuilderOptions } from '../utility/workspace-models'; import { Schema as ServiceWorkerOptions } from './schema'; @@ -130,7 +130,7 @@ function getTsSourceFile(host: Tree, path: string): ts.SourceFile { export default function (options: ServiceWorkerOptions): Rule { return async (host: Tree, context: SchematicContext) => { - const workspace = await getWorkspace(host); + const workspace = await readWorkspace(host); const project = workspace.projects.get(options.project); if (!project) { throw new SchematicsException(`Invalid project name (${options.project})`); @@ -163,9 +163,10 @@ export default function (options: ServiceWorkerOptions): Rule { context.addTask(new NodePackageInstallTask()); + await writeWorkspace(host, workspace); + return chain([ mergeWith(templateSource), - updateWorkspace(workspace), addDependencies(), updateAppModule(buildOptions.main), ]); diff --git a/packages/schematics/angular/utility/index.ts b/packages/schematics/angular/utility/index.ts new file mode 100644 index 000000000000..c8fa9a1de6c1 --- /dev/null +++ b/packages/schematics/angular/utility/index.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +// Workspace related rules and types +export { + ProjectDefinition, + TargetDefinition, + WorkspaceDefinition, + getWorkspace as readWorkspace, + updateWorkspace, + writeWorkspace, +} from './workspace'; +export { Builders as AngularBuilder } from './workspace-models'; + +// Package dependency related rules and types +export { DependencyType, addDependency } from './dependency'; diff --git a/packages/schematics/angular/utility/workspace-models.ts b/packages/schematics/angular/utility/workspace-models.ts index 3fbaec1f5879..fb7f18c3f7cd 100644 --- a/packages/schematics/angular/utility/workspace-models.ts +++ b/packages/schematics/angular/utility/workspace-models.ts @@ -11,6 +11,12 @@ export enum ProjectType { Library = 'library', } +/** + * An enum of the official Angular builders. + * Each enum value provides the fully qualified name of the associated builder. + * This enum can be used when analyzing the `builder` fields of project configurations from the + * `angular.json` workspace file. + */ export enum Builders { AppShell = '@angular-devkit/build-angular:app-shell', Server = '@angular-devkit/build-angular:server', diff --git a/packages/schematics/angular/utility/workspace.ts b/packages/schematics/angular/utility/workspace.ts index 9354f4beab14..410c079e2fab 100644 --- a/packages/schematics/angular/utility/workspace.ts +++ b/packages/schematics/angular/utility/workspace.ts @@ -10,60 +10,109 @@ import { json, workspaces } from '@angular-devkit/core'; import { Rule, Tree, noop } from '@angular-devkit/schematics'; import { ProjectType } from './workspace-models'; -function createHost(tree: Tree): workspaces.WorkspaceHost { - return { - async readFile(path: string): Promise<string> { - return tree.readText(path); - }, - async writeFile(path: string, data: string): Promise<void> { - return tree.overwrite(path, data); - }, - async isDirectory(path: string): Promise<boolean> { - // approximate a directory check - return !tree.exists(path) && tree.getDir(path).subfiles.length > 0; - }, - async isFile(path: string): Promise<boolean> { - return tree.exists(path); - }, - }; +const DEFAULT_WORKSPACE_PATH = '/angular.json'; + +// re-export the workspace definition types for convenience +export type WorkspaceDefinition = workspaces.WorkspaceDefinition; +export type ProjectDefinition = workspaces.ProjectDefinition; +export type TargetDefinition = workspaces.TargetDefinition; + +/** + * A {@link workspaces.WorkspaceHost} backed by a Schematics {@link Tree} instance. + */ +class TreeWorkspaceHost implements workspaces.WorkspaceHost { + constructor(private readonly tree: Tree) {} + + async readFile(path: string): Promise<string> { + return this.tree.readText(path); + } + + async writeFile(path: string, data: string): Promise<void> { + if (this.tree.exists(path)) { + this.tree.overwrite(path, data); + } else { + this.tree.create(path, data); + } + } + + async isDirectory(path: string): Promise<boolean> { + // approximate a directory check + return !this.tree.exists(path) && this.tree.getDir(path).subfiles.length > 0; + } + + async isFile(path: string): Promise<boolean> { + return this.tree.exists(path); + } } +/** + * Updates the workspace file (`angular.json`) found within the root of the schematic's tree. + * The workspace object model can be directly modified within the provided updater function + * with changes being written to the workspace file after the updater function returns. + * The spacing and overall layout of the file (including comments) will be maintained where + * possible when updating the file. + * + * @param updater An update function that can be used to modify the object model for the + * workspace. A {@link WorkspaceDefinition} is provided as the first argument to the function. + */ export function updateWorkspace( - updater: (workspace: workspaces.WorkspaceDefinition) => void | Rule | PromiseLike<void | Rule>, -): Rule; -export function updateWorkspace(workspace: workspaces.WorkspaceDefinition): Rule; -export function updateWorkspace( - updaterOrWorkspace: - | workspaces.WorkspaceDefinition - | ((workspace: workspaces.WorkspaceDefinition) => void | Rule | PromiseLike<void | Rule>), + updater: (workspace: WorkspaceDefinition) => void | Rule | PromiseLike<void | Rule>, ): Rule { return async (tree: Tree) => { - const host = createHost(tree); + const host = new TreeWorkspaceHost(tree); - if (typeof updaterOrWorkspace === 'function') { - const { workspace } = await workspaces.readWorkspace('/', host); + const { workspace } = await workspaces.readWorkspace(DEFAULT_WORKSPACE_PATH, host); - const result = await updaterOrWorkspace(workspace); + const result = await updater(workspace); - await workspaces.writeWorkspace(workspace, host); + await workspaces.writeWorkspace(workspace, host); - return result || noop; - } else { - await workspaces.writeWorkspace(updaterOrWorkspace, host); - - return noop; - } + return result || noop; }; } -export async function getWorkspace(tree: Tree, path = '/') { - const host = createHost(tree); +// TODO: This should be renamed `readWorkspace` once deep imports are restricted (already exported from `utility` with that name) +/** + * Reads a workspace file (`angular.json`) from the provided {@link Tree} instance. + * + * @param tree A schematics {@link Tree} instance used to access the workspace file. + * @param path The path where a workspace file should be found. If a file is specified, the file + * path will be used. If a directory is specified, the file `angular.json` will be used from + * within the specified directory. Defaults to `/angular.json`. + * @returns A {@link WorkspaceDefinition} representing the workspace found at the specified path. + */ +export async function getWorkspace( + tree: Tree, + path = DEFAULT_WORKSPACE_PATH, +): Promise<WorkspaceDefinition> { + const host = new TreeWorkspaceHost(tree); const { workspace } = await workspaces.readWorkspace(path, host); return workspace; } +/** + * Writes a workspace file (`angular.json`) to the provided {@link Tree} instance. + * The spacing and overall layout of an exisitng file (including comments) will be maintained where + * possible when writing the file. + * + * @param tree A schematics {@link Tree} instance used to access the workspace file. + * @param workspace The {@link WorkspaceDefinition} to write. + * @param path The path where a workspace file should be written. If a file is specified, the file + * path will be used. If not provided, the definition's underlying file path stored during reading + * will be used. + */ +export async function writeWorkspace( + tree: Tree, + workspace: WorkspaceDefinition, + path?: string, +): Promise<void> { + const host = new TreeWorkspaceHost(tree); + + return workspaces.writeWorkspace(workspace, host, path); +} + /** * Build a default project path for generating. * @param project The project which will have its default path generated. diff --git a/packages/schematics/angular/utility/workspace_spec.ts b/packages/schematics/angular/utility/workspace_spec.ts new file mode 100644 index 000000000000..f5b9978719a6 --- /dev/null +++ b/packages/schematics/angular/utility/workspace_spec.ts @@ -0,0 +1,126 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { EmptyTree, Rule, SchematicContext, Tree, callRule } from '@angular-devkit/schematics'; +import { getWorkspace as readWorkspace, updateWorkspace, writeWorkspace } from './workspace'; + +const TEST_WORKSPACE_CONTENT = JSON.stringify({ + version: 1, + projects: { + 'test': {}, + }, +}); + +async function testRule(rule: Rule, tree: Tree): Promise<void> { + await callRule(rule, tree, {} as unknown as SchematicContext).toPromise(); +} + +describe('readWorkspace', () => { + it('reads a workspace using the default path value', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + + const workspace = await readWorkspace(tree); + expect(workspace.projects.has('test')).toBeTrue(); + }); + + it('reads a workspace when specifying a directory path', async () => { + const tree = new EmptyTree(); + tree.create('/xyz/angular.json', TEST_WORKSPACE_CONTENT); + + const workspace = await readWorkspace(tree, '/xyz/'); + expect(workspace.projects.has('test')).toBeTrue(); + }); + + it('reads a workspace when specifying a file path', async () => { + const tree = new EmptyTree(); + tree.create('/xyz/angular.json', TEST_WORKSPACE_CONTENT); + + const workspace = await readWorkspace(tree, '/xyz/angular.json'); + expect(workspace.projects.has('test')).toBeTrue(); + }); + + it('throws if workspace file does not exist when using the default path value', async () => { + const tree = new EmptyTree(); + + await expectAsync(readWorkspace(tree)).toBeRejectedWithError(); + }); + + it('throws if workspace file does not exist when specifying a file path', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + + await expectAsync(readWorkspace(tree, 'abc.json')).toBeRejectedWithError(); + }); +}); + +describe('writeWorkspace', () => { + it('writes a workspace using the default path value', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + const workspace = await readWorkspace(tree); + + workspace.extensions['x-abc'] = 1; + await writeWorkspace(tree, workspace); + expect(tree.readJson('/angular.json')).toEqual(jasmine.objectContaining({ 'x-abc': 1 })); + }); + + it('writes a workspace when specifying a path', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + const workspace = await readWorkspace(tree); + + workspace.extensions['x-abc'] = 1; + await writeWorkspace(tree, workspace, '/xyz/angular.json'); + expect(tree.readJson('/xyz/angular.json')).toEqual(jasmine.objectContaining({ 'x-abc': 1 })); + }); +}); + +describe('updateWorkspace', () => { + it('updates a workspace using the default path value', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + + const rule = updateWorkspace((workspace) => { + workspace.projects.add({ + name: 'abc', + root: 'src', + }); + }); + + await testRule(rule, tree); + + expect(tree.read('angular.json')?.toString()).toContain('"abc"'); + }); + + it('throws if workspace file does not exist', async () => { + const tree = new EmptyTree(); + + const rule = updateWorkspace((workspace) => { + workspace.projects.add({ + name: 'abc', + root: 'src', + }); + }); + + await expectAsync(testRule(rule, tree)).toBeRejectedWithError(); + }); + + it('allows executing a returned followup rule', async () => { + const tree = new EmptyTree(); + tree.create('/angular.json', TEST_WORKSPACE_CONTENT); + + const rule = updateWorkspace(() => { + return (tree) => tree.create('/followup.txt', '12345'); + }); + + await testRule(rule, tree); + + expect(tree.read('/followup.txt')?.toString()).toContain('12345'); + }); +});
e1b3be9dd079d8056ff23be5a875885c3bb32a92
2016-03-18 22:20:04
gdi2290
refactor(universal): correct zone.js polyfill
false
correct zone.js polyfill
refactor
diff --git a/modules/universal/src/polyfills.ts b/modules/universal/src/polyfills.ts index 439eeba4c1ef..b67118a2353b 100644 --- a/modules/universal/src/polyfills.ts +++ b/modules/universal/src/polyfills.ts @@ -4,4 +4,4 @@ import 'es6-shim'; // typescript emit metadata import 'reflect-metadata'; // zone.js to track promises -import 'zone.js/lib/zone'; +import 'zone.js/dist/zone-node';
455dbb5dc4a09f68fa17d500ade09df56fbfb89c
2017-03-03 21:39:10
Ricardo Varanda
docs: fix typo in story list
false
fix typo in story list
docs
diff --git a/docs/documentation/stories.md b/docs/documentation/stories.md index f208483c30ff..d3faa8d93447 100644 --- a/docs/documentation/stories.md +++ b/docs/documentation/stories.md @@ -15,7 +15,7 @@ - [Bootstrap](stories/include-bootstrap) - [Font Awesome](stories/include-font-awesome) - [Moving Into the CLI](stories/moving-into-the-cli) - - [Movine Out of the CLI](stories/moving-out-of-the-cli) + - [Moving Out of the CLI](stories/moving-out-of-the-cli) - [Proxy](stories/proxy) - [Routing](stories/routing) - [3rd Party Lib](stories/third-party-lib)
5855c14e769ebda2a07423628ae07e3ed3108578
2020-04-28 03:38:15
Alan Agius
feat(@schematics/angular): add migration for `evalSourceMap`, `vendorSourceMap` `profile` and `skipAppShell` options.
false
add migration for `evalSourceMap`, `vendorSourceMap` `profile` and `skipAppShell` options.
feat
diff --git a/packages/schematics/angular/migrations/migration-collection.json b/packages/schematics/angular/migrations/migration-collection.json index 11828b7fdb93..80242963291b 100644 --- a/packages/schematics/angular/migrations/migration-collection.json +++ b/packages/schematics/angular/migrations/migration-collection.json @@ -79,6 +79,11 @@ "version": "10.0.0-beta.2", "factory": "./update-9/schematic-options", "description": "Replace deprecated 'styleext' and 'spec' Angular schematic options." + }, + "update-angular-config": { + "version": "10.0.0-beta.3", + "factory": "./update-10/update-angular-config", + "description": "Remove deprecated 'evalSourceMap', `profile`, 'skipAppShell' and 'vendorSourceMap' from 'angular.json'." } } } diff --git a/packages/schematics/angular/migrations/update-10/update-angular-config.ts b/packages/schematics/angular/migrations/update-10/update-angular-config.ts new file mode 100644 index 000000000000..45fbab0466ba --- /dev/null +++ b/packages/schematics/angular/migrations/update-10/update-angular-config.ts @@ -0,0 +1,96 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { workspaces } from '@angular-devkit/core'; +import { Rule } from '@angular-devkit/schematics'; +import { updateWorkspace } from '../../utility/workspace'; +import { ProjectType } from '../../utility/workspace-models'; + +export default function (): Rule { + return updateWorkspace(workspace => { + for (const [, project] of workspace.projects) { + if (project.extensions.projectType !== ProjectType.Application) { + // Only interested in application projects since these changes only effects application builders + continue; + } + + for (const [, target] of project.targets) { + // Only interested in Angular Devkit builders + if (!target?.builder.startsWith('@angular-devkit/build-angular')) { + continue; + } + + // Check options + if (target.options) { + target.options = { + ...updateVendorSourceMap(target.options), + evalSourceMap: undefined, + skipAppShell: undefined, + profile: undefined, + }; + } + + // Go through each configuration entry + if (!target.configurations) { + continue; + } + + for (const configurationName of Object.keys(target.configurations)) { + target.configurations[configurationName] = { + ...updateVendorSourceMap(target.configurations[configurationName]), + evalSourceMap: undefined, + skipAppShell: undefined, + profile: undefined, + }; + } + } + } + }); +} + +type TargetOptions = workspaces.TargetDefinition['options']; + +function updateVendorSourceMap(options: TargetOptions): TargetOptions { + if (!options) { + return {}; + } + + const { vendorSourceMap: vendor, sourceMap = true } = options; + + if (vendor === undefined) { + return options; + } + + if (sourceMap === true) { + return { + ...options, + sourceMap: { + styles: true, + scripts: true, + vendor, + }, + vendorSourceMap: undefined, + }; + } + + if (typeof sourceMap === 'object') { + return { + ...options, + sourceMap: { + ...sourceMap, + vendor, + }, + vendorSourceMap: undefined, + }; + } + + return { + ...options, + vendorSourceMap: undefined, + }; +} diff --git a/packages/schematics/angular/migrations/update-10/update-angular-config_spec.ts b/packages/schematics/angular/migrations/update-10/update-angular-config_spec.ts new file mode 100644 index 000000000000..1379be472d6d --- /dev/null +++ b/packages/schematics/angular/migrations/update-10/update-angular-config_spec.ts @@ -0,0 +1,123 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { JsonObject } from '@angular-devkit/core'; +import { EmptyTree } from '@angular-devkit/schematics'; +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { BuilderTarget, Builders, ProjectType, WorkspaceSchema } from '../../utility/workspace-models'; + +function getBuildTarget(tree: UnitTestTree): BuilderTarget<Builders.Browser, JsonObject> { + return JSON.parse(tree.readContent('/angular.json')).projects.app.architect.build; +} + +function createWorkSpaceConfig(tree: UnitTestTree) { + const angularConfig: WorkspaceSchema = { + version: 1, + projects: { + app: { + root: '', + sourceRoot: 'src', + projectType: ProjectType.Application, + prefix: 'app', + architect: { + build: { + builder: Builders.Browser, + options: { + skipAppShell: true, + sourceMap: true, + vendorSourceMap: true, + evalSourceMap: false, + buildOptimizer: true, + // tslint:disable-next-line:no-any + } as any, + configurations: { + one: { + sourceMap: false, + vendorSourceMap: false, + skipAppShell: false, + evalSourceMap: true, + buildOptimizer: false, + }, + two: { + sourceMap: { + styles: false, + scripts: true, + }, + evalSourceMap: true, + vendorSourceMap: false, + skipAppShell: true, + buildOptimizer: true, + }, + // tslint:disable-next-line:no-any + } as any, + }, + }, + }, + }, + }; + + tree.create('/angular.json', JSON.stringify(angularConfig, undefined, 2)); +} + +describe(`Migration to update 'angular.json'`, () => { + const schematicName = 'update-angular-config'; + + const schematicRunner = new SchematicTestRunner( + 'migrations', + require.resolve('../migration-collection.json'), + ); + + let tree: UnitTestTree; + beforeEach(() => { + tree = new UnitTestTree(new EmptyTree()); + createWorkSpaceConfig(tree); + }); + + it(`should remove 'skipAppShell'`, async () => { + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + const { options, configurations } = getBuildTarget(newTree); + + expect(options.skipAppShell).toBeUndefined(); + expect(configurations).toBeDefined(); + expect(configurations?.one.skipAppShell).toBeUndefined(); + expect(configurations?.two.skipAppShell).toBeUndefined(); + }); + + it(`should remove 'evalSourceMap'`, async () => { + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + const { options, configurations } = getBuildTarget(newTree); + + expect(options.evalSourceMap).toBeUndefined(); + expect(configurations).toBeDefined(); + expect(configurations?.one.evalSourceMap).toBeUndefined(); + expect(configurations?.two.evalSourceMap).toBeUndefined(); + }); + + it(`should remove 'vendorSourceMap' and set 'vendor' option in 'sourceMap'`, async () => { + const newTree = await schematicRunner.runSchematicAsync(schematicName, {}, tree).toPromise(); + const { options, configurations } = getBuildTarget(newTree); + + expect(options.vendorSourceMap).toBeUndefined(); + expect(options.sourceMap).toEqual({ + vendor: true, + scripts: true, + styles: true, + }); + expect(options.vendorSourceMap).toBeUndefined(); + + expect(configurations).toBeDefined(); + expect(configurations?.one.vendorSourceMap).toBeUndefined(); + expect(configurations?.one.sourceMap).toBe(false); + + expect(configurations?.two.vendorSourceMap).toBeUndefined(); + expect(configurations?.two.sourceMap).toEqual({ + vendor: false, + scripts: true, + styles: false, + }); + }); +}); diff --git a/packages/schematics/angular/migrations/update-10/update-dependencies.ts b/packages/schematics/angular/migrations/update-10/update-dependencies.ts index 315d37a14b61..a50952295f2e 100644 --- a/packages/schematics/angular/migrations/update-10/update-dependencies.ts +++ b/packages/schematics/angular/migrations/update-10/update-dependencies.ts @@ -16,6 +16,7 @@ export default function (): Rule { return (host, context) => { const dependenciesToUpdate: Record<string, string> = { 'karma': '~5.0.0', + 'protractor': '~5.4.4', 'ng-packagr': latestVersions.ngPackagr, }; diff --git a/packages/schematics/angular/utility/workspace-models.ts b/packages/schematics/angular/utility/workspace-models.ts index d4392362abb5..c03a857d43f0 100644 --- a/packages/schematics/angular/utility/workspace-models.ts +++ b/packages/schematics/angular/utility/workspace-models.ts @@ -74,15 +74,20 @@ export interface LibraryBuilderOptions { } export interface ServerBuilderOptions { - outputPath: string; - tsConfig: string; - main: string; - fileReplacements?: FileReplacements[]; - optimization?: { - scripts?: boolean; - styles?: boolean; - }; - sourceMap?: boolean; + outputPath: string; + tsConfig: string; + main: string; + fileReplacements?: FileReplacements[]; + optimization?: { + scripts?: boolean; + styles?: boolean; + }; + sourceMap?: boolean | { + scripts?: boolean; + styles?: boolean; + hidden?: boolean; + vendor?: boolean; + }; } export interface AppShellBuilderOptions {
99756614aa6cc5468eae71774a73188f96412664
2020-12-18 13:01:34
Oleksii Potiekhin
fix(@schematics/angular): remove unnecessary scripts and dependencies
false
remove unnecessary scripts and dependencies
fix
diff --git a/packages/schematics/angular/workspace/files/package.json.template b/packages/schematics/angular/workspace/files/package.json.template index c203c22c86e9..89d71a09f536 100644 --- a/packages/schematics/angular/workspace/files/package.json.template +++ b/packages/schematics/angular/workspace/files/package.json.template @@ -4,9 +4,9 @@ "scripts": { "ng": "ng", "start": "ng serve", - "build": "ng build", + "build": "ng build"<% if (!minimal) { %>, "test": "ng test", - "lint": "ng lint" + "lint": "ng lint"<% } %> }, "private": true, "dependencies": { @@ -35,9 +35,9 @@ "karma-coverage": "~2.0.3", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", - "protractor": "~7.0.0",<% } %> + "protractor": "~7.0.0", "ts-node": "~8.3.0", - "tslint": "~6.1.0", + "tslint": "~6.1.0",<% } %> "typescript": "<%= latestVersions.TypeScript %>" } }
bccdf776fb01184be3aac2a221f6f38faede0950
2024-11-25 21:23:23
Angular Robot
build: lock file maintenance
false
lock file maintenance
build
diff --git a/yarn.lock b/yarn.lock index 8d0f4a1f96ad..dfba4c0b04c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3336,7 +3336,18 @@ __metadata: languageName: node linkType: hard -"@microsoft/api-extractor@npm:7.47.11, @microsoft/api-extractor@npm:^7.24.2": +"@microsoft/api-extractor-model@npm:7.30.0": + version: 7.30.0 + resolution: "@microsoft/api-extractor-model@npm:7.30.0" + dependencies: + "@microsoft/tsdoc": "npm:~0.15.1" + "@microsoft/tsdoc-config": "npm:~0.17.1" + "@rushstack/node-core-library": "npm:5.10.0" + checksum: 10c0/845ef107a88de9918e23a22cda95597401751512672c832d6d8a4cc63134e2415ee960d7d4ba7409d1a81569bc1d40f8dbbda76e2655f743a3e7c0595f07c118 + languageName: node + linkType: hard + +"@microsoft/api-extractor@npm:7.47.11": version: 7.47.11 resolution: "@microsoft/api-extractor@npm:7.47.11" dependencies: @@ -3359,22 +3370,45 @@ __metadata: languageName: node linkType: hard -"@microsoft/tsdoc-config@npm:~0.17.0": - version: 0.17.0 - resolution: "@microsoft/tsdoc-config@npm:0.17.0" +"@microsoft/api-extractor@npm:^7.24.2": + version: 7.48.0 + resolution: "@microsoft/api-extractor@npm:7.48.0" + dependencies: + "@microsoft/api-extractor-model": "npm:7.30.0" + "@microsoft/tsdoc": "npm:~0.15.1" + "@microsoft/tsdoc-config": "npm:~0.17.1" + "@rushstack/node-core-library": "npm:5.10.0" + "@rushstack/rig-package": "npm:0.5.3" + "@rushstack/terminal": "npm:0.14.3" + "@rushstack/ts-command-line": "npm:4.23.1" + lodash: "npm:~4.17.15" + minimatch: "npm:~3.0.3" + resolve: "npm:~1.22.1" + semver: "npm:~7.5.4" + source-map: "npm:~0.6.1" + typescript: "npm:5.4.2" + bin: + api-extractor: bin/api-extractor + checksum: 10c0/cc7e582c8b98156033064cb0363d40f4f9bd3bae57506358ce878deefa15655e93502f908e6d697356f3a50207787a874de56c6a357e2964adaebada4d4898cc + languageName: node + linkType: hard + +"@microsoft/tsdoc-config@npm:~0.17.0, @microsoft/tsdoc-config@npm:~0.17.1": + version: 0.17.1 + resolution: "@microsoft/tsdoc-config@npm:0.17.1" dependencies: - "@microsoft/tsdoc": "npm:0.15.0" + "@microsoft/tsdoc": "npm:0.15.1" ajv: "npm:~8.12.0" jju: "npm:~1.4.0" resolve: "npm:~1.22.2" - checksum: 10c0/9aa51b5b0fa93ad5c6a40ed1acf1f25c625b616efe29f2e5fa22ee9bddea12a4a39c833726e11ab592f20cfc9b8c3865978864dd02711d457fa971df3c091847 + checksum: 10c0/a686355796f492f27af17e2a17d615221309caf4d9f9047a5a8f17f8625c467c4c81e2a7923ddafd71b892631d5e5013c4b8cc49c5867d3cc1d260fd90c1413d languageName: node linkType: hard -"@microsoft/tsdoc@npm:0.15.0, @microsoft/tsdoc@npm:~0.15.0": - version: 0.15.0 - resolution: "@microsoft/tsdoc@npm:0.15.0" - checksum: 10c0/6beaf6e01ff54daeba69862cb3d27e03bbabfe299d23d0fade885f5b29bf98af01cecc746d23875fe60ba89514e3b630b71140b1b18d37301096f7a1e35451aa +"@microsoft/tsdoc@npm:0.15.1, @microsoft/tsdoc@npm:~0.15.0, @microsoft/tsdoc@npm:~0.15.1": + version: 0.15.1 + resolution: "@microsoft/tsdoc@npm:0.15.1" + checksum: 10c0/09948691fac56c45a0d1920de478d66a30371a325bd81addc92eea5654d95106ce173c440fea1a1bd5bb95b3a544b6d4def7bb0b5a846c05d043575d8369a20c languageName: node linkType: hard @@ -3767,14 +3801,14 @@ __metadata: linkType: hard "@npmcli/map-workspaces@npm:^4.0.1": - version: 4.0.1 - resolution: "@npmcli/map-workspaces@npm:4.0.1" + version: 4.0.2 + resolution: "@npmcli/map-workspaces@npm:4.0.2" dependencies: "@npmcli/name-from-folder": "npm:^3.0.0" "@npmcli/package-json": "npm:^6.0.0" glob: "npm:^10.2.2" minimatch: "npm:^9.0.0" - checksum: 10c0/adcd53b79a4df239938b25fecdfdc79aaba1cdd470287c582881f13da1216634015d26b3d037af90f59945b7a577a46da3bf8b94d06fcc7992aafb4c1f0d41c8 + checksum: 10c0/26af5e5271c52d0986228583218fa04fcea2e0e1052f0c50f5c7941bbfb7be487cc98c2e6732f0a3f515f6d9228d7dc04414f0471f40a33b748e2b4cbb350b86 languageName: node linkType: hard @@ -3820,7 +3854,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/promise-spawn@npm:^8.0.0, @npmcli/promise-spawn@npm:^8.0.1": +"@npmcli/promise-spawn@npm:^8.0.0, @npmcli/promise-spawn@npm:^8.0.2": version: 8.0.2 resolution: "@npmcli/promise-spawn@npm:8.0.2" dependencies: @@ -4363,16 +4397,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.2" +"@rollup/rollup-android-arm-eabi@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.3" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.3" +"@rollup/rollup-android-arm-eabi@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.27.4" conditions: os=android & cpu=arm languageName: node linkType: hard @@ -4384,16 +4418,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-android-arm64@npm:4.27.2" +"@rollup/rollup-android-arm64@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-android-arm64@npm:4.27.3" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-android-arm64@npm:4.27.3" +"@rollup/rollup-android-arm64@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-android-arm64@npm:4.27.4" conditions: os=android & cpu=arm64 languageName: node linkType: hard @@ -4405,16 +4439,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-darwin-arm64@npm:4.27.2" +"@rollup/rollup-darwin-arm64@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-darwin-arm64@npm:4.27.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-darwin-arm64@npm:4.27.3" +"@rollup/rollup-darwin-arm64@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-darwin-arm64@npm:4.27.4" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard @@ -4426,16 +4460,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-darwin-x64@npm:4.27.2" +"@rollup/rollup-darwin-x64@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-darwin-x64@npm:4.27.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-darwin-x64@npm:4.27.3" +"@rollup/rollup-darwin-x64@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-darwin-x64@npm:4.27.4" conditions: os=darwin & cpu=x64 languageName: node linkType: hard @@ -4447,16 +4481,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.2" +"@rollup/rollup-freebsd-arm64@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.3" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.3" +"@rollup/rollup-freebsd-arm64@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.27.4" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard @@ -4468,16 +4502,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-freebsd-x64@npm:4.27.2" +"@rollup/rollup-freebsd-x64@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-freebsd-x64@npm:4.27.3" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-freebsd-x64@npm:4.27.3" +"@rollup/rollup-freebsd-x64@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-freebsd-x64@npm:4.27.4" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard @@ -4489,16 +4523,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.2" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.3" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.3" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.27.4" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard @@ -4510,16 +4544,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.2" +"@rollup/rollup-linux-arm-musleabihf@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.3" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.3" +"@rollup/rollup-linux-arm-musleabihf@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.27.4" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard @@ -4531,16 +4565,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.2" +"@rollup/rollup-linux-arm64-gnu@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.3" +"@rollup/rollup-linux-arm64-gnu@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.27.4" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard @@ -4552,16 +4586,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.2" +"@rollup/rollup-linux-arm64-musl@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.3" +"@rollup/rollup-linux-arm64-musl@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.27.4" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard @@ -4573,16 +4607,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.2" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.3" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.3" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.27.4" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard @@ -4594,16 +4628,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.2" +"@rollup/rollup-linux-riscv64-gnu@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.3" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.3" +"@rollup/rollup-linux-riscv64-gnu@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.27.4" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard @@ -4615,16 +4649,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.2" +"@rollup/rollup-linux-s390x-gnu@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.3" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.3" +"@rollup/rollup-linux-s390x-gnu@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.27.4" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard @@ -4636,16 +4670,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.2" +"@rollup/rollup-linux-x64-gnu@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.3" +"@rollup/rollup-linux-x64-gnu@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.27.4" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard @@ -4657,16 +4691,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.2" +"@rollup/rollup-linux-x64-musl@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.3" +"@rollup/rollup-linux-x64-musl@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.27.4" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard @@ -4678,16 +4712,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.2" +"@rollup/rollup-win32-arm64-msvc@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.3" +"@rollup/rollup-win32-arm64-msvc@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.27.4" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard @@ -4699,16 +4733,16 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.2" +"@rollup/rollup-win32-ia32-msvc@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.3" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.3" +"@rollup/rollup-win32-ia32-msvc@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.27.4" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard @@ -4720,23 +4754,23 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.27.2": - version: 4.27.2 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.2" +"@rollup/rollup-win32-x64-msvc@npm:4.27.3": + version: 4.27.3 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.27.3": - version: 4.27.3 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.3" +"@rollup/rollup-win32-x64-msvc@npm:4.27.4": + version: 4.27.4 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.27.4" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@rollup/wasm-node@npm:^4.24.0": - version: 4.27.2 - resolution: "@rollup/wasm-node@npm:4.27.2" + version: 4.27.4 + resolution: "@rollup/wasm-node@npm:4.27.4" dependencies: "@types/estree": "npm:1.0.6" fsevents: "npm:~2.3.2" @@ -4745,7 +4779,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/c917e50fc47b1965949b1048f96130bab36d8bb3816cdafbed42d0b2d96452a80fb748b0f99969d179ce86a431c599f693e9455c04e46bba735cc74d4d72a228 + checksum: 10c0/a37111e809950aee3f5a4c314896f0de9c2325d1574640c0a0c51a7baecfd4bda77442dadefca3d015fff35ee8f9b1928231d48ee7697f47ed0a3bb0b2e012d3 languageName: node linkType: hard @@ -4756,6 +4790,27 @@ __metadata: languageName: node linkType: hard +"@rushstack/node-core-library@npm:5.10.0": + version: 5.10.0 + resolution: "@rushstack/node-core-library@npm:5.10.0" + dependencies: + ajv: "npm:~8.13.0" + ajv-draft-04: "npm:~1.0.0" + ajv-formats: "npm:~3.0.1" + fs-extra: "npm:~7.0.1" + import-lazy: "npm:~4.0.0" + jju: "npm:~1.4.0" + resolve: "npm:~1.22.1" + semver: "npm:~7.5.4" + peerDependencies: + "@types/node": "*" + peerDependenciesMeta: + "@types/node": + optional: true + checksum: 10c0/ef379432f1aeea1b19047a3e347e90b03e04331012e5df9cc8233fd6400bdcf801ed4e50ab3e36c211cd3266bbe4c3224205645b5909872a1f29a04a8d8ff3fd + languageName: node + linkType: hard + "@rushstack/node-core-library@npm:5.9.0": version: 5.9.0 resolution: "@rushstack/node-core-library@npm:5.9.0" @@ -4802,6 +4857,21 @@ __metadata: languageName: node linkType: hard +"@rushstack/terminal@npm:0.14.3": + version: 0.14.3 + resolution: "@rushstack/terminal@npm:0.14.3" + dependencies: + "@rushstack/node-core-library": "npm:5.10.0" + supports-color: "npm:~8.1.1" + peerDependencies: + "@types/node": "*" + peerDependenciesMeta: + "@types/node": + optional: true + checksum: 10c0/0eba093d22c6a4d43b3ed9088ee8c354b63f5f28c059f5872251009231bf521ef1a415d33fed0a6572f52a450264de7d73313b0a41c65ab3b5e8c7baf5a82c1e + languageName: node + linkType: hard + "@rushstack/ts-command-line@npm:4.23.0": version: 4.23.0 resolution: "@rushstack/ts-command-line@npm:4.23.0" @@ -4814,6 +4884,18 @@ __metadata: languageName: node linkType: hard +"@rushstack/ts-command-line@npm:4.23.1": + version: 4.23.1 + resolution: "@rushstack/ts-command-line@npm:4.23.1" + dependencies: + "@rushstack/terminal": "npm:0.14.3" + "@types/argparse": "npm:1.0.38" + argparse: "npm:~1.0.9" + string-argv: "npm:~0.3.1" + checksum: 10c0/dc69f502cd3ffbce190e5d6a9a1b85054680d3622933aecd9ef0e81de0aeabb44adcf193586b305733950afa6c36a84a9bacf4382adafd42ba48cb0f003687e7 + languageName: node + linkType: hard + "@schematics/angular@npm:0.0.0-PLACEHOLDER, @schematics/angular@workspace:packages/schematics/angular": version: 0.0.0-use.local resolution: "@schematics/angular@workspace:packages/schematics/angular" @@ -4824,15 +4906,6 @@ __metadata: languageName: unknown linkType: soft -"@sigstore/bundle@npm:^2.3.2": - version: 2.3.2 - resolution: "@sigstore/bundle@npm:2.3.2" - dependencies: - "@sigstore/protobuf-specs": "npm:^0.3.2" - checksum: 10c0/872a95928236bd9950a2ecc66af1c60a82f6b482a62a20d0f817392d568a60739a2432cad70449ac01e44e9eaf85822d6d9ebc6ade6cb3e79a7d62226622eb5d - languageName: node - linkType: hard - "@sigstore/bundle@npm:^3.0.0": version: 3.0.0 resolution: "@sigstore/bundle@npm:3.0.0" @@ -4842,13 +4915,6 @@ __metadata: languageName: node linkType: hard -"@sigstore/core@npm:^1.0.0, @sigstore/core@npm:^1.1.0": - version: 1.1.0 - resolution: "@sigstore/core@npm:1.1.0" - checksum: 10c0/3b3420c1bd17de0371e1ac7c8f07a2cbcd24d6b49ace5bbf2b63f559ee08c4a80622a4d1c0ae42f2c9872166e9cb111f33f78bff763d47e5ef1efc62b8e457ea - languageName: node - linkType: hard - "@sigstore/core@npm:^2.0.0": version: 2.0.0 resolution: "@sigstore/core@npm:2.0.0" @@ -4863,20 +4929,6 @@ __metadata: languageName: node linkType: hard -"@sigstore/sign@npm:^2.3.2": - version: 2.3.2 - resolution: "@sigstore/sign@npm:2.3.2" - dependencies: - "@sigstore/bundle": "npm:^2.3.2" - "@sigstore/core": "npm:^1.0.0" - "@sigstore/protobuf-specs": "npm:^0.3.2" - make-fetch-happen: "npm:^13.0.1" - proc-log: "npm:^4.2.0" - promise-retry: "npm:^2.0.1" - checksum: 10c0/a1e7908f3e4898f04db4d713fa10ddb3ae4f851592c9b554f1269073211e1417528b5088ecee60f27039fde5a5426ae573481d77cfd7e4395d2a0ddfcf5f365f - languageName: node - linkType: hard - "@sigstore/sign@npm:^3.0.0": version: 3.0.0 resolution: "@sigstore/sign@npm:3.0.0" @@ -4891,16 +4943,6 @@ __metadata: languageName: node linkType: hard -"@sigstore/tuf@npm:^2.3.4": - version: 2.3.4 - resolution: "@sigstore/tuf@npm:2.3.4" - dependencies: - "@sigstore/protobuf-specs": "npm:^0.3.2" - tuf-js: "npm:^2.2.1" - checksum: 10c0/97839882d787196517933df5505fae4634975807cc7adcd1783c7840c2a9729efb83ada47556ec326d544b9cb0d1851af990dc46eebb5fe7ea17bf7ce1fc0b8c - languageName: node - linkType: hard - "@sigstore/tuf@npm:^3.0.0": version: 3.0.0 resolution: "@sigstore/tuf@npm:3.0.0" @@ -4911,17 +4953,6 @@ __metadata: languageName: node linkType: hard -"@sigstore/verify@npm:^1.2.1": - version: 1.2.1 - resolution: "@sigstore/verify@npm:1.2.1" - dependencies: - "@sigstore/bundle": "npm:^2.3.2" - "@sigstore/core": "npm:^1.1.0" - "@sigstore/protobuf-specs": "npm:^0.3.2" - checksum: 10c0/af06580a8d5357c31259da1ac7323137054e0ac41e933278d95a4bc409a4463620125cb4c00b502f6bc32fdd68c2293019391b0d31ed921ee3852a9e84358628 - languageName: node - linkType: hard - "@sigstore/verify@npm:^2.0.0": version: 2.0.0 resolution: "@sigstore/verify@npm:2.0.0" @@ -4948,17 +4979,17 @@ __metadata: linkType: hard "@stylistic/eslint-plugin@npm:^2.8.0": - version: 2.10.1 - resolution: "@stylistic/eslint-plugin@npm:2.10.1" + version: 2.11.0 + resolution: "@stylistic/eslint-plugin@npm:2.11.0" dependencies: - "@typescript-eslint/utils": "npm:^8.12.2" + "@typescript-eslint/utils": "npm:^8.13.0" eslint-visitor-keys: "npm:^4.2.0" espree: "npm:^10.3.0" estraverse: "npm:^5.3.0" picomatch: "npm:^4.0.2" peerDependencies: eslint: ">=8.40.0" - checksum: 10c0/55f14f256ffd9e09c417598fbd80cfc6ce603f234a6bd21521d0048a2949f54237394356afe806d461d73013f9e1743d8321fdb0b7716fd1d6d4cba513315f61 + checksum: 10c0/6ca19b6656be5ed657cf4d1920602fb27144dc5d51ba188e0bdcb2a4e0b740d4fdb27052fc268d164fa1269c972aeab15541c9e15b3ff4b7884ecae47f18ff67 languageName: node linkType: hard @@ -5011,16 +5042,6 @@ __metadata: languageName: node linkType: hard -"@tufjs/models@npm:2.0.1": - version: 2.0.1 - resolution: "@tufjs/models@npm:2.0.1" - dependencies: - "@tufjs/canonical-json": "npm:2.0.0" - minimatch: "npm:^9.0.4" - checksum: 10c0/ad9e82fd921954501fd90ed34ae062254637595577ad13fdc1e076405c0ea5ee7d8aebad09e63032972fd92b07f1786c15b24a195a171fc8ac470ca8e2ffbcc4 - languageName: node - linkType: hard - "@tufjs/models@npm:3.0.1": version: 3.0.1 resolution: "@tufjs/models@npm:3.0.1" @@ -5269,14 +5290,14 @@ __metadata: linkType: hard "@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^5.0.0": - version: 5.0.1 - resolution: "@types/express-serve-static-core@npm:5.0.1" + version: 5.0.2 + resolution: "@types/express-serve-static-core@npm:5.0.2" dependencies: "@types/node": "npm:*" "@types/qs": "npm:*" "@types/range-parser": "npm:*" "@types/send": "npm:*" - checksum: 10c0/42919f9de55e9fd1524dc72c2f06a3f3e7fbd21f42ccc6e71ea2d530c8942cc0004d468f09e8557bf51c585d9673efd455b9668c2cd2416f5d61e70dc1bc49ac + checksum: 10c0/9f6ee50bd81f0aa6cc9df6ad2c2d221a3a63249da944db58ec8bb8681e77a5b3b3fdb1931bda73beb13cfaf9125731f835fe5256afb6a6da35b0eb08ccbdbfdf languageName: node linkType: hard @@ -5461,9 +5482,9 @@ __metadata: linkType: hard "@types/less@npm:^3.0.3": - version: 3.0.6 - resolution: "@types/less@npm:3.0.6" - checksum: 10c0/07109689295d1ce88158f52f799b71925121b2e5ae4dd58c3f23709b1e0b76e8c145f052f883bc3e06cc52d42f173706fcedbc23d9c49b6895b4cf357965d21f + version: 3.0.7 + resolution: "@types/less@npm:3.0.7" + checksum: 10c0/773251ea228cc84171e5fafe27a2ea7051db8c65aa9e9278a1ba4b7d38d9fb752dc0bd1f767fe0c5517e7330ebb82c8205008f9ce6a8dd3a0f97a2ddd18af042 languageName: node linkType: hard @@ -5533,11 +5554,11 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>=10.0.0": - version: 22.9.0 - resolution: "@types/node@npm:22.9.0" + version: 22.9.3 + resolution: "@types/node@npm:22.9.3" dependencies: undici-types: "npm:~6.19.8" - checksum: 10c0/3f46cbe0a49bab4ba30494025e4c8a6e699b98ac922857aa1f0209ce11a1313ee46e6808b8f13fe5b8b960a9d7796b77c8d542ad4e9810e85ef897d5593b5d51 + checksum: 10c0/954ec72bf29436ea62425a9563914a9c1e93f97b18194acd51d74d13998a701977547ed2985ed3a0e97211b785436d28377116e5f613bfcf3182d9bd81d784dc languageName: node linkType: hard @@ -5558,11 +5579,11 @@ __metadata: linkType: hard "@types/node@npm:^18.13.0, @types/node@npm:^18.19.21": - version: 18.19.64 - resolution: "@types/node@npm:18.19.64" + version: 18.19.65 + resolution: "@types/node@npm:18.19.65" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/a54009cd222f5751c903e5f4889a0f12e3d3755a1f87ce919455eeaf00a9ba0c9215c4a92bc3d8df585a894fa3e4cf218e5afccced355688624133e1a4b88235 + checksum: 10c0/9c093f13749dccd16a3e9cd17080db057d1e94cb5205a871d2818ad51ec19d7d392a7c12a11661c6a6f4404cbd85b19d09ab6c564a4763cab2ff5bb0e198617d languageName: node linkType: hard @@ -5979,16 +6000,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.14.0": - version: 8.14.0 - resolution: "@typescript-eslint/scope-manager@npm:8.14.0" - dependencies: - "@typescript-eslint/types": "npm:8.14.0" - "@typescript-eslint/visitor-keys": "npm:8.14.0" - checksum: 10c0/1e1295c6f9febadf63559aad328b23d960510ce6b4c9f74e10d881c3858fa7f1db767cd1af5272d2fe7c9c5c7daebee71854e6f841e413e5d70af282f6616e26 - languageName: node - linkType: hard - "@typescript-eslint/scope-manager@npm:8.15.0": version: 8.15.0 resolution: "@typescript-eslint/scope-manager@npm:8.15.0" @@ -6016,13 +6027,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:8.14.0": - version: 8.14.0 - resolution: "@typescript-eslint/types@npm:8.14.0" - checksum: 10c0/7707f900e24e60e6780c5705f69627b7c0ef912cb3b095dfc8f4a0c84e866c66b1c4c10278cf99724560dc66985ec640750c4192786a09b853f9bb4c3ca5a7ce - languageName: node - linkType: hard - "@typescript-eslint/types@npm:8.15.0": version: 8.15.0 resolution: "@typescript-eslint/types@npm:8.15.0" @@ -6030,25 +6034,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.14.0": - version: 8.14.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.14.0" - dependencies: - "@typescript-eslint/types": "npm:8.14.0" - "@typescript-eslint/visitor-keys": "npm:8.14.0" - debug: "npm:^4.3.4" - fast-glob: "npm:^3.3.2" - is-glob: "npm:^4.0.3" - minimatch: "npm:^9.0.4" - semver: "npm:^7.6.0" - ts-api-utils: "npm:^1.3.0" - peerDependenciesMeta: - typescript: - optional: true - checksum: 10c0/5e890d22bd067095f871cf144907a8c302db5b5f014c58906ad58d7f23569951cba805042eac6844744e5abb0d3648c9cc221a91b0703da0a8d6345dc1f83e74 - languageName: node - linkType: hard - "@typescript-eslint/typescript-estree@npm:8.15.0": version: 8.15.0 resolution: "@typescript-eslint/typescript-estree@npm:8.15.0" @@ -6068,7 +6053,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.15.0": +"@typescript-eslint/utils@npm:8.15.0, @typescript-eslint/utils@npm:^8.13.0": version: 8.15.0 resolution: "@typescript-eslint/utils@npm:8.15.0" dependencies: @@ -6085,30 +6070,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:^8.12.2": - version: 8.14.0 - resolution: "@typescript-eslint/utils@npm:8.14.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.14.0" - "@typescript-eslint/types": "npm:8.14.0" - "@typescript-eslint/typescript-estree": "npm:8.14.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - checksum: 10c0/1fcc2651d870832a799a5d1c85fc9421853508a006d6a6073c8316b012489dda77e123d13aea8f53eb9030a2da2c0eb273a6946a9941caa2519b99b33e89b720 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:8.14.0": - version: 8.14.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.14.0" - dependencies: - "@typescript-eslint/types": "npm:8.14.0" - eslint-visitor-keys: "npm:^3.4.3" - checksum: 10c0/d0faf70ed9ecff5e36694bbb161a90bea6db59e0e79a7d4f264d67d565c12b13733d664b736b2730935f013c87ce3155cea954a533d28e99987681bc5f6259c3 - languageName: node - linkType: hard - "@typescript-eslint/visitor-keys@npm:8.15.0": version: 8.15.0 resolution: "@typescript-eslint/visitor-keys@npm:8.15.0" @@ -7493,11 +7454,11 @@ __metadata: linkType: hard "bare-stream@npm:^2.0.0": - version: 2.3.2 - resolution: "bare-stream@npm:2.3.2" + version: 2.4.2 + resolution: "bare-stream@npm:2.4.2" dependencies: streamx: "npm:^2.20.0" - checksum: 10c0/e2bda606c2cbd6acbb2558d9a5f6d2d4bc08fb635d32d599bc8e74c1d2298c956decf6a3a820e485a760bb73b8a7f0e743ec5262f08cccbaf5eeb599253d4221 + checksum: 10c0/5e64d96dc32d901c317399f14fd1057882b2bd68d1f8ab54710f0e640b0d1f3a4bf4f9c238bb4c81051ef4b687cf2223e5e05dda9f6ce08bc0cc2ac98f3b52e0 languageName: node linkType: hard @@ -7652,12 +7613,12 @@ __metadata: linkType: hard "bonjour-service@npm:^1.2.1": - version: 1.2.1 - resolution: "bonjour-service@npm:1.2.1" + version: 1.3.0 + resolution: "bonjour-service@npm:1.3.0" dependencies: fast-deep-equal: "npm:^3.1.3" multicast-dns: "npm:^7.2.5" - checksum: 10c0/953cbfc27fc9e36e6f988012993ab2244817d82426603e0390d4715639031396c932b6657b1aa4ec30dbb5fa903d6b2c7f1be3af7a8ba24165c93e987c849730 + checksum: 10c0/5721fd9f9bb968e9cc16c1e8116d770863dd2329cb1f753231de1515870648c225142b7eefa71f14a5c22bc7b37ddd7fdeb018700f28a8c936d50d4162d433c7 languageName: node linkType: hard @@ -7978,9 +7939,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001646, caniuse-lite@npm:^1.0.30001669": - version: 1.0.30001680 - resolution: "caniuse-lite@npm:1.0.30001680" - checksum: 10c0/11a4e7f6f5d5f965cfd4b7dc4aef34e12a26e99647f02b5ac9fd7f7670845473b95ada416a785473237e4b1b67281f7b043c8736c85b77097f6b697e8950b15f + version: 1.0.30001684 + resolution: "caniuse-lite@npm:1.0.30001684" + checksum: 10c0/446485ca3d9caf408a339a44636a86a2b119ec247492393ae661cd93dccd6668401dd2dfec1e149be4e44563cd1e23351b44453a52fa2c2f19e2bf3287c865f6 languageName: node linkType: hard @@ -8133,7 +8094,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^4.0.0": +"ci-info@npm:^4.0.0, ci-info@npm:^4.1.0": version: 4.1.0 resolution: "ci-info@npm:4.1.0" checksum: 10c0/0f969ce32a974c542bc8abe4454b220d9d9323bb9415054c92a900faa5fdda0bb222eda68c490127c1d78503510d46b6aca614ecaba5a60515b8ac7e170119e6 @@ -8654,13 +8615,13 @@ __metadata: linkType: hard "cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.5 - resolution: "cross-spawn@npm:7.0.5" + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" dependencies: path-key: "npm:^3.1.0" shebang-command: "npm:^2.0.0" which: "npm:^2.0.1" - checksum: 10c0/aa82ce7ac0814a27e6f2b738c5a7cf1fa21a3558a1e42df449fc96541ba3ba731e4d3ecffa4435348808a86212f287c6f20a1ee551ef1ff95d01cfec5f434944 + checksum: 10c0/053ea8b2135caff68a9e81470e845613e374e7309a47731e81639de3eaeb90c3d01af0e0b44d2ab9d50b43467223b88567dfeb3262db942dc063b9976718ffc1 languageName: node linkType: hard @@ -9260,9 +9221,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.41": - version: 1.5.62 - resolution: "electron-to-chromium@npm:1.5.62" - checksum: 10c0/93dc628f0359df0cae475cf5e91fa0cf357611f14da7cf15c28fe92f89dede7def20c04b24787e6166181ae582b060d02b252e906d7ec84020485579a95bc8e9 + version: 1.5.64 + resolution: "electron-to-chromium@npm:1.5.64" + checksum: 10c0/331c2160cc37ef85317b44f2078af8ff16f068fc95d4af2210fe943b567f20b1445a7faa40c05d290bc229102ef1b662371464ba2725d10ff6c8543af6d40adf languageName: node linkType: hard @@ -9447,7 +9408,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": +"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.5": version: 1.23.5 resolution: "es-abstract@npm:1.23.5" dependencies: @@ -10467,9 +10428,9 @@ __metadata: linkType: hard "flatted@npm:^3.2.7, flatted@npm:^3.2.9": - version: 3.3.1 - resolution: "flatted@npm:3.3.1" - checksum: 10c0/324166b125ee07d4ca9bcf3a5f98d915d5db4f39d711fba640a3178b959919aae1f7cfd8aabcfef5826ed8aa8a2aa14cc85b2d7d18ff638ddf4ae3df39573eaf + version: 3.3.2 + resolution: "flatted@npm:3.3.2" + checksum: 10c0/24cc735e74d593b6c767fe04f2ef369abe15b62f6906158079b9874bdb3ee5ae7110bb75042e70cd3f99d409d766f357caf78d5ecee9780206f5fdc5edbad334 languageName: node linkType: hard @@ -11154,12 +11115,12 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^8.0.0": - version: 8.0.0 - resolution: "hosted-git-info@npm:8.0.0" +"hosted-git-info@npm:^8.0.0, hosted-git-info@npm:^8.0.2": + version: 8.0.2 + resolution: "hosted-git-info@npm:8.0.2" dependencies: lru-cache: "npm:^10.0.1" - checksum: 10c0/3eb932a99e8a3c7f3a4513a5a61b81d0789741abf41ebb2d9679644e4b4c730c68e1925fbaeae2c6b35eb0bab57a59027b89c21ab588981c8b0989c454adde46 + checksum: 10c0/e64f6c1b6db625869934b35c4959aacc365799d9cb1856e0224b5557ee5ecfe224bb8aa850479179a8f3968063ea0f92b8fbb67fe009d46859431dcde7fdc36d languageName: node linkType: hard @@ -11497,9 +11458,9 @@ __metadata: linkType: hard "immutable@npm:^5.0.2": - version: 5.0.2 - resolution: "immutable@npm:5.0.2" - checksum: 10c0/0d97ad95384e49563b6ed68f90e5ea83c149fd96ff417fae8274e1c524e3ef800eb1a2e8009e29d9b8ffdf63affd7692f87c8af72714181aad8dca88747fb5ac + version: 5.0.3 + resolution: "immutable@npm:5.0.3" + checksum: 10c0/3269827789e1026cd25c2ea97f0b2c19be852ffd49eda1b674b20178f73d84fa8d945ad6f5ac5bc4545c2b4170af9f6e1f77129bc1cae7974a4bf9b04a9cdfb9 languageName: node linkType: hard @@ -11688,6 +11649,15 @@ __metadata: languageName: node linkType: hard +"is-async-function@npm:^2.0.0": + version: 2.0.0 + resolution: "is-async-function@npm:2.0.0" + dependencies: + has-tostringtag: "npm:^1.0.0" + checksum: 10c0/787bc931576aad525d751fc5ce211960fe91e49ac84a5c22d6ae0bc9541945fbc3f686dc590c3175722ce4f6d7b798a93f6f8ff4847fdb2199aea6f4baf5d668 + languageName: node + linkType: hard + "is-bigint@npm:^1.0.1": version: 1.0.4 resolution: "is-bigint@npm:1.0.4" @@ -11759,7 +11729,7 @@ __metadata: languageName: node linkType: hard -"is-date-object@npm:^1.0.1": +"is-date-object@npm:^1.0.1, is-date-object@npm:^1.0.5": version: 1.0.5 resolution: "is-date-object@npm:1.0.5" dependencies: @@ -11800,6 +11770,15 @@ __metadata: languageName: node linkType: hard +"is-finalizationregistry@npm:^1.1.0": + version: 1.1.0 + resolution: "is-finalizationregistry@npm:1.1.0" + dependencies: + call-bind: "npm:^1.0.7" + checksum: 10c0/1cd94236bfb6e060fe2b973c8726a2782727f7d495b3e8e1d51d3e619c5a3345413706f555956eb5b12af15eba0414118f64a1b19d793ec36b5e6767a13836ac + languageName: node + linkType: hard + "is-fullwidth-code-point@npm:^3.0.0": version: 3.0.0 resolution: "is-fullwidth-code-point@npm:3.0.0" @@ -11823,7 +11802,7 @@ __metadata: languageName: node linkType: hard -"is-generator-function@npm:^1.0.7": +"is-generator-function@npm:^1.0.10, is-generator-function@npm:^1.0.7": version: 1.0.10 resolution: "is-generator-function@npm:1.0.10" dependencies: @@ -11882,6 +11861,13 @@ __metadata: languageName: node linkType: hard +"is-map@npm:^2.0.3": + version: 2.0.3 + resolution: "is-map@npm:2.0.3" + checksum: 10c0/2c4d431b74e00fdda7162cd8e4b763d6f6f217edf97d4f8538b94b8702b150610e2c64961340015fe8df5b1fcee33ccd2e9b62619c4a8a3a155f8de6d6d355fc + languageName: node + linkType: hard + "is-module@npm:^1.0.0": version: 1.0.0 resolution: "is-module@npm:1.0.0" @@ -12009,6 +11995,13 @@ __metadata: languageName: node linkType: hard +"is-set@npm:^2.0.3": + version: 2.0.3 + resolution: "is-set@npm:2.0.3" + checksum: 10c0/f73732e13f099b2dc879c2a12341cfc22ccaca8dd504e6edae26484bd5707a35d503fba5b4daad530a9b088ced1ae6c9d8200fd92e09b428fe14ea79ce8080b7 + languageName: node + linkType: hard + "is-shared-array-buffer@npm:^1.0.2, is-shared-array-buffer@npm:^1.0.3": version: 1.0.3 resolution: "is-shared-array-buffer@npm:1.0.3" @@ -12080,6 +12073,13 @@ __metadata: languageName: node linkType: hard +"is-weakmap@npm:^2.0.2": + version: 2.0.2 + resolution: "is-weakmap@npm:2.0.2" + checksum: 10c0/443c35bb86d5e6cc5929cd9c75a4024bb0fff9586ed50b092f94e700b89c43a33b186b76dbc6d54f3d3d09ece689ab38dcdc1af6a482cbe79c0f2da0a17f1299 + languageName: node + linkType: hard + "is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" @@ -12089,6 +12089,16 @@ __metadata: languageName: node linkType: hard +"is-weakset@npm:^2.0.3": + version: 2.0.3 + resolution: "is-weakset@npm:2.0.3" + dependencies: + call-bind: "npm:^1.0.7" + get-intrinsic: "npm:^1.2.4" + checksum: 10c0/8ad6141b6a400e7ce7c7442a13928c676d07b1f315ab77d9912920bf5f4170622f43126f111615788f26c3b1871158a6797c862233124507db0bcc33a9537d1a + languageName: node + linkType: hard + "is-what@npm:^3.14.1": version: 3.14.1 resolution: "is-what@npm:3.14.1" @@ -13023,9 +13033,9 @@ __metadata: languageName: node linkType: hard -"libnpmpublish@npm:^10.0.0": - version: 10.0.0 - resolution: "libnpmpublish@npm:10.0.0" +"libnpmpublish@npm:^10.0.1": + version: 10.0.1 + resolution: "libnpmpublish@npm:10.0.1" dependencies: ci-info: "npm:^4.0.0" normalize-package-data: "npm:^7.0.0" @@ -13033,9 +13043,9 @@ __metadata: npm-registry-fetch: "npm:^18.0.1" proc-log: "npm:^5.0.0" semver: "npm:^7.3.7" - sigstore: "npm:^2.2.0" + sigstore: "npm:^3.0.0" ssri: "npm:^12.0.0" - checksum: 10c0/305d460f7bea3e7df4c05abb8a3b3cde8643cad0c39cc87ac51db126c920fa81de99d87fe14c63888727de668bde0f6c8e947ff6253dd9da8bab96bb95c2687f + checksum: 10c0/9420382ab7a80541274d6bba77fc1d96b195c00141ca5ea4cf198814b88e6bda4463a05c5a7e95a9956ff5890fe7dba349518ca06538d31f01bf677c5703247e languageName: node linkType: hard @@ -13468,7 +13478,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:0.30.12, magic-string@npm:^0.30.0, magic-string@npm:^0.30.3": +"magic-string@npm:0.30.12": version: 0.30.12 resolution: "magic-string@npm:0.30.12" dependencies: @@ -13477,7 +13487,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:0.30.13": +"magic-string@npm:0.30.13, magic-string@npm:^0.30.0, magic-string@npm:^0.30.3": version: 0.30.13 resolution: "magic-string@npm:0.30.13" dependencies: @@ -13521,7 +13531,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^13.0.0, make-fetch-happen@npm:^13.0.1": +"make-fetch-happen@npm:^13.0.0": version: 13.0.1 resolution: "make-fetch-happen@npm:13.0.1" dependencies: @@ -13541,7 +13551,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^14.0.0, make-fetch-happen@npm:^14.0.1": +"make-fetch-happen@npm:^14.0.0, make-fetch-happen@npm:^14.0.1, make-fetch-happen@npm:^14.0.3": version: 14.0.3 resolution: "make-fetch-happen@npm:14.0.3" dependencies: @@ -14306,12 +14316,12 @@ __metadata: languageName: node linkType: hard -"npm-install-checks@npm:^7.1.0": - version: 7.1.0 - resolution: "npm-install-checks@npm:7.1.0" +"npm-install-checks@npm:^7.1.0, npm-install-checks@npm:^7.1.1": + version: 7.1.1 + resolution: "npm-install-checks@npm:7.1.1" dependencies: semver: "npm:^7.1.1" - checksum: 10c0/65e2e11f4846fba5aebe34b9260daedf3d7dd006cd40e3056ef62528d39f76a33cbfaef5ae94b6c88707770aba6177ab390470e7fa3c1b10772a8cc7b4ed372d + checksum: 10c0/3cfd705ef3f70add31a32b4a5462d16e0f06d9df636072483fb43c854414a1cc128f496e84a8d9c12c1f1820307b7a3c275643589c564dac3c870eb636f8eea4 languageName: node linkType: hard @@ -14365,7 +14375,7 @@ __metadata: languageName: node linkType: hard -"npm-registry-fetch@npm:^18.0.0, npm-registry-fetch@npm:^18.0.1": +"npm-registry-fetch@npm:^18.0.0, npm-registry-fetch@npm:^18.0.1, npm-registry-fetch@npm:^18.0.2": version: 18.0.2 resolution: "npm-registry-fetch@npm:18.0.2" dependencies: @@ -14398,8 +14408,8 @@ __metadata: linkType: hard "npm@npm:^10.8.1": - version: 10.9.0 - resolution: "npm@npm:10.9.0" + version: 10.9.1 + resolution: "npm@npm:10.9.1" dependencies: "@isaacs/string-locale-compare": "npm:^1.1.0" "@npmcli/arborist": "npm:^8.0.0" @@ -14407,21 +14417,21 @@ __metadata: "@npmcli/fs": "npm:^4.0.0" "@npmcli/map-workspaces": "npm:^4.0.1" "@npmcli/package-json": "npm:^6.0.1" - "@npmcli/promise-spawn": "npm:^8.0.1" + "@npmcli/promise-spawn": "npm:^8.0.2" "@npmcli/redact": "npm:^3.0.0" "@npmcli/run-script": "npm:^9.0.1" - "@sigstore/tuf": "npm:^2.3.4" + "@sigstore/tuf": "npm:^3.0.0" abbrev: "npm:^3.0.0" archy: "npm:~1.0.0" cacache: "npm:^19.0.1" chalk: "npm:^5.3.0" - ci-info: "npm:^4.0.0" + ci-info: "npm:^4.1.0" cli-columns: "npm:^4.0.0" fastest-levenshtein: "npm:^1.0.16" fs-minipass: "npm:^3.0.3" glob: "npm:^10.4.5" graceful-fs: "npm:^4.2.11" - hosted-git-info: "npm:^8.0.0" + hosted-git-info: "npm:^8.0.2" ini: "npm:^5.0.0" init-package-json: "npm:^7.0.1" is-cidr: "npm:^5.1.0" @@ -14433,11 +14443,11 @@ __metadata: libnpmhook: "npm:^11.0.0" libnpmorg: "npm:^7.0.0" libnpmpack: "npm:^8.0.0" - libnpmpublish: "npm:^10.0.0" + libnpmpublish: "npm:^10.0.1" libnpmsearch: "npm:^8.0.0" libnpmteam: "npm:^7.0.0" libnpmversion: "npm:^7.0.0" - make-fetch-happen: "npm:^14.0.1" + make-fetch-happen: "npm:^14.0.3" minimatch: "npm:^9.0.5" minipass: "npm:^7.1.1" minipass-pipeline: "npm:^1.2.4" @@ -14446,14 +14456,14 @@ __metadata: nopt: "npm:^8.0.0" normalize-package-data: "npm:^7.0.0" npm-audit-report: "npm:^6.0.0" - npm-install-checks: "npm:^7.1.0" + npm-install-checks: "npm:^7.1.1" npm-package-arg: "npm:^12.0.0" npm-pick-manifest: "npm:^10.0.0" npm-profile: "npm:^11.0.1" - npm-registry-fetch: "npm:^18.0.1" + npm-registry-fetch: "npm:^18.0.2" npm-user-validate: "npm:^3.0.0" p-map: "npm:^4.0.0" - pacote: "npm:^19.0.0" + pacote: "npm:^19.0.1" parse-conflict-json: "npm:^4.0.0" proc-log: "npm:^5.0.0" qrcode-terminal: "npm:^0.12.0" @@ -14472,7 +14482,7 @@ __metadata: bin: npm: bin/npm-cli.js npx: bin/npx-cli.js - checksum: 10c0/87ef0e9dd6ac9574c470777ccbf848822184b0aa28e9743bea14988f8b3f6a737a357205cd5048cc6b5657a4be248621192fdcc37656e1d8438eeba6b20a7f73 + checksum: 10c0/66b6eeb99844accbd07be63cc2c48aeb6ddb8adc2b429cd473fb412e4d6c9d66cbbc130839199ad494116c6766bbe39054ed93fe5b5696bda818037760766813 languageName: node linkType: hard @@ -14899,7 +14909,7 @@ __metadata: languageName: node linkType: hard -"pacote@npm:^19.0.0": +"pacote@npm:^19.0.0, pacote@npm:^19.0.1": version: 19.0.1 resolution: "pacote@npm:19.0.1" dependencies: @@ -15636,11 +15646,11 @@ __metadata: linkType: hard "psl@npm:^1.1.28, psl@npm:^1.1.33": - version: 1.10.0 - resolution: "psl@npm:1.10.0" + version: 1.13.0 + resolution: "psl@npm:1.13.0" dependencies: punycode: "npm:^2.3.1" - checksum: 10c0/aeac84ed76a170caa8dafad2e51200d38b657fdab3ae258d98fa16db8bb82522dfb00ad96db99c493f185848d9be06b59d5d60551d871e5be1974a2497d8b51a + checksum: 10c0/d259dd6fdbc720267f78d26139e197f6a1a0f6505753ed28309515b108d9acd764a873af9045de75884f6816c3c854d90552984132a981fac2f032b443e32b4b languageName: node linkType: hard @@ -15708,8 +15718,8 @@ __metadata: linkType: hard "puppeteer-core@npm:^23.2.0": - version: 23.8.0 - resolution: "puppeteer-core@npm:23.8.0" + version: 23.9.0 + resolution: "puppeteer-core@npm:23.9.0" dependencies: "@puppeteer/browsers": "npm:2.4.1" chromium-bidi: "npm:0.8.0" @@ -15717,7 +15727,7 @@ __metadata: devtools-protocol: "npm:0.0.1367902" typed-query-selector: "npm:^2.12.0" ws: "npm:^8.18.0" - checksum: 10c0/6282881e6be1535082f879ccf585e02cb22fde5ce45072d71a8a1fcad5e9be3d27157e8be4728bec2344b300aa96437c4c820a00e01f1577f27b971980e1bced + checksum: 10c0/1cb6e084059a94929f39ca458eec45b258f1ffbeb904ed689e2b915fd48741aa6aecf98129edf6426773316d204b3795a937da590bb65a635b6c8fd3e4feae11 languageName: node linkType: hard @@ -15977,6 +15987,21 @@ __metadata: languageName: node linkType: hard +"reflect.getprototypeof@npm:^1.0.6": + version: 1.0.7 + resolution: "reflect.getprototypeof@npm:1.0.7" + dependencies: + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.5" + es-errors: "npm:^1.3.0" + get-intrinsic: "npm:^1.2.4" + gopd: "npm:^1.0.1" + which-builtin-type: "npm:^1.1.4" + checksum: 10c0/841814f7631b55ee42e198cb14a5c25c0752431ab8f0ad9794c32d46ab9fb0d5ba4939edac1f99a174a21443a1400a72bccbbb9ccd9277e4b4bf6d14aabb31c8 + languageName: node + linkType: hard + "regenerate-unicode-properties@npm:^10.2.0": version: 10.2.0 resolution: "regenerate-unicode-properties@npm:10.2.0" @@ -16029,16 +16054,16 @@ __metadata: linkType: hard "regexpu-core@npm:^6.1.1": - version: 6.1.1 - resolution: "regexpu-core@npm:6.1.1" + version: 6.2.0 + resolution: "regexpu-core@npm:6.2.0" dependencies: regenerate: "npm:^1.4.2" regenerate-unicode-properties: "npm:^10.2.0" regjsgen: "npm:^0.8.0" - regjsparser: "npm:^0.11.0" + regjsparser: "npm:^0.12.0" unicode-match-property-ecmascript: "npm:^2.0.0" unicode-match-property-value-ecmascript: "npm:^2.1.0" - checksum: 10c0/07d49697e20f9b65977535abba4858b7f5171c13f7c366be53ec1886d3d5f69f1b98cc6a6e63cf271adda077c3366a4c851c7473c28bbd69cf5a6b6b008efc3e + checksum: 10c0/bbcb83a854bf96ce4005ee4e4618b71c889cda72674ce6092432f0039b47890c2d0dfeb9057d08d440999d9ea03879ebbb7f26ca005ccf94390e55c348859b98 languageName: node linkType: hard @@ -16049,14 +16074,14 @@ __metadata: languageName: node linkType: hard -"regjsparser@npm:^0.11.0": - version: 0.11.2 - resolution: "regjsparser@npm:0.11.2" +"regjsparser@npm:^0.12.0": + version: 0.12.0 + resolution: "regjsparser@npm:0.12.0" dependencies: jsesc: "npm:~3.0.2" bin: regjsparser: bin/parser - checksum: 10c0/764e762de1b26a0cf48b45728fc1b2087f9c55bd4cea858cce28e4d5544c237f3f2dd6d40e2c41b80068e9cb92cc7d731a4285bc1f27d6ebc227792c70e4af1b + checksum: 10c0/99d3e4e10c8c7732eb7aa843b8da2fd8b647fe144d3711b480e4647dc3bff4b1e96691ccf17f3ace24aa866a50b064236177cb25e6e4fbbb18285d99edaed83b languageName: node linkType: hard @@ -16440,27 +16465,27 @@ __metadata: linkType: hard "rollup@npm:^4.20.0, rollup@npm:^4.24.0, rollup@npm:^4.4.0": - version: 4.27.2 - resolution: "rollup@npm:4.27.2" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.27.2" - "@rollup/rollup-android-arm64": "npm:4.27.2" - "@rollup/rollup-darwin-arm64": "npm:4.27.2" - "@rollup/rollup-darwin-x64": "npm:4.27.2" - "@rollup/rollup-freebsd-arm64": "npm:4.27.2" - "@rollup/rollup-freebsd-x64": "npm:4.27.2" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.27.2" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.27.2" - "@rollup/rollup-linux-arm64-gnu": "npm:4.27.2" - "@rollup/rollup-linux-arm64-musl": "npm:4.27.2" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.27.2" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.27.2" - "@rollup/rollup-linux-s390x-gnu": "npm:4.27.2" - "@rollup/rollup-linux-x64-gnu": "npm:4.27.2" - "@rollup/rollup-linux-x64-musl": "npm:4.27.2" - "@rollup/rollup-win32-arm64-msvc": "npm:4.27.2" - "@rollup/rollup-win32-ia32-msvc": "npm:4.27.2" - "@rollup/rollup-win32-x64-msvc": "npm:4.27.2" + version: 4.27.4 + resolution: "rollup@npm:4.27.4" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.27.4" + "@rollup/rollup-android-arm64": "npm:4.27.4" + "@rollup/rollup-darwin-arm64": "npm:4.27.4" + "@rollup/rollup-darwin-x64": "npm:4.27.4" + "@rollup/rollup-freebsd-arm64": "npm:4.27.4" + "@rollup/rollup-freebsd-x64": "npm:4.27.4" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.27.4" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.27.4" + "@rollup/rollup-linux-arm64-gnu": "npm:4.27.4" + "@rollup/rollup-linux-arm64-musl": "npm:4.27.4" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.27.4" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.27.4" + "@rollup/rollup-linux-s390x-gnu": "npm:4.27.4" + "@rollup/rollup-linux-x64-gnu": "npm:4.27.4" + "@rollup/rollup-linux-x64-musl": "npm:4.27.4" + "@rollup/rollup-win32-arm64-msvc": "npm:4.27.4" + "@rollup/rollup-win32-ia32-msvc": "npm:4.27.4" + "@rollup/rollup-win32-x64-msvc": "npm:4.27.4" "@types/estree": "npm:1.0.6" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -16504,7 +16529,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/563c43d064b7af64156621b52997d2c8a4609774dea4deb06c0fbc1f18450f1b65036404224e81a6bbc80a316a558452151fe9be2214b1898aa66bdd93209496 + checksum: 10c0/1442650cfea5e4617ce14743784f6f578817e31db56f9c8aaf96a82daa9bc20b6ccd66c0d677dbf302a4da3e70664dc3bef11a1aec85e6aff3cecccb945b1d35 languageName: node linkType: hard @@ -17008,20 +17033,6 @@ __metadata: languageName: node linkType: hard -"sigstore@npm:^2.2.0": - version: 2.3.1 - resolution: "sigstore@npm:2.3.1" - dependencies: - "@sigstore/bundle": "npm:^2.3.2" - "@sigstore/core": "npm:^1.0.0" - "@sigstore/protobuf-specs": "npm:^0.3.2" - "@sigstore/sign": "npm:^2.3.2" - "@sigstore/tuf": "npm:^2.3.4" - "@sigstore/verify": "npm:^1.2.1" - checksum: 10c0/8906b1074130d430d707e46f15c66eb6996891dc0d068705f1884fb1251a4a367f437267d44102cdebcee34f1768b3f30131a2ec8fb7aac74ba250903a459aa7 - languageName: node - linkType: hard - "sigstore@npm:^3.0.0": version: 3.0.0 resolution: "sigstore@npm:3.0.0" @@ -18056,11 +18067,11 @@ __metadata: linkType: hard "ts-api-utils@npm:^1.3.0": - version: 1.4.0 - resolution: "ts-api-utils@npm:1.4.0" + version: 1.4.1 + resolution: "ts-api-utils@npm:1.4.1" peerDependencies: typescript: ">=4.2.0" - checksum: 10c0/1b2bfa50ea52771d564bb143bb69010d25cda03ed573095fbac9b86f717012426443af6647e00e3db70fca60360482a30c1be7cf73c3521c321f6bf5e3594ea0 + checksum: 10c0/11a2c4b280ead1026722bd2dd5cbfd8a88d06adcbf6ade8ce92914bd4828c08b384cf9f98cf652bd41d61320604186c5ed60f3077bc9cb8a8c44e9ceae29d0e8 languageName: node linkType: hard @@ -18146,17 +18157,6 @@ __metadata: languageName: node linkType: hard -"tuf-js@npm:^2.2.1": - version: 2.2.1 - resolution: "tuf-js@npm:2.2.1" - dependencies: - "@tufjs/models": "npm:2.0.1" - debug: "npm:^4.3.4" - make-fetch-happen: "npm:^13.0.1" - checksum: 10c0/7c17b097571f001730d7be0aeaec6bec46ed2f25bf73990b1133c383d511a1ce65f831e5d6d78770940a85b67664576ff0e4c98e5421bab6d33ff36e4be500c8 - languageName: node - linkType: hard - "tuf-js@npm:^3.0.1": version: 3.0.1 resolution: "tuf-js@npm:3.0.1" @@ -18249,8 +18249,8 @@ __metadata: linkType: hard "typed-array-byte-offset@npm:^1.0.2": - version: 1.0.2 - resolution: "typed-array-byte-offset@npm:1.0.2" + version: 1.0.3 + resolution: "typed-array-byte-offset@npm:1.0.3" dependencies: available-typed-arrays: "npm:^1.0.7" call-bind: "npm:^1.0.7" @@ -18258,21 +18258,22 @@ __metadata: gopd: "npm:^1.0.1" has-proto: "npm:^1.0.3" is-typed-array: "npm:^1.1.13" - checksum: 10c0/d2628bc739732072e39269389a758025f75339de2ed40c4f91357023c5512d237f255b633e3106c461ced41907c1bf9a533c7e8578066b0163690ca8bc61b22f + reflect.getprototypeof: "npm:^1.0.6" + checksum: 10c0/5da29585f96671c0521475226d3227000b3e01d1e99208b66bb05b75c7c8f4d0e9cc2e79920f3bfbc792a00102df1daa2608a2753e3f291b671d5a80245bde5b languageName: node linkType: hard "typed-array-length@npm:^1.0.6": - version: 1.0.6 - resolution: "typed-array-length@npm:1.0.6" + version: 1.0.7 + resolution: "typed-array-length@npm:1.0.7" dependencies: call-bind: "npm:^1.0.7" for-each: "npm:^0.3.3" gopd: "npm:^1.0.1" - has-proto: "npm:^1.0.3" is-typed-array: "npm:^1.1.13" possible-typed-array-names: "npm:^1.0.0" - checksum: 10c0/74253d7dc488eb28b6b2711cf31f5a9dcefc9c41b0681fd1c178ed0a1681b4468581a3626d39cd4df7aee3d3927ab62be06aa9ca74e5baf81827f61641445b77 + reflect.getprototypeof: "npm:^1.0.6" + checksum: 10c0/e38f2ae3779584c138a2d8adfa8ecf749f494af3cd3cdafe4e688ce51418c7d2c5c88df1bd6be2bbea099c3f7cea58c02ca02ed438119e91f162a9de23f61295 languageName: node linkType: hard @@ -19151,6 +19152,39 @@ __metadata: languageName: node linkType: hard +"which-builtin-type@npm:^1.1.4": + version: 1.2.0 + resolution: "which-builtin-type@npm:1.2.0" + dependencies: + call-bind: "npm:^1.0.7" + function.prototype.name: "npm:^1.1.6" + has-tostringtag: "npm:^1.0.2" + is-async-function: "npm:^2.0.0" + is-date-object: "npm:^1.0.5" + is-finalizationregistry: "npm:^1.1.0" + is-generator-function: "npm:^1.0.10" + is-regex: "npm:^1.1.4" + is-weakref: "npm:^1.0.2" + isarray: "npm:^2.0.5" + which-boxed-primitive: "npm:^1.0.2" + which-collection: "npm:^1.0.2" + which-typed-array: "npm:^1.1.15" + checksum: 10c0/7cd4a8ccfa6a3cb7c2296c716e7266b9f31a66f3e131fe7b185232c16d3ad21442046ec1798c4ec1e19dce7eb99c7751377192e5e734dc07042d14ec0f09b332 + languageName: node + linkType: hard + +"which-collection@npm:^1.0.2": + version: 1.0.2 + resolution: "which-collection@npm:1.0.2" + dependencies: + is-map: "npm:^2.0.3" + is-set: "npm:^2.0.3" + is-weakmap: "npm:^2.0.2" + is-weakset: "npm:^2.0.3" + checksum: 10c0/3345fde20964525a04cdf7c4a96821f85f0cc198f1b2ecb4576e08096746d129eb133571998fe121c77782ac8f21cbd67745a3d35ce100d26d4e684c142ea1f2 + languageName: node + linkType: hard + "which-module@npm:^2.0.0": version: 2.0.1 resolution: "which-module@npm:2.0.1" @@ -19437,7 +19471,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:2.6.1": +"yaml@npm:2.6.1, yaml@npm:^2.4.1": version: 2.6.1 resolution: "yaml@npm:2.6.1" bin: @@ -19446,15 +19480,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.4.1": - version: 2.6.0 - resolution: "yaml@npm:2.6.0" - bin: - yaml: bin.mjs - checksum: 10c0/9e74cdb91cc35512a1c41f5ce509b0e93cc1d00eff0901e4ba831ee75a71ddf0845702adcd6f4ee6c811319eb9b59653248462ab94fa021ab855543a75396ceb - languageName: node - linkType: hard - "yargs-parser@npm:21.1.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1"
e76800ce54abf388fd8762fc7a298729fb58650f
2025-01-08 21:11:11
Santosh Yadav
fix(@angular/build): fix incorrect budget calculation
false
fix incorrect budget calculation
fix
diff --git a/packages/angular/build/src/utils/bundle-calculator.ts b/packages/angular/build/src/utils/bundle-calculator.ts index 839355e5c06f..46558484e39a 100644 --- a/packages/angular/build/src/utils/bundle-calculator.ts +++ b/packages/angular/build/src/utils/bundle-calculator.ts @@ -12,6 +12,8 @@ import { formatSize } from './format-bytes'; // Re-export to avoid direct schema importing throughout code export { type BudgetEntry, BudgetType }; +export const BYTES_IN_KILOBYTE = 1000; + interface Size { size: number; label?: string; @@ -306,13 +308,13 @@ function calculateBytes(input: string, baseline?: string, factor: 1 | -1 = 1): n value = (baselineBytes * value) / 100; break; case 'kb': - value *= 1024; + value *= BYTES_IN_KILOBYTE; break; case 'mb': - value *= 1024 * 1024; + value *= BYTES_IN_KILOBYTE * BYTES_IN_KILOBYTE; break; case 'gb': - value *= 1024 * 1024 * 1024; + value *= BYTES_IN_KILOBYTE * BYTES_IN_KILOBYTE * BYTES_IN_KILOBYTE; break; } diff --git a/packages/angular/build/src/utils/bundle-calculator_spec.ts b/packages/angular/build/src/utils/bundle-calculator_spec.ts index 899249cd4acd..9bb44394496b 100644 --- a/packages/angular/build/src/utils/bundle-calculator_spec.ts +++ b/packages/angular/build/src/utils/bundle-calculator_spec.ts @@ -6,9 +6,13 @@ * found in the LICENSE file at https://angular.dev/license */ -import { BudgetEntry, BudgetType, ThresholdSeverity, checkBudgets } from './bundle-calculator'; - -const kB = 1000; +import { + BYTES_IN_KILOBYTE, + BudgetEntry, + BudgetType, + ThresholdSeverity, + checkBudgets, +} from './bundle-calculator'; describe('bundle-calculator', () => { describe('checkBudgets()', () => { @@ -24,11 +28,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -55,11 +59,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -93,11 +97,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, ], }; @@ -131,11 +135,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, ], }; @@ -169,15 +173,15 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, { name: 'baz.css', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -211,11 +215,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, { name: 'bar.css', - size: 0.75 * kB, + size: 0.75 * BYTES_IN_KILOBYTE, }, ], }; @@ -249,11 +253,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.css', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -282,11 +286,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.js', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.js', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -320,11 +324,11 @@ describe('bundle-calculator', () => { assets: [ { name: 'foo.ext', - size: 1.5 * kB, + size: 1.5 * BYTES_IN_KILOBYTE, }, { name: 'bar.ext', - size: 0.5 * kB, + size: 0.5 * BYTES_IN_KILOBYTE, }, ], }; @@ -338,5 +342,38 @@ describe('bundle-calculator', () => { message: jasmine.stringMatching('foo.ext exceeded maximum budget.'), }); }); + + it('does not exceed the individual file budget limit', () => { + const budgets: BudgetEntry[] = [ + { + type: BudgetType.Bundle, + maximumError: '1000kb', + }, + ]; + const stats = { + chunks: [ + { + id: 0, + initial: true, + names: ['main'], + files: ['main.ext', 'bar.ext'], + }, + ], + assets: [ + { + name: 'main.ext', + size: 1 * BYTES_IN_KILOBYTE, + }, + { + name: 'bar.ext', + size: 0.5 * BYTES_IN_KILOBYTE, + }, + ], + }; + + const failures = Array.from(checkBudgets(budgets, stats)); + + expect(failures).toHaveSize(0); + }); }); });
5f473affcf001888082bf4adc51481c5afca81e0
2024-10-15 21:55:10
hborchardt
fix(@angular/build): avoid race condition in sass importer
false
avoid race condition in sass importer
fix
diff --git a/packages/angular/build/src/tools/sass/worker.ts b/packages/angular/build/src/tools/sass/worker.ts index 75feb3f5e888..1a2e1184892f 100644 --- a/packages/angular/build/src/tools/sass/worker.ts +++ b/packages/angular/build/src/tools/sass/worker.ts @@ -106,6 +106,25 @@ export default async function renderSassStylesheet( containingUrl: containingUrl ? fileURLToPath(containingUrl) : null, }, }); + // Wait for the main thread to set the signal to 1 and notify, which tells + // us that a message can be received on the port. + // If the main thread is fast, the signal will already be set to 1, and no + // sleep/notify is necessary. + // However, there can be a race condition here: + // - the main thread sets the signal to 1, but does not get to the notify instruction yet + // - the worker does not pause because the signal is set to 1 + // - the worker very soon enters this method again + // - this method sets the signal to 0 and sends the message + // - the signal is 0 and so the `Atomics.wait` call blocks + // - only now the main thread runs the `notify` from the first invocation, so the + // worker continues. + // - but there is no message yet in the port, because the thread should not have been + // waken up yet. + // To combat this, wait for a non-0 value _twice_. + // Almost every time, this immediately continues with "not-equal", because + // the signal is still set to 1, except during the race condition, when the second + // wait will wait for the correct notify. + Atomics.wait(importerChannel.signal, 0, 0); Atomics.wait(importerChannel.signal, 0, 0); const result = receiveMessageOnPort(importerChannel.port)?.message as string | null;
583024d758b554cb8e8d3fe9b6f2f86070da1b43
2018-10-16 02:54:45
Charles Lyding
test: add E2E test for JSON help output for all commands
false
add E2E test for JSON help output for all commands
test
diff --git a/tests/legacy-cli/e2e/tests/commands/help/help-json.ts b/tests/legacy-cli/e2e/tests/commands/help/help-json.ts new file mode 100644 index 000000000000..af4f18872990 --- /dev/null +++ b/tests/legacy-cli/e2e/tests/commands/help/help-json.ts @@ -0,0 +1,15 @@ +import { silentNg } from '../../../utils/process'; + + +export default async function() { + const commands = require('@angular/cli/commands.json'); + for (const commandName of Object.keys(commands)) { + const { stdout } = await silentNg(commandName, '--help=json'); + + if (stdout.trim()) { + JSON.parse(stdout); + } else { + console.warn(`No JSON output for command [${commandName}].`); + } + } +}
809340a8f0ae1302cba2628bbb2889d943cc3a0c
2017-02-16 09:44:18
Mike Brocchi
refactor(@angular/cli): rename config file from angular-cli.json to .angular-cli.json (#4681)
false
rename config file from angular-cli.json to .angular-cli.json (#4681)
refactor
diff --git a/docs/design/docker-deploy.md b/docs/design/docker-deploy.md index bd0ec6740b68..634fdc8b3e21 100644 --- a/docs/design/docker-deploy.md +++ b/docs/design/docker-deploy.md @@ -97,7 +97,7 @@ If an `env` name is provided, other than "default", generate compose files with If `--use-image == false` and the selected machine for the environment is a Docker Swarm machine, warn the user. Docker Swarm clusters cannot use the `build:` option in compose, since the resulting built image will not be distributed to other nodes. Swarm requires using the `image:` option in compose, pushing the image to a registry beforehand so that the Swarm nodes have a place to pull the image from (see [Swarm Limitations](https://docs.docker.com/compose/swarm/#building-images)). -Certain configuration values will be stored in the project's ngConfig `angular-cli.json` for use with other docker commands (ie. deploy, logs, exec). See also: [Saved State](#saved-state) section. +Certain configuration values will be stored in the project's ngConfig `.angular-cli.json` for use with other docker commands (ie. deploy, logs, exec). See also: [Saved State](#saved-state) section. Provide instructions on what the user can do after initialization completes (push, deploy). diff --git a/docs/design/ngConfig.md b/docs/design/ngConfig.md index bb3573212900..e37f1cf0e689 100644 --- a/docs/design/ngConfig.md +++ b/docs/design/ngConfig.md @@ -16,14 +16,14 @@ Since the data is static, we only need to keep it in a static store somewhere. One solution would be to keep the data in the `package.json`. Unfortunately, the metadata contains too much data and the `package.json` file would become unmanageable. -Instead of polluting the package file, a `angular-cli.json` file will be created that contains all the values. Access to that file will be allowed to the user if he knows the structure of the file (unknown keys will be kept but ignored), and it's easy to read and write. +Instead of polluting the package file, a `.angular-cli.json` file will be created that contains all the values. Access to that file will be allowed to the user if he knows the structure of the file (unknown keys will be kept but ignored), and it's easy to read and write. ## Fallback -There should be two `angular-cli.json` files; one for the project and a general one. The general one should contain information that can be useful when scaffolding new apps, or informations about the user. +There should be two `.angular-cli.json` files; one for the project and a general one. The general one should contain information that can be useful when scaffolding new apps, or informations about the user. -The project `angular-cli.json` goes into the project root. The global configuration should live at `$HOME/.angular-cli.json`. +The project `.angular-cli.json` goes into the project root. The global configuration should live at `$HOME/.angular-cli.json`. ## Structure diff --git a/docs/documentation/build.md b/docs/documentation/build.md index 4ffb5953042d..8724ff59f1f1 100644 --- a/docs/documentation/build.md +++ b/docs/documentation/build.md @@ -19,7 +19,7 @@ The build artifacts will be stored in the `dist/` directory. environment file to be used with that build (`--environment=dev` or `--environment=prod`). By default, the development build target and environment are used. -The mapping used to determine which environment file is used can be found in `angular-cli.json`: +The mapping used to determine which environment file is used can be found in `.angular-cli.json`: ```json "environments": { @@ -46,7 +46,7 @@ ng build You can also add your own env files other than `dev` and `prod` by doing the following: - create a `src/environments/environment.NAME.ts` -- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the `apps[0].environments` object in `angular-cli.json` +- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the `apps[0].environments` object in `.angular-cli.json` - use them via the `--env=NAME` flag on the build/serve commands. ### Base tag handling in index.html diff --git a/docs/documentation/e2e.md b/docs/documentation/e2e.md index dd226eef9ae7..48a0446f6663 100644 --- a/docs/documentation/e2e.md +++ b/docs/documentation/e2e.md @@ -14,7 +14,7 @@ ng e2e End-to-end tests are run via [Protractor](https://angular.github.io/protractor/). ## Options -`--config` (`-c`) use a specific config file. Defaults to the protractor config file in `angular-cli.json`. +`--config` (`-c`) use a specific config file. Defaults to the protractor config file in `.angular-cli.json`. `--specs` (`-sp`) override specs in the protractor config. Can send in multiple specs by repeating flag (`ng e2e --specs=spec1.ts --specs=spec2.ts`). diff --git a/docs/documentation/stories/asset-configuration.md b/docs/documentation/stories/asset-configuration.md index 9809f28f0667..0f1a2a170053 100644 --- a/docs/documentation/stories/asset-configuration.md +++ b/docs/documentation/stories/asset-configuration.md @@ -1,6 +1,6 @@ # Project assets -You use the `assets` array in `angular-cli.json` to list files or folders you want to copy as-is +You use the `assets` array in `.angular-cli.json` to list files or folders you want to copy as-is when building your project. By default, the `src/assets/` folder and `src/favicon.ico` are copied over. diff --git a/docs/documentation/stories/global-lib.md b/docs/documentation/stories/global-lib.md index 756dbc952d04..3583b5f143d2 100644 --- a/docs/documentation/stories/global-lib.md +++ b/docs/documentation/stories/global-lib.md @@ -2,7 +2,7 @@ Some javascript libraries need to be added to the global scope, and loaded as if they were in a script tag. We can do this using the `apps[0].scripts` and -`apps[0].styles` properties of `angular-cli.json`. +`apps[0].styles` properties of `.angular-cli.json`. As an example, to use [Bootstrap 4](http://v4-alpha.getbootstrap.com/) this is what you need to do: diff --git a/docs/documentation/stories/global-scripts.md b/docs/documentation/stories/global-scripts.md index 0d8a2be58f60..cc1021d25fe7 100644 --- a/docs/documentation/stories/global-scripts.md +++ b/docs/documentation/stories/global-scripts.md @@ -1,7 +1,7 @@ # Global styles You can add Javascript files to the global scope via the `apps[0].scripts` -property in `angular-cli.json`. +property in `.angular-cli.json`. These will be loaded exactly as if you had added them in a `<script>` tag inside `index.html`. This is especially useful for legacy libraries or analytic snippets. diff --git a/docs/documentation/stories/global-styles.md b/docs/documentation/stories/global-styles.md index 696b4a903896..c6ca901bdd42 100644 --- a/docs/documentation/stories/global-styles.md +++ b/docs/documentation/stories/global-styles.md @@ -6,7 +6,7 @@ The `styles.css` file allows users to add global styles and supports If the project is created with the `--style=sass` option, this will be a `.sass` file instead, and the same applies to `scss/less/styl`. -You can add more global styles via the `apps[0].styles` property in `angular-cli.json`. +You can add more global styles via the `apps[0].styles` property in `.angular-cli.json`. These will be loaded exactly as if you had added them in a `<link>` tag inside `index.html`. ```json @@ -25,4 +25,4 @@ You can also rename the output and lazy load it by using the object format: { "input": "lazy-style.scss", "lazy": true }, { "input": "pre-rename-style.scss", "output": "renamed-style" }, ], -``` \ No newline at end of file +``` diff --git a/docs/documentation/stories/include-bootstrap.md b/docs/documentation/stories/include-bootstrap.md index f27b21022768..3debf5d279f1 100644 --- a/docs/documentation/stories/include-bootstrap.md +++ b/docs/documentation/stories/include-bootstrap.md @@ -33,7 +33,7 @@ npm install bootstrap@next --save Now that the project is set up it must be configured to include the bootstrap CSS. -- Open the file `angular-cli.json` from the root of your project. +- Open the file `.angular-cli.json` from the root of your project. - Under the property `apps` the first item in that array is the default application. - There is a property `styles` which allows external global styles to be applied to your application. - Specify the path to `bootstrap.min.css` @@ -46,7 +46,7 @@ Now that the project is set up it must be configured to include the bootstrap CS ], ``` -**Note:** When you make changes to `angular-cli.json` you will need to re-start `ng serve` to pick up configuration changes. +**Note:** When you make changes to `.angular-cli.json` you will need to re-start `ng serve` to pick up configuration changes. ### Testing Project diff --git a/docs/documentation/stories/include-font-awesome.md b/docs/documentation/stories/include-font-awesome.md index 311af0572e0d..ed0d8b34d2af 100644 --- a/docs/documentation/stories/include-font-awesome.md +++ b/docs/documentation/stories/include-font-awesome.md @@ -16,7 +16,7 @@ npm install --save font-awesome To add Font Awesome CSS icons to your app... ```json -// in angular-cli.json +// in .angular-cli.json "styles": [ "styles.css", diff --git a/docs/documentation/stories/moving-into-the-cli.md b/docs/documentation/stories/moving-into-the-cli.md index 6746289444dc..8c4af6dd8aad 100644 --- a/docs/documentation/stories/moving-into-the-cli.md +++ b/docs/documentation/stories/moving-into-the-cli.md @@ -47,8 +47,8 @@ relative paths instead. - Polyfills are listed in `./src/polyfills.ts` so remove `core-js` and `zone.js` from `index.html`. - SystemJS is not needed anymore, so remove it from `index.html` as well. - Instead of using `<script>` and `<link>` tags directly in `index.html`, use -`angular-cli.json` instead. - - Look for the `styles` array in `angular-cli.json` and add in any CSS files you have in +`.angular-cli.json` instead. + - Look for the `styles` array in `.angular-cli.json` and add in any CSS files you have in `src/index.html`. Use a relative path from `./src/`. - Do the same for any remaining script tags as well, using the `scripts` array instead. diff --git a/docs/documentation/stories/moving-out-of-the-cli.md b/docs/documentation/stories/moving-out-of-the-cli.md index 5f0e63cb2846..371a74c21bd7 100644 --- a/docs/documentation/stories/moving-out-of-the-cli.md +++ b/docs/documentation/stories/moving-out-of-the-cli.md @@ -4,7 +4,7 @@ Each project is unique, and even though we try to cater to most setups in Angula you need a custom setup. Even if you need to use a different build system, you can still use other Angular CLI features -like `ng generate`, `ng lint`, `ng test` and `ng e2e` by leaving in `angular-cli.json` and +like `ng generate`, `ng lint`, `ng test` and `ng e2e` by leaving in `.angular-cli.json` and supporting files like `src/test.ts`. Moving out of the CLI is very similar to [Moving into the CLI](moving-into-the-cli). @@ -40,7 +40,7 @@ You might also need to make adjustments to conform to your new build system. You might need to change these. - Polyfills are listed in `../old-awesome-app/src/polyfills.ts`. Incorporate these into the new project. -- The CLI lists used `<script>` and `<link>` tags in the `angular-cli.json` `scripts` +- The CLI lists used `<script>` and `<link>` tags in the `.angular-cli.json` `scripts` and `styles` array. Check import these in your new project and add them accordingly. The final step is to copy your git history so you can continue working without losing anything: diff --git a/packages/@angular/cli/blueprints/ng2/files/__path__/environments/environment.ts b/packages/@angular/cli/blueprints/ng2/files/__path__/environments/environment.ts index 00313f16648e..b7f639aecac5 100644 --- a/packages/@angular/cli/blueprints/ng2/files/__path__/environments/environment.ts +++ b/packages/@angular/cli/blueprints/ng2/files/__path__/environments/environment.ts @@ -1,7 +1,7 @@ // The file contents for the current environment will overwrite these during build. // The build system defaults to the dev environment which uses `environment.ts`, but if you do // `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `angular-cli.json`. +// The list of which env maps to which file can be found in `.angular-cli.json`. export const environment = { production: false diff --git a/packages/@angular/cli/blueprints/ng2/files/karma.conf.js b/packages/@angular/cli/blueprints/ng2/files/karma.conf.js index 5a20683052e0..0aa416f5d560 100644 --- a/packages/@angular/cli/blueprints/ng2/files/karma.conf.js +++ b/packages/@angular/cli/blueprints/ng2/files/karma.conf.js @@ -29,7 +29,7 @@ module.exports = function (config) { fixWebpackSourcePaths: true }, angularCli: { - config: './angular-cli.json', + config: './.angular-cli.json', environment: 'dev' }, reporters: config.angularCli && config.angularCli.codeCoverage diff --git a/packages/@angular/cli/commands/e2e.ts b/packages/@angular/cli/commands/e2e.ts index e9bd5fef43be..3a83bae4e832 100644 --- a/packages/@angular/cli/commands/e2e.ts +++ b/packages/@angular/cli/commands/e2e.ts @@ -41,7 +41,7 @@ const E2eCommand = Command.extend({ const e2eConfig = CliConfig.fromProject().config.e2e; if (!e2eConfig.protractor.config) { - throw new SilentError('No protractor config found in angular-cli.json.'); + throw new SilentError('No protractor config found in .angular-cli.json.'); } commandOptions.config = e2eConfig.protractor.config; diff --git a/packages/@angular/cli/ember-cli/lib/models/blueprint.js b/packages/@angular/cli/ember-cli/lib/models/blueprint.js index d5ba75852dca..0c47d4429c7b 100644 --- a/packages/@angular/cli/ember-cli/lib/models/blueprint.js +++ b/packages/@angular/cli/ember-cli/lib/models/blueprint.js @@ -1285,7 +1285,8 @@ Blueprint.list = function(options) { @property renameFiles */ Blueprint.renamedFiles = { - 'gitignore': '.gitignore' + 'gitignore': '.gitignore', + 'angular-cli.json': '.angular-cli.json' }; /** diff --git a/packages/@angular/cli/models/config.ts b/packages/@angular/cli/models/config.ts index 05a97610f77d..7090cfe6d990 100644 --- a/packages/@angular/cli/models/config.ts +++ b/packages/@angular/cli/models/config.ts @@ -5,7 +5,8 @@ import * as chalk from 'chalk'; import * as fs from 'fs'; import * as path from 'path'; -export const CLI_CONFIG_FILE_NAME = 'angular-cli.json'; +export const CLI_CONFIG_FILE_NAME = '.angular-cli.json'; +const CLI_CONFIG_FILE_NAME_ALT = 'angular-cli.json'; function _findUp(name: string, from: string) { @@ -38,8 +39,11 @@ export class CliConfig extends CliConfigBase<ConfigInterface> { // Find the configuration, either where specified, in the angular-cli project // (if it's in node_modules) or from the current process. return (projectPath && _findUp(CLI_CONFIG_FILE_NAME, projectPath)) + || (projectPath && _findUp(CLI_CONFIG_FILE_NAME_ALT, projectPath)) || _findUp(CLI_CONFIG_FILE_NAME, process.cwd()) - || _findUp(CLI_CONFIG_FILE_NAME, __dirname); + || _findUp(CLI_CONFIG_FILE_NAME_ALT, process.cwd()) + || _findUp(CLI_CONFIG_FILE_NAME, __dirname) + || _findUp(CLI_CONFIG_FILE_NAME_ALT, __dirname); } static fromGlobal(): CliConfig { @@ -66,7 +70,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> { // If any of them returned true, output a deprecation warning. if (aliases.some(x => !!x)) { console.error(chalk.yellow(oneLine` - The "defaults.prefix" and "defaults.sourceDir" properties of angular-cli.json + The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n Please update in order to avoid errors in future versions of Angular CLI. `)); @@ -94,7 +98,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> { // If any of them returned true, output a deprecation warning. if (aliases.some(x => !!x)) { console.error(chalk.yellow(oneLine` - The "defaults.prefix" and "defaults.sourceDir" properties of angular-cli.json + The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n Please update in order to avoid errors in future versions of Angular CLI. `)); diff --git a/packages/@angular/cli/models/config/config.ts b/packages/@angular/cli/models/config/config.ts index 594e5aab1225..6432c6e26774 100644 --- a/packages/@angular/cli/models/config/config.ts +++ b/packages/@angular/cli/models/config/config.ts @@ -86,7 +86,7 @@ export class CliConfig<JsonType> { content = JSON.parse(configContent); } catch (err) { throw new InvalidConfigError( - 'Parsing angular-cli.json failed. Please make sure your angular-cli.json' + 'Parsing .angular-cli.json failed. Please make sure your .angular-cli.json' + ' is valid JSON. Error:\n' + err ); } diff --git a/packages/@angular/cli/models/webpack-config.ts b/packages/@angular/cli/models/webpack-config.ts index 5bd771fe1e41..4c5765b979ec 100644 --- a/packages/@angular/cli/models/webpack-config.ts +++ b/packages/@angular/cli/models/webpack-config.ts @@ -88,7 +88,7 @@ export class NgCliWebpackConfig { return Object.assign({}, targetDefaults[buildOptions.target], buildOptions); } - // Fill in defaults from angular-cli.json + // Fill in defaults from .angular-cli.json private mergeConfigs(buildOptions: BuildOptions, appConfig: any) { const mergeableOptions = { outputPath: appConfig.outDir, diff --git a/packages/@angular/cli/models/webpack-configs/production.ts b/packages/@angular/cli/models/webpack-configs/production.ts index 5db04d93216c..383ed29a4c7d 100644 --- a/packages/@angular/cli/models/webpack-configs/production.ts +++ b/packages/@angular/cli/models/webpack-configs/production.ts @@ -23,7 +23,7 @@ export const getProdConfig = function (wco: WebpackConfigOptions) { throw new Error(stripIndent` Your project is configured with serviceWorker = true, but @angular/service-worker is not installed. Run \`npm install --save-dev @angular/service-worker\` - and try again, or run \`ng set apps.0.serviceWorker=false\` in your angular-cli.json. + and try again, or run \`ng set apps.0.serviceWorker=false\` in your .angular-cli.json. `); } diff --git a/packages/@angular/cli/tasks/serve.ts b/packages/@angular/cli/tasks/serve.ts index c7394744f584..93a6f3269684 100644 --- a/packages/@angular/cli/tasks/serve.ts +++ b/packages/@angular/cli/tasks/serve.ts @@ -30,7 +30,7 @@ export default Task.extend({ rimraf.sync(path.resolve(this.project.root, outputPath)); const serveDefaults = { - // default deployUrl to '' on serve to prevent the default from angular-cli.json + // default deployUrl to '' on serve to prevent the default from .angular-cli.json deployUrl: '' }; diff --git a/tests/e2e/tests/build/assets.ts b/tests/e2e/tests/build/assets.ts index fba6bde9fcc4..a513878fb626 100644 --- a/tests/e2e/tests/build/assets.ts +++ b/tests/e2e/tests/build/assets.ts @@ -22,8 +22,8 @@ export default function () { './src/output-asset.txt': 'output-asset.txt', './node_modules/some-package/node_modules-asset.txt': 'node_modules-asset.txt', })) - // Add asset config in angular-cli.json. - .then(() => updateJsonFile('angular-cli.json', configJson => { + // Add asset config in .angular-cli.json. + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['assets'] = [ 'folder', diff --git a/tests/e2e/tests/build/config-file-fallback.ts b/tests/e2e/tests/build/config-file-fallback.ts new file mode 100644 index 000000000000..e480ad3e9c08 --- /dev/null +++ b/tests/e2e/tests/build/config-file-fallback.ts @@ -0,0 +1,10 @@ +import {ng} from '../../utils/process'; +import {moveFile} from '../../utils/fs'; + + +export default function() { + return Promise.resolve() + .then(() => ng('build')) + .then(() => moveFile('.angular-cli.json', 'angular-cli.json')) + .then(() => ng('build')); +} diff --git a/tests/e2e/tests/build/deploy-url.ts b/tests/e2e/tests/build/deploy-url.ts index 7fcff1ff397d..d5b0ecb417b1 100644 --- a/tests/e2e/tests/build/deploy-url.ts +++ b/tests/e2e/tests/build/deploy-url.ts @@ -18,7 +18,7 @@ export default function () { // verify --deploy-url isn't applied to extracted css urls .then(() => expectFileToMatch('dist/styles.bundle.css', 'url\(more.svg\)')) // verify option also works in config - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['deployUrl'] = 'config-deployUrl/'; })) diff --git a/tests/e2e/tests/build/filename.ts b/tests/e2e/tests/build/filename.ts index a9e7258959e1..e8979648f9a6 100644 --- a/tests/e2e/tests/build/filename.ts +++ b/tests/e2e/tests/build/filename.ts @@ -7,7 +7,7 @@ import {copyFile} from '../../utils/fs'; export default function() { return Promise.resolve() .then(() => copyFile('src/index.html', 'src/config-index.html')) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['outDir'] = 'config-build-output'; app['index'] = 'config-index.html'; diff --git a/tests/e2e/tests/build/output-dir.ts b/tests/e2e/tests/build/output-dir.ts index 7e56e1d5f2f5..c159fe287398 100644 --- a/tests/e2e/tests/build/output-dir.ts +++ b/tests/e2e/tests/build/output-dir.ts @@ -10,7 +10,7 @@ export default function() { .then(() => expectFileToExist('./build-output/index.html')) .then(() => expectFileToExist('./build-output/main.bundle.js')) .then(() => expectToFail(expectGitToBeClean)) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['outDir'] = 'config-build-output'; })) diff --git a/tests/e2e/tests/build/scripts-array.ts b/tests/e2e/tests/build/scripts-array.ts index 5b2e844848ce..be81248ec3f1 100644 --- a/tests/e2e/tests/build/scripts-array.ts +++ b/tests/e2e/tests/build/scripts-array.ts @@ -18,7 +18,7 @@ export default function () { 'src/common-entry-style.css': '.common-entry-style { color: red }', }) .then(() => appendToFile('src/main.ts', 'import \'./string-script.js\';')) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['scripts'] = [ 'string-script.js', diff --git a/tests/e2e/tests/build/styles/extract-css.ts b/tests/e2e/tests/build/styles/extract-css.ts index ff08c2aef1de..ee0c704f3178 100644 --- a/tests/e2e/tests/build/styles/extract-css.ts +++ b/tests/e2e/tests/build/styles/extract-css.ts @@ -19,7 +19,7 @@ export default function () { 'src/common-entry-style.css': '.common-entry-style { color: red }', 'src/common-entry-script.js': 'console.log(\'common-entry-script\');' })) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = [ 'string-style.css', diff --git a/tests/e2e/tests/build/styles/imports.ts b/tests/e2e/tests/build/styles/imports.ts index a7ce2a17f859..192761637d6c 100644 --- a/tests/e2e/tests/build/styles/imports.ts +++ b/tests/e2e/tests/build/styles/imports.ts @@ -35,7 +35,7 @@ export default function () { h1 { background: #000; } `}) // change files to use preprocessor - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = [`styles.${ext}`]; })) @@ -57,7 +57,7 @@ export default function () { .then(() => expectFileToMatch('dist/main.bundle.js', /h1.*background:\s*#000+/)) // change files back - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = ['styles.css']; })) diff --git a/tests/e2e/tests/build/styles/include-paths.ts b/tests/e2e/tests/build/styles/include-paths.ts index 4f4913e2f328..92ead1cd2687 100644 --- a/tests/e2e/tests/build/styles/include-paths.ts +++ b/tests/e2e/tests/build/styles/include-paths.ts @@ -34,7 +34,7 @@ export default function () { })) .then(() => replaceInFile('src/app/app.component.ts', `'./app.component.css\'`, `'./app.component.scss', './app.component.styl'`)) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = [ 'styles.scss', diff --git a/tests/e2e/tests/build/styles/less.ts b/tests/e2e/tests/build/styles/less.ts new file mode 100644 index 000000000000..10d191c5f648 --- /dev/null +++ b/tests/e2e/tests/build/styles/less.ts @@ -0,0 +1,42 @@ +import { + writeMultipleFiles, + deleteFile, + expectFileToMatch, + replaceInFile +} from '../../../utils/fs'; +import { expectToFail } from '../../../utils/utils'; +import { ng } from '../../../utils/process'; +import { stripIndents } from 'common-tags'; +import { updateJsonFile } from '../../../utils/project'; + +export default function () { + return writeMultipleFiles({ + 'src/styles.less': stripIndents` + @import './imported-styles.less'; + body { background-color: blue; } + `, + 'src/imported-styles.less': stripIndents` + p { background-color: red; } + `, + 'src/app/app.component.less': stripIndents` + .outer { + .inner { + background: #fff; + } + } + `}) + .then(() => deleteFile('src/app/app.component.css')) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['styles'] = ['styles.less']; + })) + .then(() => replaceInFile('src/app/app.component.ts', + './app.component.css', './app.component.less')) + .then(() => ng('build', '--extract-css', '--sourcemap')) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /body\s*{\s*background-color: blue;\s*}/)) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /p\s*{\s*background-color: red;\s*}/)) + .then(() => expectToFail(() => expectFileToMatch('dist/styles.bundle.css', '"mappings":""'))) + .then(() => expectFileToMatch('dist/main.bundle.js', /.outer.*.inner.*background:\s*#[fF]+/)); +} diff --git a/tests/e2e/tests/build/styles/loaders.ts b/tests/e2e/tests/build/styles/loaders.ts index 9a2121c8f7dd..703497b2f555 100644 --- a/tests/e2e/tests/build/styles/loaders.ts +++ b/tests/e2e/tests/build/styles/loaders.ts @@ -26,7 +26,7 @@ export default function () { } `}) .then(() => deleteFile('src/app/app.component.css')) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = ['styles.scss']; })) diff --git a/tests/e2e/tests/build/styles/scss.ts b/tests/e2e/tests/build/styles/scss.ts new file mode 100644 index 000000000000..24a018d45eb0 --- /dev/null +++ b/tests/e2e/tests/build/styles/scss.ts @@ -0,0 +1,42 @@ +import { + writeMultipleFiles, + deleteFile, + expectFileToMatch, + replaceInFile +} from '../../../utils/fs'; +import { expectToFail } from '../../../utils/utils'; +import { ng } from '../../../utils/process'; +import { stripIndents } from 'common-tags'; +import { updateJsonFile } from '../../../utils/project'; + +export default function () { + return writeMultipleFiles({ + 'src/styles.scss': stripIndents` + @import './imported-styles.scss'; + body { background-color: blue; } + `, + 'src/imported-styles.scss': stripIndents` + p { background-color: red; } + `, + 'src/app/app.component.scss': stripIndents` + .outer { + .inner { + background: #fff; + } + } + `}) + .then(() => deleteFile('src/app/app.component.css')) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['styles'] = ['styles.scss']; + })) + .then(() => replaceInFile('src/app/app.component.ts', + './app.component.css', './app.component.scss')) + .then(() => ng('build', '--extract-css', '--sourcemap')) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /body\s*{\s*background-color: blue;\s*}/)) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /p\s*{\s*background-color: red;\s*}/)) + .then(() => expectToFail(() => expectFileToMatch('dist/styles.bundle.css', '"mappings":""'))) + .then(() => expectFileToMatch('dist/main.bundle.js', /.outer.*.inner.*background:\s*#[fF]+/)); +} diff --git a/tests/e2e/tests/build/styles/styles-array.ts b/tests/e2e/tests/build/styles/styles-array.ts index efa6bf531f3f..5cbb608070a7 100644 --- a/tests/e2e/tests/build/styles/styles-array.ts +++ b/tests/e2e/tests/build/styles/styles-array.ts @@ -17,7 +17,7 @@ export default function () { 'src/common-entry-style.css': '.common-entry-style { color: red }', 'src/common-entry-script.js': 'console.log(\'common-entry-script\');' }) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'] = [ 'string-style.css', diff --git a/tests/e2e/tests/build/styles/stylus.ts b/tests/e2e/tests/build/styles/stylus.ts new file mode 100644 index 000000000000..c73923a596ad --- /dev/null +++ b/tests/e2e/tests/build/styles/stylus.ts @@ -0,0 +1,42 @@ +import { + writeMultipleFiles, + deleteFile, + expectFileToMatch, + replaceInFile +} from '../../../utils/fs'; +import { expectToFail } from '../../../utils/utils'; +import { ng } from '../../../utils/process'; +import { stripIndents } from 'common-tags'; +import { updateJsonFile } from '../../../utils/project'; + +export default function () { + return writeMultipleFiles({ + 'src/styles.styl': stripIndents` + @import './imported-styles.styl'; + body { background-color: blue; } + `, + 'src/imported-styles.styl': stripIndents` + p { background-color: red; } + `, + 'src/app/app.component.styl': stripIndents` + .outer { + .inner { + background: #fff; + } + } + `}) + .then(() => deleteFile('src/app/app.component.css')) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['styles'] = ['styles.styl']; + })) + .then(() => replaceInFile('src/app/app.component.ts', + './app.component.css', './app.component.styl')) + .then(() => ng('build', '--extract-css', '--sourcemap')) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /body\s*{\s*background-color: #00f;\s*}/)) + .then(() => expectFileToMatch('dist/styles.bundle.css', + /p\s*{\s*background-color: #f00;\s*}/)) + .then(() => expectToFail(() => expectFileToMatch('dist/styles.bundle.css', '"mappings":""'))) + .then(() => expectFileToMatch('dist/main.bundle.js', /.outer.*.inner.*background:\s*#[fF]+/)); +} diff --git a/tests/e2e/tests/generate/component/component-flat.ts b/tests/e2e/tests/generate/component/component-flat.ts index 62f2f28675fe..57c3658907da 100644 --- a/tests/e2e/tests/generate/component/component-flat.ts +++ b/tests/e2e/tests/generate/component/component-flat.ts @@ -8,7 +8,7 @@ export default function() { const appDir = join('src', 'app'); return Promise.resolve() - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const comp = configJson.defaults.component; comp.flat = true; })) diff --git a/tests/e2e/tests/generate/component/component-not-flat.ts b/tests/e2e/tests/generate/component/component-not-flat.ts index 487e5a4542b4..91ba0ba0e2fd 100644 --- a/tests/e2e/tests/generate/component/component-not-flat.ts +++ b/tests/e2e/tests/generate/component/component-not-flat.ts @@ -8,7 +8,7 @@ export default function() { const componentDir = join('src', 'app', 'test-component'); return Promise.resolve() - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const comp = configJson.defaults.component; comp.flat = false; })) diff --git a/tests/e2e/tests/misc/assets.ts b/tests/e2e/tests/misc/assets.ts new file mode 100644 index 000000000000..482881561495 --- /dev/null +++ b/tests/e2e/tests/misc/assets.ts @@ -0,0 +1,22 @@ +import {writeFile, expectFileToExist, expectFileToMatch} from '../../utils/fs'; +import {ng} from '../../utils/process'; +import {updateJsonFile} from '../../utils/project'; +import {expectToFail} from '../../utils/utils'; + + +export default function() { + return writeFile('src/assets/.file', '') + .then(() => writeFile('src/assets/test.abc', 'hello world')) + .then(() => ng('build')) + .then(() => expectFileToExist('dist/favicon.ico')) + .then(() => expectFileToExist('dist/assets/.file')) + .then(() => expectFileToMatch('dist/assets/test.abc', 'hello world')) + .then(() => expectToFail(() => expectFileToExist('dist/assets/.gitkeep'))) + // doesn't break beta.16 projects + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['assets'] = 'assets'; + })) + .then(() => expectFileToExist('dist/assets/.file')) + .then(() => expectFileToMatch('dist/assets/test.abc', 'hello world')); +} diff --git a/tests/e2e/tests/misc/default-port.ts b/tests/e2e/tests/misc/default-port.ts index d3de7d535828..b525cf9867f0 100644 --- a/tests/e2e/tests/misc/default-port.ts +++ b/tests/e2e/tests/misc/default-port.ts @@ -5,7 +5,7 @@ import { updateJsonFile } from '../../utils/project'; export default function() { return Promise.resolve() - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson.defaults; app.serve = { port: 4201 }; })) diff --git a/tests/e2e/tests/misc/different-file-format.ts b/tests/e2e/tests/misc/different-file-format.ts index d3bb097f9955..e6dad9a7a069 100644 --- a/tests/e2e/tests/misc/different-file-format.ts +++ b/tests/e2e/tests/misc/different-file-format.ts @@ -10,6 +10,6 @@ const options = { export default function() { return Promise.resolve() .then(() => fs.prependToFile('./src/tsconfig.json', '\ufeff', options)) - .then(() => fs.prependToFile('./angular-cli.json', '\ufeff', options)) + .then(() => fs.prependToFile('./.angular-cli.json', '\ufeff', options)) .then(() => ng('build', '--env=dev')); } diff --git a/tests/e2e/tests/misc/fallback.ts b/tests/e2e/tests/misc/fallback.ts index fb6253609aa5..12b27cf9d8d9 100644 --- a/tests/e2e/tests/misc/fallback.ts +++ b/tests/e2e/tests/misc/fallback.ts @@ -18,7 +18,7 @@ export default function () { .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; }) // should correctly fallback to a changed index .then(() => moveFile('src/index.html', 'src/not-index.html')) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['index'] = 'not-index.html'; })) diff --git a/tests/e2e/tests/misc/minimal-config.ts b/tests/e2e/tests/misc/minimal-config.ts index 5e94c7545619..7e21832b0f72 100644 --- a/tests/e2e/tests/misc/minimal-config.ts +++ b/tests/e2e/tests/misc/minimal-config.ts @@ -4,7 +4,7 @@ import { ng } from '../../utils/process'; export default function () { return Promise.resolve() - .then(() => writeFile('angular-cli.json', JSON.stringify({ + .then(() => writeFile('.angular-cli.json', JSON.stringify({ apps: [{ root: 'src', main: 'main.ts', @@ -32,7 +32,7 @@ export default function () { }); }); `, - 'angular-cli.json': JSON.stringify({ + '.angular-cli.json': JSON.stringify({ apps: [{ root: 'src', scripts: ['./script.js'] diff --git a/tests/e2e/tests/misc/version.ts b/tests/e2e/tests/misc/version.ts index d5d5cbd2a2a5..c49c0c62dae3 100644 --- a/tests/e2e/tests/misc/version.ts +++ b/tests/e2e/tests/misc/version.ts @@ -4,7 +4,7 @@ import {ng} from '../../utils/process'; export default function() { return ng('version') - .then(() => deleteFile('angular-cli.json')) - // doesn't fail on a project with missing angular-cli.json + .then(() => deleteFile('.angular-cli.json')) + // doesn't fail on a project with missing .angular-cli.json .then(() => ng('version')); } diff --git a/tests/e2e/tests/test/test-assets.ts b/tests/e2e/tests/test/test-assets.ts new file mode 100644 index 000000000000..12d247aad6ef --- /dev/null +++ b/tests/e2e/tests/test/test-assets.ts @@ -0,0 +1,49 @@ +import { writeMultipleFiles } from '../../utils/fs'; +import { ng } from '../../utils/process'; +import { updateJsonFile } from '../../utils/project'; +import { expectToFail } from '../../utils/utils'; +import { stripIndent } from 'common-tags'; + +// Make sure asset files are served +export default function () { + return Promise.resolve() + .then(() => writeMultipleFiles({ + 'src/assets/file.txt': 'assets-folder-content', + 'src/file.txt': 'file-content', + // Not using `async()` in tests as it seemed to swallow `fetch()` errors + 'src/app/app.component.spec.ts': stripIndent` + describe('Test Runner', () => { + const fetch = global['fetch']; + it('should serve files in assets folder', (done) => { + fetch('/assets/file.txt') + .then(response => response.text()) + .then(fileText => { + expect(fileText).toMatch('assets-folder-content'); + done(); + }); + }); + it('should serve files explicitly added to assets array', (done) => { + fetch('/file.txt') + .then(response => response.text()) + .then(fileText => { + expect(fileText).toMatch('file-content'); + done(); + }); + }); + }); + ` + })) + // Test failure condition (no assets in .angular-cli.json) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['assets'] = []; + })) + .then(() => expectToFail(() => ng('test', '--single-run'), + 'Should fail because the assets to serve were not in the Angular CLI config')) + // Test passing condition (assets are included) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['assets'] = ['assets', 'file.txt']; + })) + .then(() => ng('test', '--single-run')); +} diff --git a/tests/e2e/tests/test/test-scripts.ts b/tests/e2e/tests/test/test-scripts.ts index 2e4d581d1bb5..ddc9fd90b318 100644 --- a/tests/e2e/tests/test/test-scripts.ts +++ b/tests/e2e/tests/test/test-scripts.ts @@ -58,7 +58,7 @@ export default function () { })) // should fail because the global scripts were not added to scripts array .then(() => expectToFail(() => ng('test', '--single-run'))) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['scripts'] = [ 'string-script.js', diff --git a/tests/e2e/tests/third-party/bootstrap.ts b/tests/e2e/tests/third-party/bootstrap.ts index b8a8de5384a8..6208fd17637f 100644 --- a/tests/e2e/tests/third-party/bootstrap.ts +++ b/tests/e2e/tests/third-party/bootstrap.ts @@ -7,7 +7,7 @@ import {oneLineTrim} from 'common-tags'; export default function() { return Promise.resolve() .then(() => npm('install', 'bootstrap@next')) - .then(() => updateJsonFile('angular-cli.json', configJson => { + .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson['apps'][0]; app['styles'].push('../node_modules/bootstrap/dist/css/bootstrap.css'); app['scripts'].push(
f209cb55456471ad1ed29295f783322cce010766
2021-05-31 17:18:18
Alan Agius
test(@angular-devkit/core): update host tests to not use deprecated Jasmine behaviour
false
update host tests to not use deprecated Jasmine behaviour
test
diff --git a/packages/angular_devkit/core/src/workspace/core_spec.ts b/packages/angular_devkit/core/src/workspace/core_spec.ts index 1dc00f3eb45e..932970f84cb6 100644 --- a/packages/angular_devkit/core/src/workspace/core_spec.ts +++ b/packages/angular_devkit/core/src/workspace/core_spec.ts @@ -19,7 +19,7 @@ import { WorkspaceDefinition } from './definitions'; import { WorkspaceHost } from './host'; describe('readWorkspace', () => { - it('attempts to read from specified file path [angular.json]', async (done) => { + it('attempts to read from specified file path [angular.json]', async () => { const requestedPath = '/path/to/workspace/angular.json'; const host: WorkspaceHost = { @@ -42,11 +42,9 @@ describe('readWorkspace', () => { }; await readWorkspace(requestedPath, host); - - done(); }); - it('attempts to read from specified file path [.angular.json]', async (done) => { + it('attempts to read from specified file path [.angular.json]', async () => { const requestedPath = '/path/to/workspace/.angular.json'; const host: WorkspaceHost = { @@ -69,11 +67,9 @@ describe('readWorkspace', () => { }; await readWorkspace(requestedPath, host); - - done(); }); - it('attempts to read from specified non-standard file path with format', async (done) => { + it('attempts to read from specified non-standard file path with format', async () => { const requestedPath = '/path/to/workspace/abc.json'; const host: WorkspaceHost = { @@ -96,11 +92,9 @@ describe('readWorkspace', () => { }; await readWorkspace(requestedPath, host, WorkspaceFormat.JSON); - - done(); }); - it('errors when reading from specified non-standard file path without format', async (done) => { + it('errors when reading from specified non-standard file path without format', async () => { const requestedPath = '/path/to/workspace/abc.json'; const host: WorkspaceHost = { @@ -128,11 +122,9 @@ describe('readWorkspace', () => { } catch (e) { expect(e.message).toContain('Unable to determine format for workspace path'); } - - done(); }); - it('errors when reading from specified file path with invalid specified format', async (done) => { + it('errors when reading from specified file path with invalid specified format', async () => { const requestedPath = '/path/to/workspace/angular.json'; const host: WorkspaceHost = { @@ -160,11 +152,9 @@ describe('readWorkspace', () => { } catch (e) { expect(e.message).toContain('Unsupported workspace format'); } - - done(); }); - it('attempts to find/read from directory path', async (done) => { + it('attempts to find/read from directory path', async () => { const requestedPath = getSystemPath(normalize('/path/to/workspace')); const expectedFile = getSystemPath(join(normalize(requestedPath), '.angular.json')); @@ -201,11 +191,9 @@ describe('readWorkspace', () => { getSystemPath(join(normalize(requestedPath), '.angular.json')), ].sort(), ); - - done(); }); - it('attempts to find/read only files for specified format from directory path', async (done) => { + it('attempts to find/read only files for specified format from directory path', async () => { const requestedPath = '/path/to/workspace'; const isFileChecks: string[] = []; @@ -246,11 +234,9 @@ describe('readWorkspace', () => { readFileChecks.sort(); expect(readFileChecks).toEqual([getSystemPath(join(normalize(requestedPath), 'angular.json'))]); - - done(); }); - it('errors when no file found from specified directory path', async (done) => { + it('errors when no file found from specified directory path', async () => { const requestedPath = '/path/to/workspace'; const host: WorkspaceHost = { @@ -280,13 +266,11 @@ describe('readWorkspace', () => { } catch (e) { expect(e.message).toContain('Unable to locate a workspace file'); } - - done(); }); }); describe('writeWorkspace', () => { - it('attempts to write to specified file path', async (done) => { + it('attempts to write to specified file path', async () => { const requestedPath = '/path/to/workspace/angular.json'; let writtenPath: string | undefined; @@ -314,11 +298,9 @@ describe('writeWorkspace', () => { await writeWorkspace({} as WorkspaceDefinition, host, requestedPath, WorkspaceFormat.JSON); expect(writtenPath).toBe(requestedPath); - - done(); }); - it('errors when writing to specified file path with invalid specified format', async (done) => { + it('errors when writing to specified file path with invalid specified format', async () => { const requestedPath = '/path/to/workspace/angular.json'; const host: WorkspaceHost = { @@ -348,11 +330,9 @@ describe('writeWorkspace', () => { } catch (e) { expect(e.message).toContain('Unsupported workspace format'); } - - done(); }); - it('errors when writing custom workspace without specified format', async (done) => { + it('errors when writing custom workspace without specified format', async () => { const requestedPath = '/path/to/workspace/angular.json'; const host: WorkspaceHost = { @@ -382,7 +362,5 @@ describe('writeWorkspace', () => { } catch (e) { expect(e.message).toContain('A format is required'); } - - done(); }); }); diff --git a/packages/angular_devkit/core/src/workspace/host_spec.ts b/packages/angular_devkit/core/src/workspace/host_spec.ts index 83abe4fef53c..2985e85bf360 100644 --- a/packages/angular_devkit/core/src/workspace/host_spec.ts +++ b/packages/angular_devkit/core/src/workspace/host_spec.ts @@ -21,18 +21,16 @@ describe('createWorkspaceHost', () => { workspaceHost = createWorkspaceHost(testHost); }); - it('supports isFile', async (done) => { + it('supports isFile', async () => { expect(await workspaceHost.isFile('abc.txt')).toBeTruthy(); expect(await workspaceHost.isFile('foo/bar.json')).toBeTruthy(); expect(await workspaceHost.isFile('foo\\bar.json')).toBeTruthy(); expect(await workspaceHost.isFile('foo')).toBeFalsy(); expect(await workspaceHost.isFile('not.there')).toBeFalsy(); - - done(); }); - it('supports isDirectory', async (done) => { + it('supports isDirectory', async () => { expect(await workspaceHost.isDirectory('foo')).toBeTruthy(); expect(await workspaceHost.isDirectory('foo/')).toBeTruthy(); expect(await workspaceHost.isDirectory('foo\\')).toBeTruthy(); @@ -40,22 +38,16 @@ describe('createWorkspaceHost', () => { expect(await workspaceHost.isDirectory('abc.txt')).toBeFalsy(); expect(await workspaceHost.isDirectory('foo/bar.json')).toBeFalsy(); expect(await workspaceHost.isDirectory('not.there')).toBeFalsy(); - - done(); }); - it('supports readFile', async (done) => { + it('supports readFile', async () => { expect(await workspaceHost.readFile('abc.txt')).toBe('abcdefg'); - - done(); }); - it('supports writeFile', async (done) => { + it('supports writeFile', async () => { await workspaceHost.writeFile('newfile', 'baz'); expect(testHost.files.sort() as string[]).toEqual(['/abc.txt', '/foo/bar.json', '/newfile']); expect(testHost.$read('newfile')).toBe('baz'); - - done(); }); });
d546b83e04bdd86a317b52f2de40a45e8c7ce769
2019-05-08 00:07:56
Filipe Silva
fix(@angular-devkit/architect): error run on input schema error (#14315)
false
error run on input schema error (#14315)
fix
diff --git a/packages/angular_devkit/architect/src/architect.ts b/packages/angular_devkit/architect/src/architect.ts index e2ecb429e2c4..941320afff3c 100644 --- a/packages/angular_devkit/architect/src/architect.ts +++ b/packages/angular_devkit/architect/src/architect.ts @@ -6,8 +6,17 @@ * found in the LICENSE file at https://angular.io/license */ import { analytics, experimental, json, logging } from '@angular-devkit/core'; -import { Observable, from, of } from 'rxjs'; -import { concatMap, first, map, shareReplay, switchMap } from 'rxjs/operators'; +import { Observable, from, merge, of, onErrorResumeNext } from 'rxjs'; +import { + concatMap, + first, + ignoreElements, + last, + map, + shareReplay, + switchMap, + takeUntil, +} from 'rxjs/operators'; import { BuilderInfo, BuilderInput, @@ -39,7 +48,8 @@ function _createJobHandlerFromBuilderInfo( }; function handler(argument: json.JsonObject, context: experimental.jobs.JobHandlerContext) { - const inboundBus = context.inboundBus.pipe( + // Add input validation to the inbound bus. + const inboundBusWithInputValidation = context.inboundBus.pipe( concatMap(message => { if (message.kind === experimental.jobs.JobInboundMessageKind.Input) { const v = message.value as BuilderInput; @@ -51,14 +61,12 @@ function _createJobHandlerFromBuilderInfo( // Validate v against the options schema. return registry.compile(info.optionSchema).pipe( concatMap(validation => validation(options)), - map(result => { - if (result.success) { - return { ...v, options: result.data } as BuilderInput; - } else if (result.errors) { - throw new json.schema.SchemaValidationException(result.errors); - } else { - return v; + map(({ data, success, errors }) => { + if (success) { + return { ...v, options: data } as BuilderInput; } + + throw new json.schema.SchemaValidationException(errors); }), map(value => ({ ...message, value })), ); @@ -71,7 +79,11 @@ function _createJobHandlerFromBuilderInfo( shareReplay(1), ); - return from(host.loadBuilder(info)).pipe( + // Make an inboundBus that completes instead of erroring out. + // We'll merge the errors into the output instead. + const inboundBus = onErrorResumeNext(inboundBusWithInputValidation); + + const output = from(host.loadBuilder(info)).pipe( concatMap(builder => { if (builder === null) { throw new Error(`Cannot load builder for builderInfo ${JSON.stringify(info, null, 2)}`); @@ -94,7 +106,19 @@ function _createJobHandlerFromBuilderInfo( }), ); }), + // Share subscriptions to the output, otherwise the the handler will be re-run. + shareReplay(), ); + + // Separate the errors from the inbound bus into their own observable that completes when the + // builder output does. + const inboundBusErrors = inboundBusWithInputValidation.pipe( + ignoreElements(), + takeUntil(onErrorResumeNext(output.pipe(last()))), + ); + + // Return the builder output plus any input errors. + return merge(inboundBusErrors, output); } return of(Object.assign(handler, { jobDescription }) as BuilderJobHandler); @@ -281,9 +305,9 @@ function _validateOptionsFactory(host: ArchitectHost, registry: json.schema.Sche switchMap(({ data, success, errors }) => { if (success) { return of(data as json.JsonObject); - } else { - throw new json.schema.SchemaValidationException(errors); } + + throw new json.schema.SchemaValidationException(errors); }), ).toPromise(); }, diff --git a/packages/angular_devkit/architect/src/index_spec.ts b/packages/angular_devkit/architect/src/index_spec.ts index 495738a4f043..24a44e487d49 100644 --- a/packages/angular_devkit/architect/src/index_spec.ts +++ b/packages/angular_devkit/architect/src/index_spec.ts @@ -191,6 +191,18 @@ describe('architect', () => { } }); + it('reports errors in options', async () => { + const builderName = 'options:error'; + const builder = createBuilder(() => ({ success: true })); + const optionSchema = { type: 'object', additionalProperties: false }; + testArchitectHost.addBuilder(builderName, builder, '', optionSchema); + + const run = await architect.scheduleBuilder(builderName, { extraProp: true }); + await expectAsync(run.result).toBeRejectedWith( + jasmine.objectContaining({ message: jasmine.stringMatching('extraProp') })); + await run.stop(); + }); + it('exposes getTargetOptions() properly', async () => { const goldenOptions = { value: 'value',
d43efe7bdec8ca8ef8ea51dcc1752b2488d2c9ec
2024-02-13 20:38:29
Angular Robot
build: update dependency @typescript-eslint/eslint-plugin to v7
false
update dependency @typescript-eslint/eslint-plugin to v7
build
diff --git a/package.json b/package.json index 6bf0228107f7..20bad5692b16 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "@types/yargs": "^17.0.20", "@types/yargs-parser": "^21.0.0", "@types/yarnpkg__lockfile": "^1.1.5", - "@typescript-eslint/eslint-plugin": "6.21.0", + "@typescript-eslint/eslint-plugin": "7.0.1", "@typescript-eslint/parser": "7.0.1", "@vitejs/plugin-basic-ssl": "1.1.0", "@web/test-runner": "^0.18.0", diff --git a/yarn.lock b/yarn.lock index d6c29f17851d..e1b8ef7f263c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4017,16 +4017,16 @@ dependencies: "@types/node" "*" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" - integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== +"@typescript-eslint/[email protected]": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz#407daffe09d964d57aceaf3ac51846359fbe61b0" + integrity sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/type-utils" "6.21.0" - "@typescript-eslint/utils" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" + "@typescript-eslint/scope-manager" "7.0.1" + "@typescript-eslint/type-utils" "7.0.1" + "@typescript-eslint/utils" "7.0.1" + "@typescript-eslint/visitor-keys" "7.0.1" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -4045,14 +4045,6 @@ "@typescript-eslint/visitor-keys" "7.0.1" debug "^4.3.4" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" - integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - "@typescript-eslint/[email protected]": version "7.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.0.1.tgz#611ec8e78c70439b152a805e1b10aaac36de7c00" @@ -4061,40 +4053,21 @@ "@typescript-eslint/types" "7.0.1" "@typescript-eslint/visitor-keys" "7.0.1" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" - integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== +"@typescript-eslint/[email protected]": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.0.1.tgz#0fba92c1f81cad561d7b3adc812aa1cc0e35cdae" + integrity sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw== dependencies: - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/typescript-estree" "7.0.1" + "@typescript-eslint/utils" "7.0.1" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" - integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== - "@typescript-eslint/[email protected]": version "7.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.0.1.tgz#dcfabce192db5b8bf77ea3c82cfaabe6e6a3c901" integrity sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg== -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" - integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "9.0.3" - semver "^7.5.4" - ts-api-utils "^1.0.1" - "@typescript-eslint/[email protected]": version "7.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz#1d52ac03da541693fa5bcdc13ad655def5046faf" @@ -4109,27 +4082,19 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" - integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== +"@typescript-eslint/[email protected]": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.0.1.tgz#b8ceac0ba5fef362b4a03a33c0e1fedeea3734ed" + integrity sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/scope-manager" "7.0.1" + "@typescript-eslint/types" "7.0.1" + "@typescript-eslint/typescript-estree" "7.0.1" semver "^7.5.4" -"@typescript-eslint/[email protected]": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" - integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== - dependencies: - "@typescript-eslint/types" "6.21.0" - eslint-visitor-keys "^3.4.1" - "@typescript-eslint/[email protected]": version "7.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz#864680ac5a8010ec4814f8a818e57595f79f464e"
1b43c0507fa0aa2ece0458d72dd1022d11150e0f
2025-02-25 05:04:09
Charles Lyding
fix(@schematics/angular): add additional checks for application builder usage
false
add additional checks for application builder usage
fix
diff --git a/packages/angular/pwa/pwa/index.ts b/packages/angular/pwa/pwa/index.ts index c075fd627b1d..28b0bc864522 100644 --- a/packages/angular/pwa/pwa/index.ts +++ b/packages/angular/pwa/pwa/index.ts @@ -96,10 +96,14 @@ export default function (options: PwaOptions): Rule { for (const target of project.targets.values()) { if ( target.builder === '@angular-devkit/build-angular:browser' || - target.builder === '@angular-devkit/build-angular:application' + target.builder === '@angular-devkit/build-angular:application' || + target.builder === '@angular/build:application' ) { buildTargets.push(target); - } else if (target.builder === '@angular-devkit/build-angular:karma') { + } else if ( + target.builder === '@angular-devkit/build-angular:karma' || + target.builder === '@angular/build:karma' + ) { testTargets.push(target); } } diff --git a/packages/angular/pwa/pwa/index_spec.ts b/packages/angular/pwa/pwa/index_spec.ts index 7d4097243599..37677894b446 100644 --- a/packages/angular/pwa/pwa/index_spec.ts +++ b/packages/angular/pwa/pwa/index_spec.ts @@ -169,4 +169,44 @@ describe('PWA Schematic', () => { expect(swFlag).toBeTrue(); }); }); + + describe('@angular-devkit/build-angular:application builder', () => { + beforeEach(() => { + const config = JSON.parse(appTree.readContent('/angular.json')); + const build = config.projects.bar.architect.build; + + build.builder = '@angular-devkit/build-angular:application'; + + appTree.overwrite('/angular.json', JSON.stringify(config, undefined, 2)); + }); + + it('should run the service worker schematic', async () => { + const tree = await schematicRunner.runSchematic('ng-add', defaultOptions, appTree); + const configText = tree.readContent('/angular.json'); + const config = JSON.parse(configText); + const swFlag = config.projects.bar.architect.build.configurations.production.serviceWorker; + + expect(swFlag).toBe('projects/bar/ngsw-config.json'); + }); + }); + + describe('@angular/build:application builder', () => { + beforeEach(() => { + const config = JSON.parse(appTree.readContent('/angular.json')); + const build = config.projects.bar.architect.build; + + build.builder = '@angular/build:application'; + + appTree.overwrite('/angular.json', JSON.stringify(config, undefined, 2)); + }); + + it('should run the service worker schematic', async () => { + const tree = await schematicRunner.runSchematic('ng-add', defaultOptions, appTree); + const configText = tree.readContent('/angular.json'); + const config = JSON.parse(configText); + const swFlag = config.projects.bar.architect.build.configurations.production.serviceWorker; + + expect(swFlag).toBe('projects/bar/ngsw-config.json'); + }); + }); }); diff --git a/packages/schematics/angular/config/files/karma.conf.js.template b/packages/schematics/angular/config/files/karma.conf.js.template index f8da22b16e55..4bd2af418f5b 100644 --- a/packages/schematics/angular/config/files/karma.conf.js.template +++ b/packages/schematics/angular/config/files/karma.conf.js.template @@ -4,13 +4,13 @@ module.exports = function (config) { config.set({ basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], + frameworks: ['jasmine'<% if (needDevkitPlugin) { %>, '@angular-devkit/build-angular'<% } %>], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') + require('karma-coverage'),<% if (needDevkitPlugin) { %> + require('@angular-devkit/build-angular/plugins/karma')<% } %> ], client: { jasmine: { diff --git a/packages/schematics/angular/config/index.ts b/packages/schematics/angular/config/index.ts index ad5bc19fb6bf..638766e67a42 100644 --- a/packages/schematics/angular/config/index.ts +++ b/packages/schematics/angular/config/index.ts @@ -67,9 +67,13 @@ function addKarmaConfig(options: ConfigOptions): Rule { ); } - if (testTarget.builder !== AngularBuilder.Karma) { + if ( + testTarget.builder !== AngularBuilder.Karma && + testTarget.builder !== AngularBuilder.BuildKarma + ) { throw new SchematicsException( - `Cannot add a karma configuration as builder for "test" target in project does not use "${AngularBuilder.Karma}".`, + `Cannot add a karma configuration as builder for "test" target in project does not` + + ` use "${AngularBuilder.Karma}" or "${AngularBuilder.BuildKarma}".`, ); } @@ -88,6 +92,7 @@ function addKarmaConfig(options: ConfigOptions): Rule { applyTemplates({ relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(project.root), folderName, + needDevkitPlugin: testTarget.builder === AngularBuilder.Karma, }), move(project.root), ]), diff --git a/packages/schematics/angular/config/index_spec.ts b/packages/schematics/angular/config/index_spec.ts index 3cafd7b42f49..8d160d8c0a1d 100644 --- a/packages/schematics/angular/config/index_spec.ts +++ b/packages/schematics/angular/config/index_spec.ts @@ -58,6 +58,24 @@ describe('Config Schematic', () => { expect(tree.exists('projects/foo/karma.conf.js')).toBeTrue(); }); + it('should include devkit karma plugin by default', async () => { + const tree = await runConfigSchematic(ConfigType.Karma); + const karmaConf = tree.readText('projects/foo/karma.conf.js'); + expect(karmaConf).toContain(`'@angular-devkit/build-angular'`); + }); + + it('should not include devkit karma plugin with angular/build:karma is used', async () => { + applicationTree.overwrite( + 'angular.json', + applicationTree + .readText('angular.json') + .replace('@angular-devkit/build-angular:karma', '@angular/build:karma'), + ); + const tree = await runConfigSchematic(ConfigType.Karma); + const karmaConf = tree.readText('projects/foo/karma.conf.js'); + expect(karmaConf).not.toContain(`'@angular-devkit/build-angular'`); + }); + it('should set the right coverage folder', async () => { const tree = await runConfigSchematic(ConfigType.Karma); const karmaConf = tree.readText('projects/foo/karma.conf.js'); diff --git a/packages/schematics/angular/environments/index.ts b/packages/schematics/angular/environments/index.ts index 3ea1de2dd6fd..7082689c3348 100644 --- a/packages/schematics/angular/environments/index.ts +++ b/packages/schematics/angular/environments/index.ts @@ -76,7 +76,8 @@ function* generateConfigurationEnvironments( if ( buildTarget.builder !== AngularBuilder.Browser && buildTarget.builder !== AngularBuilder.BrowserEsbuild && - buildTarget.builder !== AngularBuilder.Application + buildTarget.builder !== AngularBuilder.Application && + buildTarget.builder !== AngularBuilder.BuildApplication ) { yield log( 'warn', diff --git a/packages/schematics/angular/service-worker/index.ts b/packages/schematics/angular/service-worker/index.ts index 46092f449d37..e32969d9d0c6 100644 --- a/packages/schematics/angular/service-worker/index.ts +++ b/packages/schematics/angular/service-worker/index.ts @@ -122,7 +122,10 @@ export default function (options: ServiceWorkerOptions): Rule { let browserEntryPoint: string | undefined; const ngswConfigPath = join(normalize(project.root), 'ngsw-config.json'); - if (buildTarget.builder === Builders.Application) { + if ( + buildTarget.builder === Builders.Application || + buildTarget.builder === Builders.BuildApplication + ) { browserEntryPoint = buildOptions.browser as string; const productionConf = buildTarget.configurations?.production; if (productionConf) { diff --git a/packages/schematics/angular/utility/workspace-models.ts b/packages/schematics/angular/utility/workspace-models.ts index fd7eaf4d60f4..34c329b470d1 100644 --- a/packages/schematics/angular/utility/workspace-models.ts +++ b/packages/schematics/angular/utility/workspace-models.ts @@ -26,11 +26,14 @@ export enum Builders { Prerender = '@angular-devkit/build-angular:prerender', BrowserEsbuild = '@angular-devkit/build-angular:browser-esbuild', Karma = '@angular-devkit/build-angular:karma', + BuildKarma = '@angular/build:karma', TsLint = '@angular-devkit/build-angular:tslint', NgPackagr = '@angular-devkit/build-angular:ng-packagr', BuildNgPackagr = '@angular/build:ng-packagr', DevServer = '@angular-devkit/build-angular:dev-server', + BuildDevServer = '@angular/build:dev-server', ExtractI18n = '@angular-devkit/build-angular:extract-i18n', + BuildExtractI18n = '@angular/build:extract-i18n', Protractor = '@angular-devkit/build-angular:private-protractor', BuildApplication = '@angular/build:application', }
71f2e715541b894e43fc4864b09bb821c9cb7ee5
2018-08-16 04:15:08
Alex Eagle
docs: Restore SAVED_REPLIES (#11902)
false
Restore SAVED_REPLIES (#11902)
docs
diff --git a/.github/SAVED_REPLIES.md b/.github/SAVED_REPLIES.md new file mode 100644 index 000000000000..29e19832903c --- /dev/null +++ b/.github/SAVED_REPLIES.md @@ -0,0 +1,100 @@ +# Saved Responses for Angular CLI's Issue Tracker + +The following are canned responses that the Angular CLI team should use to close issues on our issue tracker that fall into the listed resolution categories. + +Since GitHub currently doesn't allow us to have a repository-wide or organization-wide list of [saved replies](https://help.github.com/articles/working-with-saved-replies/), these replies need to be maintained by individual team members. Since the responses can be modified in the future, all responses are versioned to simplify the process of keeping the responses up to date. + + +## Angular CLI: Already Fixed (v1) +``` +Thanks for reporting this issue. Luckily, it has already been fixed in one of the recent releases. Please update to the most recent version to resolve the problem. + +If the problem persists in your application after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use `ng new repro-app` to create a new project where you reproduce the problem. +``` + + +## Angular CLI: Don't Understand (v1) +``` +I'm sorry, but we don't understand the problem you are reporting. + +If the problem persists, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use `ng new repro-app` to create a new project where you reproduce the problem. +``` + + +## Angular CLI: Duplicate (v1.1) +``` +Thanks for reporting this issue. However, this issue is a duplicate of #<ISSUE_NUMBER>. Please subscribe to that issue for future updates. +``` + + +## Angular CLI: Insufficient Information Provided (v1) +``` +Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out [our submission guidelines](https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md#-submitting-an-issue) to understand why we can't act on issues that are lacking important information. + +If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template. +``` + + +## Angular CLI: NPM install issue (v1) +``` +This seems like a problem with your node/npm and not with Angular CLI. + +Please have a look at the [fixing npm permissions page](https://docs.npmjs.com/getting-started/fixing-npm-permissions), [common errors page](https://docs.npmjs.com/troubleshooting/common-errors), [npm issue tracker](https://github.com/npm/npm/issues), or open a new issue if the problem you are experiencing isn't known. +``` + + +## Angular CLI: Issue Outside of Angular CLI (v1.1) +``` +I'm sorry, but this issue is not caused by Angular CLI. Please contact the author(s) of the <PROJECT NAME> project or file an issue on their issue tracker. +``` + + +## Angular CLI: Non-reproducible (v1) +``` +I'm sorry, but we can't reproduce the problem following the instructions you provided. +Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue. +Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it. + +If the problem persists, please open a new issue following [our submission guidelines](https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md#-submitting-an-issue). + +A good way to make a minimal repro is to create a new app via `ng new repro-app` and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here. +``` + + +## Angular CLI: Obsolete (v1) +``` +Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version. + +If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. +``` + + +## Angular CLI: Support Request (v1) +``` +Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on [StackOverflow](http://stackoverflow.com/) using tag `angular-cli`. + +If you are wondering why we don't resolve support issues via the issue tracker, please [check out this explanation](https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md#-got-a-question-or-problem). +``` + + +## Angular CLI: Static Analysis errors (v1) +``` +Hello, errors like `Error encountered resolving symbol values statically` mean that there has been some problem in statically analyzing your app. + +Angular CLI always runs *some* static analysis, even in JIT mode, in order to discover lazy-loaded routes. +This may cause a lot of static analysis errors to surface when importing your project into the CLI, or upgrading for older versions where we didn't run this kind of analysis. + +Below are good resources on how to to debug these errors: +- https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60 +- https://github.com/rangle/angular-2-aot-sandbox#aot-dos-and-donts + +If your problem still persists, it might be a bug with the Angular Compiler itself. +In that case, please open an issue in https://github.com/angular/angular. +``` + +## Angular CLI: Lockfiles (v1) +``` +I'd like to remind everyone that **you only have reproducible installs if you use a lockfile**. Both [NPM v5+](https://docs.npmjs.com/files/package-locks) and [Yarn](https://yarnpkg.com/lang/en/docs/yarn-lock/) support lockfiles. If your CI works one day but not the next and you did not change your code or `package.json`, it is likely because one of your dependencies had a bad release and you did not have a lockfile. + +**It is your responsibility as a library consumer to use lockfiles**. No one wants to do a release with bugs but it sometimes happens, and the best we can do is to fix it as fast as possible with a new release. When you have a couple of thousand total dependencies it is only a matter of time until one of them has a bad release. +```
8863bc002aad20329194a5f7716b87b32b4a0b3a
2019-01-15 23:46:25
Unknown
feat(@schematics/angular): Added multiselect guard implements option
false
Added multiselect guard implements option
feat
diff --git a/packages/schematics/angular/guard/files/__name@dasherize__.guard.ts b/packages/schematics/angular/guard/files/__name@dasherize__.guard.ts index 1aa0068e9aef..02babf15472d 100644 --- a/packages/schematics/angular/guard/files/__name@dasherize__.guard.ts +++ b/packages/schematics/angular/guard/files/__name@dasherize__.guard.ts @@ -1,14 +1,24 @@ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { <%= implementationImports %>ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) -export class <%= classify(name) %>Guard implements CanActivate { - canActivate( +export class <%= classify(name) %>Guard implements <%= implementations %> { + <% if (implements.includes('CanActivate')) { %>canActivate( next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { return true; } + <% } %><% if (implements.includes('CanActivateChild')) { %>canActivateChild( + next: ActivatedRouteSnapshot, + state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { + return true; + } + <% } %><% if (implements.includes('CanLoad')) { %>canLoad( + route: Route, + segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean { + return true; + }<% } %> } diff --git a/packages/schematics/angular/guard/index.ts b/packages/schematics/angular/guard/index.ts index 660caee84c35..efd617b94287 100644 --- a/packages/schematics/angular/guard/index.ts +++ b/packages/schematics/angular/guard/index.ts @@ -36,6 +36,20 @@ export default function (options: GuardOptions): Rule { if (options.path === undefined) { options.path = buildDefaultPath(project); } + if (options.implements === undefined) { + options.implements = []; + } + + let implementations = ''; + let implementationImports = ''; + if (options.implements.length > 0) { + implementations = options.implements.join(', '); + implementationImports = `${implementations}, `; + // As long as we aren't in IE... ;) + if (options.implements.includes('CanLoad')) { + implementationImports = `${implementationImports}Route, UrlSegment, `; + } + } const parsedPath = parseName(options.path, options.name); options.name = parsedPath.name; @@ -47,6 +61,8 @@ export default function (options: GuardOptions): Rule { const templateSource = apply(url('./files'), [ options.skipTests ? filter(path => !path.endsWith('.spec.ts')) : noop(), template({ + implementations, + implementationImports, ...strings, ...options, }), diff --git a/packages/schematics/angular/guard/index_spec.ts b/packages/schematics/angular/guard/index_spec.ts index 7c0077fd089b..0c8c413ab970 100644 --- a/packages/schematics/angular/guard/index_spec.ts +++ b/packages/schematics/angular/guard/index_spec.ts @@ -10,7 +10,6 @@ import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as GuardOptions } from './schema'; - describe('Guard Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', @@ -64,4 +63,30 @@ describe('Guard Schematic', () => { appTree = schematicRunner.runSchematic('guard', defaultOptions, appTree); expect(appTree.files).toContain('/projects/bar/custom/app/foo.guard.ts'); }); + + it('should respect the implements value', () => { + const options = { ...defaultOptions, implements: ['CanActivate']}; + const tree = schematicRunner.runSchematic('guard', options, appTree); + const fileString = tree.readContent('/projects/bar/src/app/foo.guard.ts'); + expect(fileString).toContain('CanActivate'); + expect(fileString).toContain('canActivate'); + expect(fileString).not.toContain('CanActivateChild'); + expect(fileString).not.toContain('canActivateChild'); + expect(fileString).not.toContain('CanLoad'); + expect(fileString).not.toContain('canLoad'); + }); + + it('should respect the implements values', () => { + const implementationOptions = ['CanActivate', 'CanLoad', 'CanActivateChild']; + const options = { ...defaultOptions, implements: implementationOptions}; + const tree = schematicRunner.runSchematic('guard', options, appTree); + const fileString = tree.readContent('/projects/bar/src/app/foo.guard.ts'); + + // Should contain all implementations + implementationOptions.forEach((implementation: string) => { + expect(fileString).toContain(implementation); + const functionName = `${implementation.charAt(0).toLowerCase()}${implementation.slice(1)}`; + expect(fileString).toContain(functionName); + }); + }); }); diff --git a/packages/schematics/angular/guard/schema.json b/packages/schematics/angular/guard/schema.json index a71b831a974f..2ad3a42e9e66 100644 --- a/packages/schematics/angular/guard/schema.json +++ b/packages/schematics/angular/guard/schema.json @@ -47,6 +47,24 @@ "type": "boolean", "default": false, "description": "When true, applies lint fixes after generating the guard." + }, + "implements": { + "type": "array", + "description": "Specifies which interfaces to implement.", + "uniqueItems": true, + "items": { + "type": "string" + }, + "x-prompt": { + "message": "Which interfaces would you like to implement?", + "type": "list", + "multiselect": true, + "items": [ + "CanActivate", + "CanActivateChild", + "CanLoad" + ] + } } }, "required": [
a537c751a1878fe13361d6f30a10ad86ff3b68e1
2021-06-08 16:00:49
Renovate Bot
build: update angular to a64314e
false
update angular to a64314e
build
diff --git a/package.json b/package.json index 5ebc0b2f9079..adb26be8111e 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@angular/compiler": "12.0.3", "@angular/compiler-cli": "12.0.3", "@angular/core": "12.0.3", - "@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#7308e71916da94b51a9b558693c49a04bfc98beb", + "@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#b945d698497fe2d412f209641cf69fde54276f5d", "@angular/forms": "12.0.3", "@angular/localize": "12.0.3", "@angular/material": "12.0.3", diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json index d7471bc203aa..d2ca01d84536 100644 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ b/tests/legacy-cli/e2e/ng-snapshot/package.json @@ -2,21 +2,21 @@ "description": "snapshot versions of Angular for e2e testing", "private": true, "dependencies": { - "@angular/animations": "github:angular/animations-builds#6cbbe0e3347f0b75fcb1f848c54c49590fcca064", - "@angular/cdk": "github:angular/cdk-builds#d750b5fec7a8d98046de31dc8fd978afd62f28cf", - "@angular/common": "github:angular/common-builds#a287d902d9602b8a52db347856b25925f88672fc", - "@angular/compiler": "github:angular/compiler-builds#e1c26d1ecb8656bafcead355cad1bc46bfe6637c", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#67d84394f68f92fe50ec95dbcb4969e9851f040b", - "@angular/core": "github:angular/core-builds#5da34dd01af14e6de79feb506b51b9a229d3c7d2", - "@angular/forms": "github:angular/forms-builds#955f64f17a3c55fea317406fe0a7b556b46a2d70", - "@angular/language-service": "github:angular/language-service-builds#5f49c8abd1c592a201a5b82158a3e380881a92db", - "@angular/localize": "github:angular/localize-builds#66d48ff188f073ca53c30f87bd4a36e1b4516ea7", - "@angular/material": "github:angular/material2-builds#201167edc196206bfca44de18f73ef171104a60b", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#0b54be774ccb12db9d3016d129caeb4af5e39161", - "@angular/platform-browser": "github:angular/platform-browser-builds#00866027453f86dee7c294268630864b00de7c83", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#60d03cc2842d40dd6946c036169ddf01bacfdc54", - "@angular/platform-server": "github:angular/platform-server-builds#916c59527aa4b28cd42cc5ed04fc1d487a78ea20", - "@angular/router": "github:angular/router-builds#1cab9b7dbb0da07569b17b95b94f4d7df20c7dfb", - "@angular/service-worker": "github:angular/service-worker-builds#b848528c1bf8f75a5cc99b56dee2862c3fff61d7" + "@angular/animations": "github:angular/animations-builds#a64314e26d5df8d773afc58639936128c2a858e5", + "@angular/cdk": "github:angular/cdk-builds#fd416584a94de24744ce2daa579a746f8f8f7097", + "@angular/common": "github:angular/common-builds#bf9da482674c5dd6bbd4a0e13d1893bd0713a22b", + "@angular/compiler": "github:angular/compiler-builds#8d852abaa037f0c885efb1c59167e9da4f3f8e18", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#dfa5be1380f350048971b401dceb881b27d818b4", + "@angular/core": "github:angular/core-builds#e5a08f3e33998992d22d20ddf0100fd01b0b6733", + "@angular/forms": "github:angular/forms-builds#2b10422d71164691e05f703c561a6dbd4148efb9", + "@angular/language-service": "github:angular/language-service-builds#1ecfc4a7c5681556aec2d6ff448ba4612866315b", + "@angular/localize": "github:angular/localize-builds#b70f072926a12e94565b43735845cd8649d3ec43", + "@angular/material": "github:angular/material2-builds#559f1608ec2cb991c60cbabb3047360f3ecc4608", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#6862077c6a42467ab31e5208a0dd843af630f5e5", + "@angular/platform-browser": "github:angular/platform-browser-builds#d7890645485a1b4808e877f37286cc3722e8edf3", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#832765ea30ed9093faf45b7a547e56751cfa73a0", + "@angular/platform-server": "github:angular/platform-server-builds#63e76757be997de7ce73706d3b0fc13dc89c6d65", + "@angular/router": "github:angular/router-builds#e50b807477a8a50e7fc9218b7c4b5aadf33e7035", + "@angular/service-worker": "github:angular/service-worker-builds#2094c898a08a927a17d0c701c8830ed4fd9549b3" } } diff --git a/yarn.lock b/yarn.lock index 8257d0117d7b..06a3692c1ec0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -84,9 +84,10 @@ dependencies: tslib "^2.0.0" -"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#7308e71916da94b51a9b558693c49a04bfc98beb": +"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#b945d698497fe2d412f209641cf69fde54276f5d": version "0.0.0" - resolved "https://github.com/angular/dev-infra-private-builds.git#ccf49db26d09093bdb3882282d99f3448cf68cba" + uid b945d698497fe2d412f209641cf69fde54276f5d + resolved "https://github.com/angular/dev-infra-private-builds.git#b945d698497fe2d412f209641cf69fde54276f5d" dependencies: "@angular/benchpress" "0.2.1" "@bazel/buildifier" "^4.0.1" @@ -112,9 +113,9 @@ semver "^7.3.5" shelljs "^0.8.4" ts-node "^10.0.0" - tslib "^2.1.0" + tslib "^2.2.0" typed-graphqlify "^3.1.1" - typescript "~4.2.4" + typescript "~4.3.2" yaml "^1.10.0" yargs "^17.0.0"
5c969ea417f087ca4c9ae20efcd8b31133590216
2019-04-23 22:30:15
Charles Lyding
refactor(@angular-devkit/core): simplify workspace project/target addition
false
simplify workspace project/target addition
refactor
diff --git a/etc/api/angular_devkit/core/src/_golden-api.d.ts b/etc/api/angular_devkit/core/src/_golden-api.d.ts index 3bd0193425a6..74b968d99067 100644 --- a/etc/api/angular_devkit/core/src/_golden-api.d.ts +++ b/etc/api/angular_devkit/core/src/_golden-api.d.ts @@ -775,7 +775,7 @@ export declare class ProjectDefinitionCollection extends DefinitionCollection<Pr prefix?: string; targets?: Record<string, TargetDefinition | undefined>; [key: string]: unknown; - }): this; + }): ProjectDefinition; set(name: string, value: ProjectDefinition): this; } @@ -1058,7 +1058,7 @@ export declare class TargetDefinitionCollection extends DefinitionCollection<Tar constructor(initial?: Record<string, TargetDefinition>, listener?: DefinitionCollectionListener<TargetDefinition>); add(definition: { name: string; - } & TargetDefinition): this; + } & TargetDefinition): TargetDefinition; set(name: string, value: TargetDefinition): this; } diff --git a/packages/angular_devkit/core/src/workspace/definitions.ts b/packages/angular_devkit/core/src/workspace/definitions.ts index 86dfe5664c26..75dec6286f4b 100644 --- a/packages/angular_devkit/core/src/workspace/definitions.ts +++ b/packages/angular_devkit/core/src/workspace/definitions.ts @@ -149,7 +149,7 @@ export class ProjectDefinitionCollection extends DefinitionCollection<ProjectDef targets?: Record<string, TargetDefinition | undefined>, [key: string]: unknown, }, - ): this { + ): ProjectDefinition { if (this.has(definition.name)) { throw new Error('Project name already exists.'); } @@ -191,7 +191,7 @@ export class ProjectDefinitionCollection extends DefinitionCollection<ProjectDef super.set(definition.name, project); - return this; + return project; } set(name: string, value: ProjectDefinition): this { @@ -223,7 +223,7 @@ export class TargetDefinitionCollection extends DefinitionCollection<TargetDefin definition: { name: string, } & TargetDefinition, - ): this { + ): TargetDefinition { if (this.has(definition.name)) { throw new Error('Target name already exists.'); } @@ -237,7 +237,7 @@ export class TargetDefinitionCollection extends DefinitionCollection<TargetDefin super.set(definition.name, target); - return this; + return target; } set(name: string, value: TargetDefinition): this {
99326b90a45fc272401facc1d3ab5167c1d3f134
2025-01-28 13:37:44
Angular Robot
build: lock file maintenance
false
lock file maintenance
build
diff --git a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx index f2d49f2ef92a..3d9f48d4c39d 100755 --- a/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx +++ b/.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx @@ -17,6 +17,6 @@ packages/angular_devkit/schematics/package.json=673943597 packages/angular_devkit/schematics_cli/package.json=-1663529211 packages/ngtools/webpack/package.json=1463215526 packages/schematics/angular/package.json=251715148 -pnpm-lock.yaml=92615357 +pnpm-lock.yaml=343926070 pnpm-workspace.yaml=-1847919625 -yarn.lock=1856607555 +yarn.lock=1719236689 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6f0fe7feb95..6c03a70454d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 19.2.0-next.0(@angular/[email protected]) '@angular/bazel': specifier: https://github.com/angular/bazel-builds.git#73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d - version: github.com/angular/bazel-builds/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d(@angular/[email protected])(@bazel/[email protected])(@rollup/[email protected])(@rollup/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) + version: github.com/angular/bazel-builds/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d(@angular/[email protected])(@bazel/[email protected])(@rollup/[email protected])(@rollup/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]) '@angular/build-tooling': specifier: https://github.com/angular/dev-infra-private-build-tooling-builds.git#98e94daf3c5c414d59647fc78fffe527b5487bb6 version: github.com/angular/dev-infra-private-build-tooling-builds/98e94daf3c5c414d59647fc78fffe527b5487bb6([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) @@ -121,10 +121,10 @@ importers: version: 0.6.3 '@inquirer/confirm': specifier: 5.1.3 - version: 5.1.3(@types/[email protected]) + version: 5.1.3(@types/[email protected]) '@inquirer/prompts': specifier: 7.2.3 - version: 7.2.3(@types/[email protected]) + version: 7.2.3(@types/[email protected]) '@listr2/prompt-adapter-inquirer': specifier: 2.0.18 version: 2.0.18(@inquirer/[email protected]) @@ -178,7 +178,7 @@ importers: version: 4.17.14 '@types/node': specifier: ^18.13.0 - version: 18.19.71 + version: 18.19.74 '@types/npm-package-arg': specifier: ^6.1.0 version: 6.1.4 @@ -433,7 +433,7 @@ importers: version: 3.0.1 rollup-plugin-sourcemaps: specifier: ^0.6.0 - version: 0.6.3(@types/[email protected])([email protected]) + version: 0.6.3(@types/[email protected])([email protected]) rxjs: specifier: 7.8.1 version: 7.8.1 @@ -472,7 +472,7 @@ importers: version: 1.2.2 ts-node: specifier: ^10.9.1 - version: 10.9.2(@types/[email protected])([email protected]) + version: 10.9.2(@types/[email protected])([email protected]) tslib: specifier: 2.8.1 version: 2.8.1 @@ -493,7 +493,7 @@ importers: version: 10.2.2 vite: specifier: 6.0.11 - version: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) + version: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) watchpack: specifier: 2.4.2 version: 2.4.2 @@ -564,7 +564,7 @@ importers: version: 7.26.0(@babel/[email protected]) '@inquirer/confirm': specifier: 5.1.3 - version: 5.1.3(@types/[email protected]) + version: 5.1.3(@types/[email protected]) '@vitejs/plugin-basic-ssl': specifier: 1.2.0 version: 1.2.0([email protected]) @@ -615,7 +615,7 @@ importers: version: 7.6.3 vite: specifier: 6.0.11 - version: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) + version: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) watchpack: specifier: 2.4.2 version: 2.4.2 @@ -641,7 +641,7 @@ importers: version: link:../../angular_devkit/schematics '@inquirer/prompts': specifier: 7.2.3 - version: 7.2.3(@types/[email protected]) + version: 7.2.3(@types/[email protected]) '@listr2/prompt-adapter-inquirer': specifier: 2.0.18 version: 2.0.18(@inquirer/[email protected]) @@ -824,7 +824,7 @@ importers: version: link:../schematics '@inquirer/prompts': specifier: 7.2.3 - version: 7.2.3(@types/[email protected]) + version: 7.2.3(@types/[email protected]) ansi-colors: specifier: 4.1.3 version: 4.1.3 @@ -2605,7 +2605,7 @@ packages: arrify: 2.0.1 duplexify: 4.1.3 extend: 3.0.2 - google-auth-library: 9.15.0([email protected]) + google-auth-library: 9.15.1([email protected]) html-entities: 2.5.2 retry-request: 7.0.2([email protected]) teeny-request: 9.0.0([email protected]) @@ -2650,7 +2650,7 @@ packages: duplexify: 4.1.3 events-intercept: 2.0.0 extend: 3.0.2 - google-auth-library: 9.15.0([email protected]) + google-auth-library: 9.15.1([email protected]) google-gax: 4.4.1([email protected]) grpc-gcp: 1.0.1 is: 3.3.0 @@ -2714,35 +2714,35 @@ packages: deprecated: Use @eslint/object-schema instead dev: true - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-PgP35JfmGjHU0LSXOyRew0zHuA9N6OJwOlos1fZ20b7j8ISeAdib3L+n0jIxBtX958UeEpte6xhG/gxJ5iUqMw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/core': 10.1.4(@types/[email protected]) '@inquirer/figures': 1.0.9 - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-fuF9laMmHoOgWapF9h9hv6opA5WvmGFHsTYGCmuFxcghIhEhb3dN0CdQR4BUMqa2H506NCj8cGX4jwMsE4t6dA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-5y4/PUJVnRb4bwWY67KLdebWOhOc7xj5IP2J80oWXa64mVag24rwQ1VAdnj7/eDY/odhguW0zQ1Mp1pj6fO/2w==} engines: {node: '>=18'} dependencies: '@inquirer/figures': 1.0.9 - '@inquirer/type': 3.0.2(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -2753,114 +2753,114 @@ packages: transitivePeerDependencies: - '@types/node' - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-S9KnIOJuTZpb9upeRSBBhoDZv7aSV3pG9TECrBj0f+ZsFwccz886hzKBrChGrXMJwd4NKY+pOA9Vy72uqnd6Eg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 external-editor: 3.1.0 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-TRTfi1mv1GeIZGyi9PQmvAaH65ZlG4/FACq6wSzs7Vvf1z5dnNWsAAXBjWMHt76l+1hUY8teIqJFrWBk5N6gsg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 yoctocolors-cjs: 2.1.2 /@inquirer/[email protected]: resolution: {integrity: sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==} engines: {node: '>=18'} - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-zeo++6f7hxaEe7OjtMzdGZPHiawsfmCZxWB9X1NpmYgbeoyerIbWemvlBxxl+sQIlHC0WuSAG19ibMq3gbhaqQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-xO07lftUHk1rs1gR0KbqB+LJPhkUNkyzV/KhH+937hdkMazmAYHLm1OIrNKpPelppeV1FgWrgFDjdUD8mM+XUg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-QLF0HmMpHZPPMp10WGXh6F+ZPvzWE7LX6rNoccdktv/Rov0B+0f+eyXkAcgqy5cH9V+WSpbLxu2lo3ysEVK91w==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 ansi-escapes: 4.3.2 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-hzfnm3uOoDySDXfDNOm9usOuYIaQvTgKp/13l1uJoe6UNY+Zpcn2RYt0jXz3yA+yemGHvDOxVzqWl3S5sQq53Q==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/checkbox': 4.0.6(@types/[email protected]) - '@inquirer/confirm': 5.1.3(@types/[email protected]) - '@inquirer/editor': 4.2.3(@types/[email protected]) - '@inquirer/expand': 4.0.6(@types/[email protected]) - '@inquirer/input': 4.1.3(@types/[email protected]) - '@inquirer/number': 3.0.6(@types/[email protected]) - '@inquirer/password': 4.0.6(@types/[email protected]) - '@inquirer/rawlist': 4.0.6(@types/[email protected]) - '@inquirer/search': 3.0.6(@types/[email protected]) - '@inquirer/select': 4.0.6(@types/[email protected]) - '@types/node': 18.19.71 - - /@inquirer/[email protected](@types/[email protected]): + '@inquirer/checkbox': 4.0.6(@types/[email protected]) + '@inquirer/confirm': 5.1.3(@types/[email protected]) + '@inquirer/editor': 4.2.3(@types/[email protected]) + '@inquirer/expand': 4.0.6(@types/[email protected]) + '@inquirer/input': 4.1.3(@types/[email protected]) + '@inquirer/number': 3.0.6(@types/[email protected]) + '@inquirer/password': 4.0.6(@types/[email protected]) + '@inquirer/rawlist': 4.0.6(@types/[email protected]) + '@inquirer/search': 3.0.6(@types/[email protected]) + '@inquirer/select': 4.0.6(@types/[email protected]) + '@types/node': 18.19.74 + + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-QoE4s1SsIPx27FO4L1b1mUjVcoHm1pWE/oCmm4z/Hl+V1Aw5IXl8FYYzGmfXaBT0l/sWr49XmNSiq7kg3Kd/Lg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 yoctocolors-cjs: 2.1.2 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-eFZ2hiAq0bZcFPuFFBmZEtXU1EarHLigE+ENCtpO+37NHCl4+Yokq1P/d09kUblObaikwfo97w+0FtG/EXl5Ng==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/core': 10.1.4(@types/[email protected]) '@inquirer/figures': 1.0.9 - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 yoctocolors-cjs: 2.1.2 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-yANzIiNZ8fhMm4NORm+a74+KFYHmf7BZphSOBovIzYPVLquseTGEkU5l2UTnBOf5k0VLmTgPighNDLE9QtbViQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@inquirer/core': 10.1.4(@types/[email protected]) + '@inquirer/core': 10.1.4(@types/[email protected]) '@inquirer/figures': 1.0.9 - '@inquirer/type': 3.0.2(@types/[email protected]) - '@types/node': 18.19.71 + '@inquirer/type': 3.0.2(@types/[email protected]) + '@types/node': 18.19.74 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 @@ -2870,13 +2870,13 @@ packages: dependencies: mute-stream: 1.0.0 - /@inquirer/[email protected](@types/[email protected]): + /@inquirer/[email protected](@types/[email protected]): resolution: {integrity: sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' dependencies: - '@types/node': 18.19.71 + '@types/node': 18.19.74 /@isaacs/[email protected]: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -2982,7 +2982,7 @@ packages: peerDependencies: '@inquirer/prompts': '>= 3 < 8' dependencies: - '@inquirer/prompts': 7.2.3(@types/[email protected]) + '@inquirer/prompts': 7.2.3(@types/[email protected]) '@inquirer/type': 1.5.5 /@lmdb/[email protected]: @@ -3021,27 +3021,27 @@ packages: os: [win32] optional: true - /@microsoft/[email protected](@types/[email protected]): + /@microsoft/[email protected](@types/[email protected]): resolution: {integrity: sha512-3/t2F+WhkJgBzSNwlkTIL0tBgUoBqDqL66pT+nh2mPbM0NIDGVGtpqbGWPgHIzn/mn7kGS/Ep8D8po58e8UUIw==} dependencies: '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.10.2(@types/[email protected]) + '@rushstack/node-core-library': 5.10.2(@types/[email protected]) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/[email protected](@types/[email protected]): + /@microsoft/[email protected](@types/[email protected]): resolution: {integrity: sha512-jRTR/XbQF2kb+dYn8hfYSicOGA99+Fo00GrsdMwdfE3eIgLtKdH6Qa2M3wZV9S2XmbgCaGX1OdPtYctbfu5jQg==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.30.2(@types/[email protected]) + '@microsoft/api-extractor-model': 7.30.2(@types/[email protected]) '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.10.2(@types/[email protected]) + '@rushstack/node-core-library': 5.10.2(@types/[email protected]) '@rushstack/rig-package': 0.5.3 - '@rushstack/terminal': 0.14.5(@types/[email protected]) - '@rushstack/ts-command-line': 4.23.3(@types/[email protected]) + '@rushstack/terminal': 0.14.5(@types/[email protected]) + '@rushstack/ts-command-line': 4.23.3(@types/[email protected]) lodash: 4.17.21 minimatch: 3.0.8 resolve: 1.22.10 @@ -3299,17 +3299,17 @@ packages: resolution: {integrity: sha512-+t5DZ6mO/QFh78PByMq1fGSAub/agLJZDRfJRMeOSNCt8s9YVlTjmGpIPwPhvXTGUIJk+WszlT0rQa1W33yzNA==} engines: {node: ^18.17.0 || >=20.5.0} - /@npmcli/[email protected]: - resolution: {integrity: sha512-t6G+6ZInT4X+tqj2i+wlLIeCKnKOTuz9/VFYDtj+TGTur5q7sp/OYrQA19LdBbWfXDOi0Y4jtedV6xtB8zQ9ug==} + /@npmcli/[email protected]: + resolution: {integrity: sha512-d5qimadRAUCO4A/Txw71VM7UrRZzV+NPclxz/dc+M6B2oYwjWTjqh8HA/sGQgs9VZuJ6I/P7XIAlJvgrl27ZOw==} engines: {node: ^18.17.0 || >=20.5.0} dependencies: '@npmcli/git': 6.0.1 glob: 10.4.5 hosted-git-info: 8.0.2 json-parse-even-better-errors: 4.0.0 - normalize-package-data: 7.0.0 proc-log: 5.0.0 semver: 7.6.3 + validate-npm-package-license: 3.0.4 transitivePeerDependencies: - bluebird @@ -3328,7 +3328,7 @@ packages: engines: {node: ^18.17.0 || >=20.5.0} dependencies: '@npmcli/node-gyp': 4.0.0 - '@npmcli/package-json': 6.1.0 + '@npmcli/package-json': 6.1.1 '@npmcli/promise-spawn': 8.0.2 node-gyp: 11.0.0 proc-log: 5.0.0 @@ -3468,99 +3468,99 @@ packages: engines: {node: '>=14'} dev: true - /@parcel/[email protected]: - resolution: {integrity: sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ==} + /@parcel/[email protected]: + resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [android] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==} + /@parcel/[email protected]: + resolution: {integrity: sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [darwin] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [darwin] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw==} + /@parcel/[email protected]: + resolution: {integrity: sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [freebsd] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==} engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q==} + /@parcel/[email protected]: + resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==} + /@parcel/[email protected]: + resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig==} + /@parcel/[email protected]: + resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [win32] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA==} + /@parcel/[email protected]: + resolution: {integrity: sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==} engines: {node: '>= 10.0.0'} cpu: [ia32] os: [win32] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw==} + /@parcel/[email protected]: + resolution: {integrity: sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [win32] optional: true - /@parcel/[email protected]: - resolution: {integrity: sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ==} + /@parcel/[email protected]: + resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} dependencies: detect-libc: 1.0.3 @@ -3568,19 +3568,19 @@ packages: micromatch: 4.0.8 node-addon-api: 7.1.1 optionalDependencies: - '@parcel/watcher-android-arm64': 2.5.0 - '@parcel/watcher-darwin-arm64': 2.5.0 - '@parcel/watcher-darwin-x64': 2.5.0 - '@parcel/watcher-freebsd-x64': 2.5.0 - '@parcel/watcher-linux-arm-glibc': 2.5.0 - '@parcel/watcher-linux-arm-musl': 2.5.0 - '@parcel/watcher-linux-arm64-glibc': 2.5.0 - '@parcel/watcher-linux-arm64-musl': 2.5.0 - '@parcel/watcher-linux-x64-glibc': 2.5.0 - '@parcel/watcher-linux-x64-musl': 2.5.0 - '@parcel/watcher-win32-arm64': 2.5.0 - '@parcel/watcher-win32-ia32': 2.5.0 - '@parcel/watcher-win32-x64': 2.5.0 + '@parcel/watcher-android-arm64': 2.5.1 + '@parcel/watcher-darwin-arm64': 2.5.1 + '@parcel/watcher-darwin-x64': 2.5.1 + '@parcel/watcher-freebsd-x64': 2.5.1 + '@parcel/watcher-linux-arm-glibc': 2.5.1 + '@parcel/watcher-linux-arm-musl': 2.5.1 + '@parcel/watcher-linux-arm64-glibc': 2.5.1 + '@parcel/watcher-linux-arm64-musl': 2.5.1 + '@parcel/watcher-linux-x64-glibc': 2.5.1 + '@parcel/watcher-linux-x64-musl': 2.5.1 + '@parcel/watcher-win32-arm64': 2.5.1 + '@parcel/watcher-win32-ia32': 2.5.1 + '@parcel/watcher-win32-x64': 2.5.1 optional: true /@pkgjs/[email protected]: @@ -3866,8 +3866,8 @@ packages: os: [win32] optional: true - /@rollup/[email protected]: - resolution: {integrity: sha512-4N3ttsYqUIjCVHXRZ/AMJoaEONWhXFop8h6tOkX+n+PyuYAZFp+QRNRfD+VAn5NmUnLzwwmT4GaKFu5RAQSEvg==} + /@rollup/[email protected]: + resolution: {integrity: sha512-Dsr5270xEi7yFW3MjnLp+mBO+EW0qbdp+J+EPm+eCpA0nfYnWv/xExf85uTCBu18VVvGg0RTUqrUlwA/FUe2yQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: @@ -3880,7 +3880,7 @@ packages: resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} dev: true - /@rushstack/[email protected](@types/[email protected]): + /@rushstack/[email protected](@types/[email protected]): resolution: {integrity: sha512-xOF/2gVJZTfjTxbo4BDj9RtQq/HFnrrKdtem4JkyRLnwsRz2UDTg8gA1/et10fBx5RxmZD9bYVGST69W8ME5OQ==} peerDependencies: '@types/node': '*' @@ -3888,7 +3888,7 @@ packages: '@types/node': optional: true dependencies: - '@types/node': 18.19.71 + '@types/node': 18.19.74 ajv: 8.13.0 ajv-draft-04: 1.0.0([email protected]) ajv-formats: 3.0.1([email protected]) @@ -3906,7 +3906,7 @@ packages: strip-json-comments: 3.1.1 dev: true - /@rushstack/[email protected](@types/[email protected]): + /@rushstack/[email protected](@types/[email protected]): resolution: {integrity: sha512-TEOpNwwmsZVrkp0omnuTUTGZRJKTr6n6m4OITiNjkqzLAkcazVpwR1SOtBg6uzpkIBLgrcNHETqI8rbw3uiUfw==} peerDependencies: '@types/node': '*' @@ -3914,15 +3914,15 @@ packages: '@types/node': optional: true dependencies: - '@rushstack/node-core-library': 5.10.2(@types/[email protected]) - '@types/node': 18.19.71 + '@rushstack/node-core-library': 5.10.2(@types/[email protected]) + '@types/node': 18.19.74 supports-color: 8.1.1 dev: true - /@rushstack/[email protected](@types/[email protected]): + /@rushstack/[email protected](@types/[email protected]): resolution: {integrity: sha512-HazKL8fv4HMQMzrKJCrOrhyBPPdzk7iajUXgsASwjQ8ROo1cmgyqxt/k9+SdmrNLGE1zATgRqMUH3s/6smbRMA==} dependencies: - '@rushstack/terminal': 0.14.5(@types/[email protected]) + '@rushstack/terminal': 0.14.5(@types/[email protected]) '@types/argparse': 1.0.38 argparse: 1.0.10 string-argv: 0.3.2 @@ -4039,7 +4039,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4087,20 +4087,20 @@ packages: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: '@types/connect': 3.4.38 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-d2V8FDX/LbDCSm343N2VChzDxvll0h76I8oSigYpdLgPDmcdcR6fywTggKBkUiDM3qAbHOq7NZvepj/HJM5e2g==} dependencies: '@types/micromatch': 2.3.35 - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/serve-static': 1.15.7 chokidar: 3.6.0 dev: true @@ -4112,7 +4112,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-UhuhrQ5hclX6UJctv5m4Rfp52AfG9o9+d9/HwjxhVB5NjXxr5t9oKgJxN8xRHgr35oo8meUEHUPFWiKg6y71aA==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/qs': 6.9.18 dev: true @@ -4124,13 +4124,13 @@ packages: resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} dependencies: '@types/express-serve-static-core': 5.0.5 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4141,23 +4141,19 @@ packages: resolution: {integrity: sha512-ag0BfJLZf6CQz8VIuRIEYQ5Ggwk/82uvTQf27RcpyDNbY0Vw49LIPqAxk5tqYfrCs9xDaIMvl4aj7ZopnYL8bA==} dev: true - /@types/[email protected]: - resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} - dev: true - /@types/[email protected]: resolution: {integrity: sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==} dependencies: '@types/connect': 3.4.38 '@types/express': 5.0.0 '@types/keygrip': 1.0.6 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4167,7 +4163,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-2eahVPsd+dy3CL6FugAzJcxoraWhUghZGEQJns1kTKfCXWKJ5iG/VkaB05wRVrDKHfOFKqb0X0kXh91eE99RZg==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4194,7 +4190,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -4203,7 +4199,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -4231,13 +4227,13 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4251,7 +4247,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4299,7 +4295,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-sjE/MHnoAZAQYAKRXAbjTOiBKyGGErEM725bruRcmDdMa2vp1bjWPhApI7/i564PTyHlzc3vIGXLL6TFIpAxFg==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 log4js: 6.9.1 transitivePeerDependencies: - supports-color @@ -4325,7 +4321,7 @@ packages: '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4335,7 +4331,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-cgu0Xefgq9O5FjFR78jgI6X31aPjDWCaJ6LCfRtlj6BtyVVWiXagysSYlPACwGKAzRwsFLjKXcj4iGfcVt6cLw==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/webpack': 4.41.40 dev: true @@ -4370,20 +4366,20 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==} dev: true - /@types/[email protected]: - resolution: {integrity: sha512-evXpcgtZm8FY4jqBSN8+DmOTcVkkvTmAayeo4Wf3m1xAruyVGzGuDh/Fb/WWX2yLItUiho42ozyJjB0dw//Tkw==} + /@types/[email protected]: + resolution: {integrity: sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A==} dependencies: undici-types: 5.26.5 - /@types/[email protected]: - resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==} + /@types/[email protected]: + resolution: {integrity: sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==} dependencies: undici-types: 6.20.0 dev: true @@ -4395,7 +4391,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-db9iBh7kDDg4lRT4k4XZ6IiecTEgFCID4qk+VDVPbtzU855q3KZLCn08ATr4H27ntRJVhulQ7GWjl24H42x96w==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/node-fetch': 3.0.2 '@types/npm-package-arg': 6.1.4 '@types/npmlog': 7.0.0 @@ -4405,13 +4401,13 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-hJWbrKFvxKyWwSUXjZMYTINsSOY6IclhvGOZ97M8ac2tmR9hMwmTnYaMdpGhvju9ctWLTPhCS+eLfQNluiEjQQ==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-/XLR0VoTh2JEO0jJg1q/e6Rh9bxjBq9vorJuQmtT7rRrXSiWz7e7NsvXVYJQ0i8JxMlBMPPYDTnrRe7MZRFA8Q==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/npm-registry-fetch': 8.0.7 '@types/npmlog': 7.0.0 '@types/ssri': 7.1.5 @@ -4432,14 +4428,14 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-iadjw02vte8qWx7U0YM++EybBha2CQLPGu9iJ97whVgJUT5Zq9MjAPYUnbfRI2Kpehimf1QjFJYxD0t8nqzu5w==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-+cWbQUecD04MQYkjNBhPmcUIP368aloYmqm+ImdMKA8rMpxRNAhZAD6gIj+sAVTF1DliqrT/qUp6aGNi/9U3tw==} dependencies: '@types/duplexify': 3.6.4 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4458,7 +4454,7 @@ packages: resolution: {integrity: sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==} dependencies: '@types/caseless': 0.12.5 - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/tough-cookie': 4.0.5 form-data: 2.5.2 dev: true @@ -4466,7 +4462,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4488,8 +4484,8 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-Au7CXegiS7oapbB16zxPToY4Cjzi9UQQMf3W2ZZM8PigMLTGR3iUAHjPUTddyE5g1SBjT/qpmvlsAQLBfNAdKg==} dependencies: - '@types/node': 22.10.7 - '@types/ws': 8.5.13 + '@types/node': 22.10.10 + '@types/ws': 8.5.14 dev: true /@types/[email protected]: @@ -4500,7 +4496,7 @@ packages: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} dependencies: '@types/mime': 1.3.5 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4513,7 +4509,7 @@ packages: resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} dependencies: '@types/http-errors': 2.0.4 - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/send': 0.17.4 dev: true @@ -4521,13 +4517,13 @@ packages: resolution: {integrity: sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q==} dependencies: '@types/glob': 7.2.0 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4537,7 +4533,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4570,13 +4566,13 @@ packages: resolution: {integrity: sha512-SbuSavsPxfOPZwVHBgQUVuzYBe6+8KL7dwiJLXaj5rmv3DxktOMwX5WP1J6UontwUbewjVoc7pCgZvqy6rPn+A==} dependencies: '@types/graceful-fs': 4.1.9 - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-4nZOdMwSPHZ4pTEZzSp0AsTM4K7Qmu40UKW4tJDiOVs20UzYF9l+qUe4s0ftfN0pin06n+5cWWDJXH+sbhAiDw==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/source-list-map': 0.1.6 source-map: 0.7.4 dev: true @@ -4584,7 +4580,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-u6kMFSBM9HcoTpUXnL6mt2HSzftqb3JgYV6oxIgL2dl6sX6aCa5k6SOkzv5DuZjBTPUE/dJltKtwwuqrkZHpfw==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 '@types/tapable': 1.0.12 '@types/uglify-js': 3.17.5 '@types/webpack-sources': 3.2.3 @@ -4595,13 +4591,19 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true /@types/[email protected]: resolution: {integrity: sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 + dev: true + + /@types/[email protected]: + resolution: {integrity: sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw==} + dependencies: + '@types/node': 22.10.10 dev: true /@types/[email protected]: @@ -4621,7 +4623,7 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 dev: true optional: true @@ -4800,8 +4802,8 @@ packages: eslint-visitor-keys: 4.2.0 dev: true - /@ungap/[email protected]: - resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} + /@ungap/[email protected]: + resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} dev: true /@verdaccio/[email protected]: @@ -5034,7 +5036,7 @@ packages: peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 dependencies: - vite: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) + vite: 6.0.11(@types/[email protected])([email protected])([email protected])([email protected]) /@web/[email protected]: resolution: {integrity: sha512-ypmMG+72ERm+LvP+loj9A64MTXvWMXHUOu773cPO4L1SV/VWg6xA9Pv7vkvkXQX+ItJtCJt+KQ+U6ui2HhSFUw==} @@ -5373,9 +5375,9 @@ packages: through: 2.3.8 dev: true - /[email protected]: - resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + /[email protected]: + resolution: {integrity: sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==} + engines: {node: ^18.17.0 || >=20.5.0} /[email protected]: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -5536,7 +5538,7 @@ packages: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.0.5 + fast-uri: 3.0.6 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -5751,6 +5753,11 @@ packages: engines: {node: '>=0.8.0'} dev: true + /[email protected]: + resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} + engines: {node: '>= 0.4'} + dev: true + /[email protected]: resolution: {integrity: sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==} dependencies: @@ -6129,7 +6136,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001695 - electron-to-chromium: 1.5.83 + electron-to-chromium: 1.5.88 node-releases: 2.0.19 update-browserslist-db: 1.1.2([email protected]) @@ -6360,7 +6367,7 @@ packages: engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -6527,8 +6534,8 @@ packages: typical: 7.3.0 dev: true - /[email protected]: - resolution: {integrity: sha512-oPYleIY8wmTVzkvQq10AEok6YcTC4sRUBl8F9gVuwchGVUCTbl/vhLTaQqutuuySYOsu8YTgV+OxKc/8Yvx+mQ==} + /[email protected]: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} engines: {node: '>=18'} dev: true @@ -6636,9 +6643,9 @@ packages: engines: {node: '>= 0.6'} dev: true - /[email protected]: - resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} - engines: {node: '>= 0.6'} + /[email protected]: + resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} + engines: {node: '>=18'} dev: true /[email protected]: @@ -7199,8 +7206,8 @@ packages: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /[email protected]: - resolution: {integrity: sha512-LcUDPqSt+V0QmI47XLzZrz5OqILSMGsPFkDYus22rIbgorSvBYEFqq854ltTmUdHkY92FSdAAvsh4jWEULMdfQ==} + /[email protected]: + resolution: {integrity: sha512-K3C2qf1o+bGzbilTDCTBhTQcMS9KW60yTAaTeeXsfvQuTDDwlokLam/AdqlqcSy9u4UainDgsHV23ksXAOgamw==} /[email protected]: resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} @@ -7238,8 +7245,8 @@ packages: once: 1.4.0 dev: true - /[email protected]: - resolution: {integrity: sha512-TAr+NKeoVTjEVW8P3iHguO1LO6RlUz9O5Y8o7EY0fU+gY1NYqas7NN3slpFtbXEsLMHk0h90fJMfKjRkQ0qUIw==} + /[email protected]: + resolution: {integrity: sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==} dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.7 @@ -7257,16 +7264,15 @@ packages: engines: {node: '>=10.0.0'} dev: true - /[email protected]: - resolution: {integrity: sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==} + /[email protected]: + resolution: {integrity: sha512-2hkLItQMBkoYSagneiisupWGvsQlWXqzhSMvsjaM8GYbnfUsX7tzYQq9QARnate5LRedVTX+MbkSZAANAr3NtQ==} engines: {node: '>=10.2.0'} dependencies: - '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 22.10.7 + '@types/node': 22.10.10 accepts: 1.3.8 base64id: 2.0.0 - cookie: 0.7.2 + cookie: 1.0.2 cors: 2.8.5 debug: 4.3.7 engine.io-parser: 5.2.3 @@ -7645,7 +7651,7 @@ packages: '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.1 + '@ungap/structured-clone': 1.3.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 @@ -7907,8 +7913,8 @@ packages: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} dev: true - /[email protected]: - resolution: {integrity: sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q==} + /[email protected]: + resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==} /[email protected]: resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} @@ -8089,8 +8095,9 @@ packages: debug: 4.4.0([email protected]) dev: true - /[email protected]: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + /[email protected]: + resolution: {integrity: sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw==} + engines: {node: '>= 0.4'} dependencies: is-callable: 1.2.7 dev: true @@ -8449,8 +8456,8 @@ packages: pinkie-promise: 2.0.1 dev: true - /[email protected]([email protected]): - resolution: {integrity: sha512-7ccSEJFDFO7exFbO6NRyC+xH8/mZ1GZGG2xxx9iHxZWcjUjJpjWxIMw3cofAKcueZ6DATiukmmprD7yavQHOyQ==} + /[email protected]([email protected]): + resolution: {integrity: sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==} engines: {node: '>=14'} dependencies: base64-js: 1.5.1 @@ -8473,7 +8480,7 @@ packages: '@types/long': 4.0.2 abort-controller: 3.0.0 duplexify: 4.1.3 - google-auth-library: 9.15.0([email protected]) + google-auth-library: 9.15.1([email protected]) node-fetch: 2.7.0 object-hash: 3.0.0 proto3-json-serializer: 2.0.2 @@ -8989,10 +8996,11 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /[email protected]: - resolution: {integrity: sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ==} + /[email protected]: + resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} engines: {node: '>= 0.4'} dependencies: + async-function: 1.0.0 call-bound: 1.0.3 get-proto: 1.0.1 has-tostringtag: 1.0.2 @@ -9487,7 +9495,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 22.10.7 + '@types/node': 22.10.10 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -10560,12 +10568,12 @@ packages: dependencies: '@angular/compiler-cli': 19.2.0-next.0(@angular/[email protected])([email protected]) '@rollup/plugin-json': 6.1.0([email protected]) - '@rollup/wasm-node': 4.31.0 + '@rollup/wasm-node': 4.32.0 ajv: 8.17.1 ansi-colors: 4.1.3 browserslist: 4.24.4 chokidar: 4.0.3 - commander: 13.0.0 + commander: 13.1.0 convert-source-map: 2.0.0 dependency-graph: 1.0.0 esbuild: 0.24.2 @@ -10597,9 +10605,8 @@ packages: engines: {node: '>=10.5.0'} dev: true - /[email protected]: - resolution: {integrity: sha512-WvKUNz1fh7EjX9LzBAWgBQt+5BYbTtvElqkOlUsHZyr6yXlRPqfkXFyBwa7KN7LT0q07Uc+/ferkX0PUE9SiZw==} - deprecated: https://github.com/unjs/node-fetch-native/issues/135 + /[email protected]: + resolution: {integrity: sha512-8Mc2HhqPdlIfedsuZoc3yioPuzp6b+L5jRCRY1QzuWZh2EGJVQrGppC6V6cF0bLdbW0+O2YpqCA25aF/1lvipQ==} dev: true /[email protected]: @@ -10656,7 +10663,7 @@ packages: glob: 10.4.5 graceful-fs: 4.2.11 make-fetch-happen: 14.0.3 - nopt: 8.0.0 + nopt: 8.1.0 proc-log: 5.0.0 semver: 7.6.3 tar: 7.4.3 @@ -10667,20 +10674,12 @@ packages: /[email protected]: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - /[email protected]: - resolution: {integrity: sha512-1L/fTJ4UmV/lUxT2Uf006pfZKTvAgCF+chz+0OgBHO8u2Z67pE7AaAUUj7CJy0lXqHmymUvGFt6NE9R3HER0yw==} + /[email protected]: + resolution: {integrity: sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==} engines: {node: ^18.17.0 || >=20.5.0} hasBin: true dependencies: - abbrev: 2.0.0 - - /[email protected]: - resolution: {integrity: sha512-k6U0gKRIuNCTkwHGZqblCfLfBRh+w1vI6tBo+IeJwq2M8FUiOqhX7GH+GArQGScA7azd1WfyRCvxoXDO3hQDIA==} - engines: {node: ^18.17.0 || >=20.5.0} - dependencies: - hosted-git-info: 8.0.2 - semver: 7.6.3 - validate-npm-package-license: 3.0.4 + abbrev: 3.0.0 /[email protected]: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} @@ -11144,7 +11143,7 @@ packages: dependencies: '@npmcli/git': 6.0.1 '@npmcli/installed-package-contents': 3.0.0 - '@npmcli/package-json': 6.1.0 + '@npmcli/package-json': 6.1.1 '@npmcli/promise-spawn': 8.0.2 '@npmcli/run-script': 9.0.2 cacache: 19.0.1 @@ -11609,7 +11608,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.10.7 + '@types/node': 22.10.10 long: 5.2.4 dev: true @@ -12169,7 +12168,7 @@ packages: spdx-expression-validate: 2.0.0 dev: true - /[email protected](@types/[email protected])([email protected]): + /[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==} engines: {node: '>=10.0.0'} peerDependencies: @@ -12180,7 +12179,7 @@ packages: optional: true dependencies: '@rollup/pluginutils': 3.1.0([email protected]) - '@types/node': 18.19.71 + '@types/node': 18.19.74 rollup: 4.32.0 source-map-resolve: 0.6.0 dev: true @@ -12310,7 +12309,7 @@ packages: immutable: 5.0.3 source-map-js: 1.2.1 optionalDependencies: - '@parcel/watcher': 2.5.0 + '@parcel/watcher': 2.5.1 /[email protected]: resolution: {integrity: sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ==} @@ -12356,9 +12355,9 @@ packages: xml2js: 0.4.23 dev: true - /[email protected]: - resolution: {integrity: sha512-LkTJrNz5socxpPnWPODQ2bQ65eYx9JK+DQMYNihpTjMCqHwgWGYQnQTCAAche2W3ZP87alA+1zYPvgS8tHNzMQ==} - engines: {node: '>= 14.21.0'} + /[email protected]: + resolution: {integrity: sha512-TwbTpu/NUQkorBODGAkGowJ8sar63bvqi66/tjqhS05rBl34HkVp8DoRg1cOv2iSnNonVSbkxazS3wjbc+NRtg==} + engines: {node: '>= 18.20.5'} dependencies: '@bazel/runfiles': 6.3.1 jszip: 3.10.1 @@ -12700,7 +12699,7 @@ packages: dependencies: '@socket.io/component-emitter': 3.1.2 debug: 4.3.7 - engine.io-client: 6.6.2 + engine.io-client: 6.6.3 socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -12726,7 +12725,7 @@ packages: base64id: 2.0.0 cors: 2.8.5 debug: 4.3.7 - engine.io: 6.6.2 + engine.io: 6.6.3 socket.io-adapter: 2.5.5 socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -13312,15 +13311,15 @@ packages: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} dev: true - /[email protected]: - resolution: {integrity: sha512-k1g5eX87vxu3g//6XMn62y4qjayu4cYby/PF7Ksnh4F4uUK1Z1ze/mJ4a+y5OjdJ+cXRp+YTInZhH+FGdUWy1w==} + /[email protected]: + resolution: {integrity: sha512-AOvV5YYIAFFBfransBzSTyztkc3IMfz5Eq3YluaRiEu55nn43Fzaufx70UqEKYr8BoLCach4q8g/bg6e5+/aFw==} dev: true - /[email protected]: - resolution: {integrity: sha512-/h4bVmuEMm57c2uCiAf1Q9mlQk7cA22m+1Bu0K92vUUtTVT9D4mOFWD9r4WQuTULcG9eeZtNKhLl0Il1LdKGog==} + /[email protected]: + resolution: {integrity: sha512-+lFzEXhpl7JXgWYaXcB6DqTYXbUArvrWAE/5ioq/X3CdWLbDjpPP4XTrQBmEJ91y3xbe4Fkw7Lxv4P3GWeJaNg==} hasBin: true dependencies: - tldts-core: 6.1.73 + tldts-core: 6.1.75 dev: true /[email protected]: @@ -13364,7 +13363,7 @@ packages: resolution: {integrity: sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==} engines: {node: '>=16'} dependencies: - tldts: 6.1.73 + tldts: 6.1.75 dev: true /[email protected]: @@ -13414,7 +13413,7 @@ packages: typescript: 5.7.3 dev: true - /[email protected](@types/[email protected])([email protected]): + /[email protected](@types/[email protected])([email protected]): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -13433,7 +13432,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.19.71 + '@types/node': 18.19.74 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -13538,7 +13537,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.4 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 @@ -13550,7 +13549,7 @@ packages: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.4 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 @@ -13562,7 +13561,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.4 gopd: 1.2.0 is-typed-array: 1.1.15 possible-typed-array-names: 1.0.0 @@ -13649,7 +13648,7 @@ packages: consola: 3.4.0 defu: 6.1.4 mime: 3.0.0 - node-fetch-native: 1.6.5 + node-fetch-native: 1.6.6 pathe: 1.1.2 dev: true @@ -13914,7 +13913,7 @@ packages: extsprintf: 1.4.1 dev: true - /[email protected](@types/[email protected])([email protected])([email protected])([email protected]): + /[email protected](@types/[email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -13954,7 +13953,7 @@ packages: yaml: optional: true dependencies: - '@types/node': 18.19.71 + '@types/node': 18.19.74 esbuild: 0.24.2 less: 4.2.2 postcss: 8.5.1 @@ -14067,7 +14066,7 @@ packages: '@types/serve-index': 1.9.4 '@types/serve-static': 1.15.7 '@types/sockjs': 0.3.36 - '@types/ws': 8.5.13 + '@types/ws': 8.5.14 ansi-html-community: 0.0.8 bonjour-service: 1.3.0 chokidar: 3.6.0 @@ -14210,7 +14209,7 @@ packages: call-bound: 1.0.3 function.prototype.name: 1.1.8 has-tostringtag: 1.0.2 - is-async-function: 2.1.0 + is-async-function: 2.1.1 is-date-object: 1.1.0 is-finalizationregistry: 1.1.1 is-generator-function: 1.1.0 @@ -14243,7 +14242,7 @@ packages: available-typed-arrays: 1.0.7 call-bind: 1.0.8 call-bound: 1.0.3 - for-each: 0.3.3 + for-each: 0.3.4 gopd: 1.2.0 has-tostringtag: 1.0.2 dev: true @@ -14525,7 +14524,7 @@ packages: resolution: {integrity: sha512-9oxn0IIjbCZkJ67L+LkhYWRyAy7axphb3VgE2MBDlOqnmHMPWGYMxJxBYFueFq/JGY2GMwS0rU+UCLunEmy5UA==} dev: true - github.com/angular/bazel-builds/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d(@angular/[email protected])(@bazel/[email protected])(@rollup/[email protected])(@rollup/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): + github.com/angular/bazel-builds/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d(@angular/[email protected])(@bazel/[email protected])(@rollup/[email protected])(@rollup/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]): resolution: {tarball: https://codeload.github.com/angular/bazel-builds/tar.gz/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d} id: github.com/angular/bazel-builds/73e3de2be2a45df20a2d36cf30cc2b5c4bc8f98d name: '@angular/bazel' @@ -14548,12 +14547,12 @@ packages: dependencies: '@angular/compiler-cli': 19.2.0-next.0(@angular/[email protected])([email protected]) '@bazel/concatjs': 5.8.1([email protected])([email protected])([email protected])([email protected]) - '@microsoft/api-extractor': 7.49.1(@types/[email protected]) + '@microsoft/api-extractor': 7.49.1(@types/[email protected]) '@rollup/plugin-commonjs': 28.0.2([email protected]) '@rollup/plugin-node-resolve': 13.3.0([email protected]) magic-string: 0.30.17 rollup: 4.32.0 - rollup-plugin-sourcemaps: 0.6.3(@types/[email protected])([email protected]) + rollup-plugin-sourcemaps: 0.6.3(@types/[email protected])([email protected]) terser: 5.37.0 tslib: 2.8.1 typescript: 5.7.3 @@ -14578,10 +14577,10 @@ packages: '@bazel/runfiles': 5.8.1 '@bazel/terser': 5.8.1([email protected]) '@bazel/typescript': 5.8.1([email protected]) - '@microsoft/api-extractor': 7.49.1(@types/[email protected]) + '@microsoft/api-extractor': 7.49.1(@types/[email protected]) '@types/browser-sync': 2.29.0 '@types/minimatch': 5.1.2 - '@types/node': 18.19.71 + '@types/node': 18.19.74 '@types/selenium-webdriver': 4.1.28 '@types/send': 0.17.4 '@types/tmp': 0.2.6 @@ -14590,7 +14589,7 @@ packages: browser-sync: 3.0.3([email protected]) prettier: 3.4.2 protractor: 7.0.0 - selenium-webdriver: 4.27.0 + selenium-webdriver: 4.28.1 send: 1.1.0 source-map: 0.7.4 tmp: 0.2.3 diff --git a/yarn.lock b/yarn.lock index e86af8185df5..cb2117c5e489 100644 --- a/yarn.lock +++ b/yarn.lock @@ -651,7 +651,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.26.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.16.0, @babel/core@npm:^7.23.9": +"@babel/core@npm:7.26.0": version: 7.26.0 resolution: "@babel/core@npm:7.26.0" dependencies: @@ -674,7 +674,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.26.7": +"@babel/core@npm:7.26.7, @babel/core@npm:^7.12.3, @babel/core@npm:^7.16.0, @babel/core@npm:^7.23.9": version: 7.26.7 resolution: "@babel/core@npm:7.26.7" dependencies: @@ -912,17 +912,7 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/helpers@npm:7.26.0" - dependencies: - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.26.0" - checksum: 10c0/343333cced6946fe46617690a1d0789346960910225ce359021a88a60a65bc0d791f0c5d240c0ed46cf8cc63b5fd7df52734ff14e43b9c32feae2b61b1647097 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.26.7": +"@babel/helpers@npm:^7.26.0, @babel/helpers@npm:^7.26.7": version: 7.26.7 resolution: "@babel/helpers@npm:7.26.7" dependencies: @@ -932,18 +922,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.5": - version: 7.26.5 - resolution: "@babel/parser@npm:7.26.5" - dependencies: - "@babel/types": "npm:^7.26.5" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/2e77dd99ee028ee3c10fa03517ae1169f2432751adf71315e4dc0d90b61639d51760d622f418f6ac665ae4ea65f8485232a112ea0e76f18e5900225d3d19a61e - languageName: node - linkType: hard - -"@babel/parser@npm:^7.26.7": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.5, @babel/parser@npm:^7.26.7": version: 7.26.7 resolution: "@babel/parser@npm:7.26.7" dependencies: @@ -1776,7 +1755,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:7.26.7": +"@babel/runtime@npm:7.26.7, @babel/runtime@npm:^7.8.4": version: 7.26.7 resolution: "@babel/runtime@npm:7.26.7" dependencies: @@ -1785,15 +1764,6 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.8.4": - version: 7.26.0 - resolution: "@babel/runtime@npm:7.26.0" - dependencies: - regenerator-runtime: "npm:^0.14.0" - checksum: 10c0/12c01357e0345f89f4f7e8c0e81921f2a3e3e101f06e8eaa18a382b517376520cd2fa8c237726eb094dab25532855df28a7baaf1c26342b52782f6936b07c287 - languageName: node - linkType: hard - "@babel/template@npm:^7.25.9": version: 7.25.9 resolution: "@babel/template@npm:7.25.9" @@ -1805,22 +1775,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.26.5": - version: 7.26.5 - resolution: "@babel/traverse@npm:7.26.5" - dependencies: - "@babel/code-frame": "npm:^7.26.2" - "@babel/generator": "npm:^7.26.5" - "@babel/parser": "npm:^7.26.5" - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.26.5" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/0779059ecf63e31446564cf31adf170e701e8017ef02c819c57924a9a83d6b2ce41dbff3ef295589da9410497a3e575655bb8084ca470e0ab1bc193128afa9fe - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.26.7": +"@babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.26.5, @babel/traverse@npm:^7.26.7": version: 7.26.7 resolution: "@babel/traverse@npm:7.26.7" dependencies: @@ -1835,17 +1790,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.26.5, @babel/types@npm:^7.4.4": - version: 7.26.5 - resolution: "@babel/types@npm:7.26.5" - dependencies: - "@babel/helper-string-parser": "npm:^7.25.9" - "@babel/helper-validator-identifier": "npm:^7.25.9" - checksum: 10c0/0278053b69d7c2b8573aa36dc5242cad95f0d965e1c0ed21ccacac6330092e59ba5949753448f6d6eccf6ad59baaef270295cc05218352e060ea8c68388638c4 - languageName: node - linkType: hard - -"@babel/types@npm:^7.26.7": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.26.5, @babel/types@npm:^7.26.7, @babel/types@npm:^7.4.4": version: 7.26.7 resolution: "@babel/types@npm:7.26.7" dependencies: @@ -3257,17 +3202,17 @@ __metadata: linkType: hard "@npmcli/package-json@npm:^6.0.0, @npmcli/package-json@npm:^6.0.1, @npmcli/package-json@npm:^6.1.0": - version: 6.1.0 - resolution: "@npmcli/package-json@npm:6.1.0" + version: 6.1.1 + resolution: "@npmcli/package-json@npm:6.1.1" dependencies: "@npmcli/git": "npm:^6.0.0" glob: "npm:^10.2.2" hosted-git-info: "npm:^8.0.0" json-parse-even-better-errors: "npm:^4.0.0" - normalize-package-data: "npm:^7.0.0" proc-log: "npm:^5.0.0" semver: "npm:^7.5.3" - checksum: 10c0/95cc97f2382084e71a33d2739f0b1e659e32a8449d134d4264ecc2b5ada548069122d95887fe692373e2703b7a296a17e7296a4ce955dfa80c6ce3e00b5fab53 + validate-npm-package-license: "npm:^3.0.4" + checksum: 10c0/ec24e6dc4ade64de205f7964e325de31ee0c2dd7d70c2321a2b822481bf97505fffbe23ec05672fc61862ae68bbae3e9b44d4640439081dbc8f8b2dcdeda2aa3 languageName: node linkType: hard @@ -3468,114 +3413,114 @@ __metadata: languageName: node linkType: hard -"@parcel/watcher-android-arm64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-android-arm64@npm:2.5.0" +"@parcel/watcher-android-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-android-arm64@npm:2.5.1" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@parcel/watcher-darwin-arm64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-darwin-arm64@npm:2.5.0" +"@parcel/watcher-darwin-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-darwin-arm64@npm:2.5.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@parcel/watcher-darwin-x64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-darwin-x64@npm:2.5.0" +"@parcel/watcher-darwin-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-darwin-x64@npm:2.5.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@parcel/watcher-freebsd-x64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-freebsd-x64@npm:2.5.0" +"@parcel/watcher-freebsd-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-freebsd-x64@npm:2.5.1" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@parcel/watcher-linux-arm-glibc@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-arm-glibc@npm:2.5.0" +"@parcel/watcher-linux-arm-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm-glibc@npm:2.5.1" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@parcel/watcher-linux-arm-musl@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-arm-musl@npm:2.5.0" +"@parcel/watcher-linux-arm-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm-musl@npm:2.5.1" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@parcel/watcher-linux-arm64-glibc@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.5.0" +"@parcel/watcher-linux-arm64-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm64-glibc@npm:2.5.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@parcel/watcher-linux-arm64-musl@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-arm64-musl@npm:2.5.0" +"@parcel/watcher-linux-arm64-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-arm64-musl@npm:2.5.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@parcel/watcher-linux-x64-glibc@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-x64-glibc@npm:2.5.0" +"@parcel/watcher-linux-x64-glibc@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-x64-glibc@npm:2.5.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@parcel/watcher-linux-x64-musl@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-linux-x64-musl@npm:2.5.0" +"@parcel/watcher-linux-x64-musl@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-linux-x64-musl@npm:2.5.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@parcel/watcher-win32-arm64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-win32-arm64@npm:2.5.0" +"@parcel/watcher-win32-arm64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-arm64@npm:2.5.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@parcel/watcher-win32-ia32@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-win32-ia32@npm:2.5.0" +"@parcel/watcher-win32-ia32@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-ia32@npm:2.5.1" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@parcel/watcher-win32-x64@npm:2.5.0": - version: 2.5.0 - resolution: "@parcel/watcher-win32-x64@npm:2.5.0" +"@parcel/watcher-win32-x64@npm:2.5.1": + version: 2.5.1 + resolution: "@parcel/watcher-win32-x64@npm:2.5.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@parcel/watcher@npm:^2.4.1": - version: 2.5.0 - resolution: "@parcel/watcher@npm:2.5.0" - dependencies: - "@parcel/watcher-android-arm64": "npm:2.5.0" - "@parcel/watcher-darwin-arm64": "npm:2.5.0" - "@parcel/watcher-darwin-x64": "npm:2.5.0" - "@parcel/watcher-freebsd-x64": "npm:2.5.0" - "@parcel/watcher-linux-arm-glibc": "npm:2.5.0" - "@parcel/watcher-linux-arm-musl": "npm:2.5.0" - "@parcel/watcher-linux-arm64-glibc": "npm:2.5.0" - "@parcel/watcher-linux-arm64-musl": "npm:2.5.0" - "@parcel/watcher-linux-x64-glibc": "npm:2.5.0" - "@parcel/watcher-linux-x64-musl": "npm:2.5.0" - "@parcel/watcher-win32-arm64": "npm:2.5.0" - "@parcel/watcher-win32-ia32": "npm:2.5.0" - "@parcel/watcher-win32-x64": "npm:2.5.0" + version: 2.5.1 + resolution: "@parcel/watcher@npm:2.5.1" + dependencies: + "@parcel/watcher-android-arm64": "npm:2.5.1" + "@parcel/watcher-darwin-arm64": "npm:2.5.1" + "@parcel/watcher-darwin-x64": "npm:2.5.1" + "@parcel/watcher-freebsd-x64": "npm:2.5.1" + "@parcel/watcher-linux-arm-glibc": "npm:2.5.1" + "@parcel/watcher-linux-arm-musl": "npm:2.5.1" + "@parcel/watcher-linux-arm64-glibc": "npm:2.5.1" + "@parcel/watcher-linux-arm64-musl": "npm:2.5.1" + "@parcel/watcher-linux-x64-glibc": "npm:2.5.1" + "@parcel/watcher-linux-x64-musl": "npm:2.5.1" + "@parcel/watcher-win32-arm64": "npm:2.5.1" + "@parcel/watcher-win32-ia32": "npm:2.5.1" + "@parcel/watcher-win32-x64": "npm:2.5.1" detect-libc: "npm:^1.0.3" is-glob: "npm:^4.0.3" micromatch: "npm:^4.0.5" @@ -3608,7 +3553,7 @@ __metadata: optional: true "@parcel/watcher-win32-x64": optional: true - checksum: 10c0/9bad727d8b11e5d150ec47459254544c583adaa47d047b8ef65e1c74aede1a0767dc7fc6b8997649dae07318d6ef39caba6a1c405d306398d5bcd47074ec5d29 + checksum: 10c0/8f35073d0c0b34a63d4c8d2213482f0ebc6a25de7b2cdd415d19cb929964a793cb285b68d1d50bfb732b070b3c82a2fdb4eb9c250eab709a1cd9d63345455a82 languageName: node linkType: hard @@ -3826,13 +3771,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.31.0" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@rollup/rollup-android-arm-eabi@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-android-arm-eabi@npm:4.32.0" @@ -3847,13 +3785,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-android-arm64@npm:4.31.0" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-android-arm64@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-android-arm64@npm:4.32.0" @@ -3868,13 +3799,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.31.0" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-arm64@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-darwin-arm64@npm:4.32.0" @@ -3889,13 +3813,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.31.0" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-x64@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-darwin-x64@npm:4.32.0" @@ -3910,13 +3827,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.31.0" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-arm64@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-freebsd-arm64@npm:4.32.0" @@ -3931,13 +3841,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-freebsd-x64@npm:4.31.0" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-x64@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-freebsd-x64@npm:4.32.0" @@ -3952,13 +3855,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.31.0" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-gnueabihf@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.32.0" @@ -3973,13 +3869,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.31.0" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-musleabihf@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.32.0" @@ -3994,13 +3883,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.31.0" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.32.0" @@ -4015,13 +3897,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.31.0" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-musl@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.32.0" @@ -4036,13 +3911,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.31.0" - conditions: os=linux & cpu=loong64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-loongarch64-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.32.0" @@ -4057,13 +3925,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.31.0" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-powerpc64le-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.32.0" @@ -4078,13 +3939,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.31.0" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.32.0" @@ -4099,13 +3953,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.31.0" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-s390x-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.32.0" @@ -4120,13 +3967,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.31.0" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-gnu@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.32.0" @@ -4141,13 +3981,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.31.0" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-musl@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-linux-x64-musl@npm:4.32.0" @@ -4162,13 +3995,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.31.0" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-win32-arm64-msvc@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.32.0" @@ -4183,13 +4009,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.31.0" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@rollup/rollup-win32-ia32-msvc@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.32.0" @@ -4204,13 +4023,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.31.0": - version: 4.31.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.31.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-msvc@npm:4.32.0": version: 4.32.0 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.32.0" @@ -4219,8 +4031,8 @@ __metadata: linkType: hard "@rollup/wasm-node@npm:^4.24.0": - version: 4.31.0 - resolution: "@rollup/wasm-node@npm:4.31.0" + version: 4.32.0 + resolution: "@rollup/wasm-node@npm:4.32.0" dependencies: "@types/estree": "npm:1.0.6" fsevents: "npm:~2.3.2" @@ -4229,7 +4041,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/10132529b78aef458983697a1fff0cada0248c7475f889d27cdaac10b698b653d424cb367a7c5fb3e4362dcebbc95e885eb8f10890d0805782b5202bf0694995 + checksum: 10c0/2508f4043dd7cdc524a7daa45c3f8ec7593e11adf957fc5be630740fbb6d9ca5292a84737bb1f8544db860b94badea781fff0382389388c7f6dd3a1bbbc65c2c languageName: node linkType: hard @@ -4603,13 +4415,6 @@ __metadata: languageName: node linkType: hard -"@types/cookie@npm:^0.4.1": - version: 0.4.1 - resolution: "@types/cookie@npm:0.4.1" - checksum: 10c0/f96afe12bd51be1ec61410b0641243d93fa3a494702407c787a4c872b5c8bcd39b224471452055e44a9ce42af1a636e87d161994226eaf4c2be9c30f60418409 - languageName: node - linkType: hard - "@types/cookies@npm:*": version: 0.9.0 resolution: "@types/cookies@npm:0.9.0" @@ -4955,11 +4760,11 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>=10.0.0, @types/node@npm:>=13.7.0": - version: 22.10.7 - resolution: "@types/node@npm:22.10.7" + version: 22.10.10 + resolution: "@types/node@npm:22.10.10" dependencies: undici-types: "npm:~6.20.0" - checksum: 10c0/c941b4689dfc4044b64a5f601306cbcb0c7210be853ba378a5dd44137898c45accedd796ee002ad9407024cac7ecaf5049304951cb1d80ce3d7cebbbae56f20e + checksum: 10c0/3425772d4513cd5dbdd87c00acda088113c03a97445f84f6a89744c60a66990b56c9d3a7213d09d57b6b944ae8ff45f985565e0c1846726112588e33a22dd12b languageName: node linkType: hard @@ -4971,11 +4776,11 @@ __metadata: linkType: hard "@types/node@npm:^18.13.0, @types/node@npm:^18.19.21": - version: 18.19.71 - resolution: "@types/node@npm:18.19.71" + version: 18.19.74 + resolution: "@types/node@npm:18.19.74" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/9f9b4a1c4e2db2994ef36f165322b3bb807466e3f92751ed52a40af0212917bc6ecd12dc6775eb829176b71b26570bea9c6a0a2d9e3ae6b496721c71934244db + checksum: 10c0/365d9cc2af934965aa6a8471e24ae80add815c15dc094e42a320c57c1ea5416032f0b7ef6f23e32174c34811fbb8d89ea8eaa1396548610fbb8ba317b6e93fbf languageName: node linkType: hard @@ -5291,7 +5096,16 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:*, @types/ws@npm:8.5.13, @types/ws@npm:^8.5.10": +"@types/ws@npm:*, @types/ws@npm:^8.5.10": + version: 8.5.14 + resolution: "@types/ws@npm:8.5.14" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/be88a0b6252f939cb83340bd1b4d450287f752c19271195cd97564fd94047259a9bb8c31c585a61b69d8a1b069a99df9dd804db0132d3359c54d3890c501416a + languageName: node + linkType: hard + +"@types/ws@npm:8.5.13": version: 8.5.13 resolution: "@types/ws@npm:8.5.13" dependencies: @@ -5514,9 +5328,9 @@ __metadata: linkType: hard "@ungap/structured-clone@npm:^1.2.0": - version: 1.2.1 - resolution: "@ungap/structured-clone@npm:1.2.1" - checksum: 10c0/127afbcc75ff1532f7b1eb85ee992f9faa70e8d5bb2558da05355d423b966fc279d0a485bf19da2883280e7c299ae4170809a72e78eab086da71c6bcdda5d1e2 + version: 1.3.0 + resolution: "@ungap/structured-clone@npm:1.3.0" + checksum: 10c0/0fc3097c2540ada1fc340ee56d58d96b5b536a2a0dab6e3ec17d4bfc8c4c86db345f61a375a8185f9da96f01c69678f836a2b57eeaa9e4b8eeafd26428e57b0a languageName: node linkType: hard @@ -6164,13 +5978,6 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^2.0.0": - version: 2.0.0 - resolution: "abbrev@npm:2.0.0" - checksum: 10c0/f742a5a107473946f426c691c08daba61a1d15942616f300b5d32fd735be88fef5cba24201757b6c407fd564555fb48c751cfa33519b2605c8a7aadd22baf372 - languageName: node - linkType: hard - "abbrev@npm:^3.0.0": version: 3.0.0 resolution: "abbrev@npm:3.0.0" @@ -6680,6 +6487,13 @@ __metadata: languageName: node linkType: hard +"async-function@npm:^1.0.0": + version: 1.0.0 + resolution: "async-function@npm:1.0.0" + checksum: 10c0/669a32c2cb7e45091330c680e92eaeb791bc1d4132d827591e499cd1f776ff5a873e77e5f92d0ce795a8d60f10761dec9ddfe7225a5de680f5d357f67b1aac73 + languageName: node + linkType: hard + "async-mutex@npm:0.4.0": version: 0.4.0 resolution: "async-mutex@npm:0.4.0" @@ -7776,9 +7590,9 @@ __metadata: linkType: hard "commander@npm:^13.0.0": - version: 13.0.0 - resolution: "commander@npm:13.0.0" - checksum: 10c0/8ba1e2b83bfdbcefd967aa505f5f5dc58202aa5f8e10437f61f6980dd8a69f868dba439a261f9fb72fc543c5f6fe58140e37b001a4c70b92ae22527abe94dfe1 + version: 13.1.0 + resolution: "commander@npm:13.1.0" + checksum: 10c0/7b8c5544bba704fbe84b7cab2e043df8586d5c114a4c5b607f83ae5060708940ed0b5bd5838cf8ce27539cde265c1cbd59ce3c8c6b017ed3eec8943e3a415164 languageName: node linkType: hard @@ -7930,10 +7744,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:~0.7.2": - version: 0.7.2 - resolution: "cookie@npm:0.7.2" - checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2 +"cookie@npm:~1.0.2": + version: 1.0.2 + resolution: "cookie@npm:1.0.2" + checksum: 10c0/fd25fe79e8fbcfcaf6aa61cd081c55d144eeeba755206c058682257cb38c4bd6795c6620de3f064c740695bb65b7949ebb1db7a95e4636efb8357a335ad3f54b languageName: node linkType: hard @@ -8691,9 +8505,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.73": - version: 1.5.83 - resolution: "electron-to-chromium@npm:1.5.83" - checksum: 10c0/12380962d057c4679add1047cdddb18b909904614272da0527e505a3859eaffde2022dd0688ce7f230582de96405c3d33b667680614475cdafd3f629caa2fee1 + version: 1.5.88 + resolution: "electron-to-chromium@npm:1.5.88" + checksum: 10c0/25946ef310f8e14c763fcf0e62094e7eae2273d9ffe908969ddd97492c3df0198739295ba76388dc210c4503ab6b540130779cd83036f80520cb8efee53be8e4 languageName: node linkType: hard @@ -8758,15 +8572,15 @@ __metadata: linkType: hard "engine.io-client@npm:~6.6.1": - version: 6.6.2 - resolution: "engine.io-client@npm:6.6.2" + version: 6.6.3 + resolution: "engine.io-client@npm:6.6.3" dependencies: "@socket.io/component-emitter": "npm:~3.1.0" debug: "npm:~4.3.1" engine.io-parser: "npm:~5.2.1" ws: "npm:~8.17.1" xmlhttprequest-ssl: "npm:~2.1.1" - checksum: 10c0/a1a0995df1ce2425b43c7dd396cf4ef12d3ca85973b63e1b7bd3933d0292459e922d6be25d14013c9608dc7159ae1e10cd7005754b02bc42d40450381f691859 + checksum: 10c0/ebe0b1da6831d5a68564f9ffb80efe682da4f0538488eaffadf0bcf5177a8b4472cdb01d18a9f20dece2f8de30e2df951eb4635bef2f1b492e9f08a523db91a0 languageName: node linkType: hard @@ -8778,20 +8592,19 @@ __metadata: linkType: hard "engine.io@npm:~6.6.0": - version: 6.6.2 - resolution: "engine.io@npm:6.6.2" + version: 6.6.3 + resolution: "engine.io@npm:6.6.3" dependencies: - "@types/cookie": "npm:^0.4.1" "@types/cors": "npm:^2.8.12" "@types/node": "npm:>=10.0.0" accepts: "npm:~1.3.4" base64id: "npm:2.0.0" - cookie: "npm:~0.7.2" + cookie: "npm:~1.0.2" cors: "npm:~2.8.5" debug: "npm:~4.3.1" engine.io-parser: "npm:~5.2.1" ws: "npm:~8.17.1" - checksum: 10c0/e9ac3cba49badb6905259df3b019fbcbe53e2a389c930fb9fbc10eebc8839554b189706206bba2509a4a3a7d78a32f7e027f73230f31662c7efd215276432dad + checksum: 10c0/da808d7f75d073c0809b67bcf9b1c48b8edaa8bb8850ce9c8ba914b7498a3a0730d855b7d209f26a144fd1ce77395ddff4f7e3c1b602bda3779144b4558fcd5e languageName: node linkType: hard @@ -9629,9 +9442,9 @@ __metadata: linkType: hard "fast-uri@npm:^3.0.1": - version: 3.0.5 - resolution: "fast-uri@npm:3.0.5" - checksum: 10c0/f5501fd849e02f16f1730d2c8628078718c492b5bc00198068bc5c2880363ae948287fdc8cebfff47465229b517dbeaf668866fbabdff829b4138a899e5c2ba3 + version: 3.0.6 + resolution: "fast-uri@npm:3.0.6" + checksum: 10c0/74a513c2af0584448aee71ce56005185f81239eab7a2343110e5bad50c39ad4fb19c5a6f99783ead1cac7ccaf3461a6034fda89fffa2b30b6d99b9f21c2f9d29 languageName: node linkType: hard @@ -9861,11 +9674,11 @@ __metadata: linkType: hard "for-each@npm:^0.3.3": - version: 0.3.3 - resolution: "for-each@npm:0.3.3" + version: 0.3.4 + resolution: "for-each@npm:0.3.4" dependencies: - is-callable: "npm:^1.1.3" - checksum: 10c0/22330d8a2db728dbf003ec9182c2d421fbcd2969b02b4f97ec288721cda63eb28f2c08585ddccd0f77cb2930af8d958005c9e72f47141dc51816127a118f39aa + is-callable: "npm:^1.2.7" + checksum: 10c0/6b2016c0a0fe3107c70a233923cac74f07bedb5a1847636039fa6bcc3df09aefa554cfec23c3342ad365acac1f95e799d9f8e220cb82a4c7b8a84f969234302f languageName: node linkType: hard @@ -10344,8 +10157,8 @@ __metadata: linkType: hard "google-auth-library@npm:^9.0.0, google-auth-library@npm:^9.3.0": - version: 9.15.0 - resolution: "google-auth-library@npm:9.15.0" + version: 9.15.1 + resolution: "google-auth-library@npm:9.15.1" dependencies: base64-js: "npm:^1.3.0" ecdsa-sig-formatter: "npm:^1.0.11" @@ -10353,7 +10166,7 @@ __metadata: gcp-metadata: "npm:^6.1.0" gtoken: "npm:^7.0.0" jws: "npm:^4.0.0" - checksum: 10c0/f5a9a46e939147b181bac9b254f11dd8c2d05c15a65c9d3f2180252bef21c12af37d9893bc3caacafd226d6531a960535dbb5222ef869143f393c6a97639cc06 + checksum: 10c0/6eef36d9a9cb7decd11e920ee892579261c6390104b3b24d3e0f3889096673189fe2ed0ee43fd563710e2560de98e63ad5aa4967b91e7f4e69074a422d5f7b65 languageName: node linkType: hard @@ -11077,14 +10890,15 @@ __metadata: linkType: hard "is-async-function@npm:^2.0.0": - version: 2.1.0 - resolution: "is-async-function@npm:2.1.0" + version: 2.1.1 + resolution: "is-async-function@npm:2.1.1" dependencies: + async-function: "npm:^1.0.0" call-bound: "npm:^1.0.3" get-proto: "npm:^1.0.1" has-tostringtag: "npm:^1.0.2" safe-regex-test: "npm:^1.1.0" - checksum: 10c0/5209b858c6d18d88a9fb56dea202a050d53d4b722448cc439fdca859b36e23edf27ee8c18958ba49330f1a71b8846576273f4581e1c0bb9d403738129d852fdb + checksum: 10c0/d70c236a5e82de6fc4d44368ffd0c2fee2b088b893511ce21e679da275a5ecc6015ff59a7d7e1bdd7ca39f71a8dbdd253cf8cce5c6b3c91cdd5b42b5ce677298 languageName: node linkType: hard @@ -11125,7 +10939,7 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.3, is-callable@npm:^1.2.7": +"is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" checksum: 10c0/ceebaeb9d92e8adee604076971dd6000d38d6afc40bb843ea8e45c5579b57671c3f3b50d7f04869618242c6cee08d1b67806a8cb8edaaaf7c0748b3720d6066f @@ -13538,9 +13352,9 @@ __metadata: linkType: hard "node-fetch-native@npm:^1.6.4": - version: 1.6.5 - resolution: "node-fetch-native@npm:1.6.5" - checksum: 10c0/025b74c2c195bf56f3aecfa1bdd9e262b12360a9f1d90c37a1cbc7a49edb37ce9c53273be5a6fbff642997beeb31c7f03d698a167b43db8ec6c91f7ee9ff3b77 + version: 1.6.6 + resolution: "node-fetch-native@npm:1.6.6" + checksum: 10c0/8c12dab0e640d8bc126a03d604af9cf3fc1b87f2cda5af0c71601079d5ed835c1dc149c7042b61c83f252a382e1cf1e541788f4c9e8e6c089af77497190f5dc3 languageName: node linkType: hard @@ -13631,13 +13445,13 @@ __metadata: linkType: hard "nopt@npm:^8.0.0": - version: 8.0.0 - resolution: "nopt@npm:8.0.0" + version: 8.1.0 + resolution: "nopt@npm:8.1.0" dependencies: - abbrev: "npm:^2.0.0" + abbrev: "npm:^3.0.0" bin: nopt: bin/nopt.js - checksum: 10c0/19cb986f79abaca2d0f0b560021da7b32ee6fcc3de48f3eaeb0c324d36755c17754f886a754c091f01f740c17caf7d6aea8237b7fbaf39f476ae5e30a249f18f + checksum: 10c0/62e9ea70c7a3eb91d162d2c706b6606c041e4e7b547cbbb48f8b3695af457dd6479904d7ace600856bf923dd8d1ed0696f06195c8c20f02ac87c1da0e1d315ef languageName: node linkType: hard @@ -15831,7 +15645,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:4.32.0": +"rollup@npm:4.32.0, rollup@npm:^4.23.0, rollup@npm:^4.24.0, rollup@npm:^4.4.0": version: 4.32.0 resolution: "rollup@npm:4.32.0" dependencies: @@ -15903,78 +15717,6 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.23.0, rollup@npm:^4.24.0, rollup@npm:^4.4.0": - version: 4.31.0 - resolution: "rollup@npm:4.31.0" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.31.0" - "@rollup/rollup-android-arm64": "npm:4.31.0" - "@rollup/rollup-darwin-arm64": "npm:4.31.0" - "@rollup/rollup-darwin-x64": "npm:4.31.0" - "@rollup/rollup-freebsd-arm64": "npm:4.31.0" - "@rollup/rollup-freebsd-x64": "npm:4.31.0" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.31.0" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.31.0" - "@rollup/rollup-linux-arm64-gnu": "npm:4.31.0" - "@rollup/rollup-linux-arm64-musl": "npm:4.31.0" - "@rollup/rollup-linux-loongarch64-gnu": "npm:4.31.0" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.31.0" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.31.0" - "@rollup/rollup-linux-s390x-gnu": "npm:4.31.0" - "@rollup/rollup-linux-x64-gnu": "npm:4.31.0" - "@rollup/rollup-linux-x64-musl": "npm:4.31.0" - "@rollup/rollup-win32-arm64-msvc": "npm:4.31.0" - "@rollup/rollup-win32-ia32-msvc": "npm:4.31.0" - "@rollup/rollup-win32-x64-msvc": "npm:4.31.0" - "@types/estree": "npm:1.0.6" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-freebsd-arm64": - optional: true - "@rollup/rollup-freebsd-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-loongarch64-gnu": - optional: true - "@rollup/rollup-linux-powerpc64le-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/0d6da45098af14c678e78be887fefefbf5a97fef6277c5a1c24ca722537bb3a02e695c6fcad8880218d8fbef8a7a17d865786afd99bb6e70409fad73844ca8cf - languageName: node - linkType: hard - "run-applescript@npm:^7.0.0": version: 7.0.0 resolution: "run-applescript@npm:7.0.0" @@ -16188,14 +15930,14 @@ __metadata: linkType: hard "selenium-webdriver@npm:^4.18.1": - version: 4.27.0 - resolution: "selenium-webdriver@npm:4.27.0" + version: 4.28.1 + resolution: "selenium-webdriver@npm:4.28.1" dependencies: "@bazel/runfiles": "npm:^6.3.1" jszip: "npm:^3.10.1" tmp: "npm:^0.2.3" ws: "npm:^8.18.0" - checksum: 10c0/fe6aedae92e9d6675326b72ee00c9f9c3022f14746672cacbf7ca285816cc512ce3e0f23a77a2976995192099e6bfdf0011d2cc19efd974cd5683d9709f90d3e + checksum: 10c0/7491d314a9e29d08d489aa873a98a870c31116fefb81ad2e1b94155ef964fb6f0d35fdebd562a9bfeccb831f92bca98566a1e4760d78521725acea8ab24d909f languageName: node linkType: hard @@ -17466,21 +17208,21 @@ __metadata: languageName: node linkType: hard -"tldts-core@npm:^6.1.73": - version: 6.1.73 - resolution: "tldts-core@npm:6.1.73" - checksum: 10c0/566d559922ddcbe750b259e23b349d2db916095951f50cfd7811af43043ebc3c022cc9c92ebde6933cf82ad792f71025759e08044c203fe63f6e14fa0e69e8de +"tldts-core@npm:^6.1.75": + version: 6.1.75 + resolution: "tldts-core@npm:6.1.75" + checksum: 10c0/6a35db3a509bc003f86fe31f28334a3a1a56614f7ea3a3c93c91d771632d40a547d0313eb3882daea214e5441fa8b5902cc4ac96be6f7419a448310b8267a4cb languageName: node linkType: hard "tldts@npm:^6.1.32": - version: 6.1.73 - resolution: "tldts@npm:6.1.73" + version: 6.1.75 + resolution: "tldts@npm:6.1.75" dependencies: - tldts-core: "npm:^6.1.73" + tldts-core: "npm:^6.1.75" bin: tldts: bin/cli.js - checksum: 10c0/d76e249d13b88311834ee04eafbcac9c2a058b9e0f5c6aaa071982e5fa4d30d07894adfae7cbd2135bbc3baa30bfbdacf09f8f1020697bc6f72137792dc79f69 + checksum: 10c0/cf25f05be4642cb0de070a0385e2dd24fea1b5ea4c10c679e763c095919fc2a41d6f445284d40e288802654ad919cb956687d2312a0352add23c4b7f5cb6abf9 languageName: node linkType: hard
043c4107f81d6a884b8936d403552b581a808162
2021-09-28 14:28:10
Charles Lyding
refactor(@angular-devkit/build-angular): remove patching of @angular/localize Diagnostics object
false
remove patching of @angular/localize Diagnostics object
refactor
diff --git a/packages/angular_devkit/build_angular/src/babel/presets/application.ts b/packages/angular_devkit/build_angular/src/babel/presets/application.ts index eead52a36a99..494d6d646778 100644 --- a/packages/angular_devkit/build_angular/src/babel/presets/application.ts +++ b/packages/angular_devkit/build_angular/src/babel/presets/application.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ +import { strict as assert } from 'assert'; import * as fs from 'fs'; import * as path from 'path'; @@ -52,42 +53,43 @@ type NgtscLogger = Parameters< >[0]['logger']; type I18nDiagnostics = import('@angular/localize/src/tools/src/diagnostics').Diagnostics; +type I18nDiagnosticsHandlingStrategy = + import('@angular/localize/src/tools/src/diagnostics').DiagnosticHandlingStrategy; function createI18nDiagnostics(reporter: DiagnosticReporter | undefined): I18nDiagnostics { - // Babel currently is synchronous so import cannot be used - const diagnostics: I18nDiagnostics = - new (require('@angular/localize/src/tools/src/diagnostics').Diagnostics)(); - - if (!reporter) { - return diagnostics; - } + const diagnostics: I18nDiagnostics = new (class { + readonly messages: I18nDiagnostics['messages'] = []; + hasErrors = false; + + add(type: I18nDiagnosticsHandlingStrategy, message: string): void { + if (type === 'ignore') { + return; + } + + this.messages.push({ type, message }); + this.hasErrors ||= type === 'error'; + reporter?.(type, message); + } - const baseAdd = diagnostics.add; - diagnostics.add = function (type, message, ...args) { - if (type !== 'ignore') { - baseAdd.call(diagnostics, type, message, ...args); - reporter(type, message); + error(message: string): void { + this.add('error', message); } - }; - const baseError = diagnostics.error; - diagnostics.error = function (message, ...args) { - baseError.call(diagnostics, message, ...args); - reporter('error', message); - }; + warn(message: string): void { + this.add('warning', message); + } - const baseWarn = diagnostics.warn; - diagnostics.warn = function (message, ...args) { - baseWarn.call(diagnostics, message, ...args); - reporter('warning', message); - }; + merge(other: I18nDiagnostics): void { + for (const diagnostic of other.messages) { + this.add(diagnostic.type, diagnostic.message); + } + } - const baseMerge = diagnostics.merge; - diagnostics.merge = function (other, ...args) { - baseMerge.call(diagnostics, other, ...args); - for (const diagnostic of other.messages) { - reporter(diagnostic.type, diagnostic.message); + formatDiagnostics(): never { + assert.fail( + '@angular/localize Diagnostics formatDiagnostics should not be called from within babel.', + ); } - }; + })(); return diagnostics; }
b2174947924a781f7db41377be989750e042a968
2020-10-05 21:01:49
Alan Agius
refactor(@angular/pwa): use typed version of parse5-html-rewriting-stream
false
use typed version of parse5-html-rewriting-stream
refactor
diff --git a/packages/angular/pwa/BUILD.bazel b/packages/angular/pwa/BUILD.bazel index b3c856a22cb0..525339f9254c 100644 --- a/packages/angular/pwa/BUILD.bazel +++ b/packages/angular/pwa/BUILD.bazel @@ -42,7 +42,7 @@ ts_library( "//packages/angular_devkit/schematics", "//packages/schematics/angular", "@npm//@types/node", - "@npm//parse5-html-rewriting-stream", + "@npm//@types/parse5-html-rewriting-stream", "@npm//rxjs", ], ) @@ -60,6 +60,7 @@ ts_library( deps = [ ":pwa", "//packages/angular_devkit/schematics/testing", + "@npm//parse5-html-rewriting-stream", ], ) diff --git a/packages/angular/pwa/pwa/index.ts b/packages/angular/pwa/pwa/index.ts index f5ad877c73c8..3fac23935f01 100644 --- a/packages/angular/pwa/pwa/index.ts +++ b/packages/angular/pwa/pwa/index.ts @@ -22,18 +22,16 @@ import { getWorkspace, updateWorkspace } from '@schematics/angular/utility/works import { Readable, Writable } from 'stream'; import { Schema as PwaOptions } from './schema'; -const RewritingStream = require('parse5-html-rewriting-stream'); - function updateIndexFile(path: string): Rule { - return (host: Tree) => { + return async (host: Tree) => { const buffer = host.read(path); if (buffer === null) { throw new SchematicsException(`Could not read index file: ${path}`); } - const rewriter = new RewritingStream(); + const rewriter = new (await import('parse5-html-rewriting-stream'))(); let needsNoScript = true; - rewriter.on('startTag', (startTag: { tagName: string }) => { + rewriter.on('startTag', startTag => { if (startTag.tagName === 'noscript') { needsNoScript = false; } @@ -41,7 +39,7 @@ function updateIndexFile(path: string): Rule { rewriter.emitStartTag(startTag); }); - rewriter.on('endTag', (endTag: { tagName: string }) => { + rewriter.on('endTag', endTag => { if (endTag.tagName === 'head') { rewriter.emitRaw(' <link rel="manifest" href="manifest.webmanifest">\n'); rewriter.emitRaw(' <meta name="theme-color" content="#1976d2">\n');
12761cea799353b726e297d05018482686517cbf
2020-01-17 21:41:26
Renovate Bot
build: update uuid to version 3.4.0
false
update uuid to version 3.4.0
build
diff --git a/packages/angular/cli/package.json b/packages/angular/cli/package.json index b6ab952bf9aa..0c785e2cec2e 100644 --- a/packages/angular/cli/package.json +++ b/packages/angular/cli/package.json @@ -44,7 +44,7 @@ "semver": "7.1.1", "symbol-observable": "1.2.0", "universal-analytics": "0.4.20", - "uuid": "3.3.3" + "uuid": "3.4.0" }, "ng-update": { "migrations": "@schematics/angular/migrations/migration-collection.json", diff --git a/yarn.lock b/yarn.lock index 8134673122c4..cc6f9e094260 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11404,7 +11404,12 @@ [email protected]: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= [email protected], uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2: [email protected]: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==
175487181e25ae3d46e025c0a6685fe317c3ab2b
2023-04-18 17:52:39
Angular Robot
build: lock file maintenance
false
lock file maintenance
build
diff --git a/yarn.lock b/yarn.lock index ccce520b4f39..c4c4dec3419e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1551,10 +1551,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.15.tgz#893ad71f3920ccb919e1757c387756a9bca2ef42" integrity sha512-0kOB6Y7Br3KDVgHeg8PRcvfLkq+AccreK///B4Z6fNZGr/tNHX0z2VywCc7PTeWp+bPvjA5WMvNXltHw5QjAIA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.16.tgz#7b18cab5f4d93e878306196eed26b6d960c12576" - integrity sha512-QX48qmsEZW+gcHgTmAj+x21mwTz8MlYQBnzF6861cNdQGvj2jzzFjqH0EBabrIa/WVZ2CHolwMoqxVryqKt8+Q== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.17.tgz#164b054d58551f8856285f386e1a8f45d9ba3a31" + integrity sha512-jaJ5IlmaDLFPNttv0ofcwy/cfeY4bh/n705Tgh+eLObbGtQBK3EPAu+CzL95JVE4nFAliyrnEu0d32Q5foavqg== "@esbuild/[email protected]": version "0.17.11" @@ -1566,10 +1566,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.15.tgz#143e0d4e4c08c786ea410b9a7739779a9a1315d8" integrity sha512-sRSOVlLawAktpMvDyJIkdLI/c/kdRTOqo8t6ImVxg8yT7LQDUYV5Rp2FKeEosLr6ZCja9UjYAzyRSxGteSJPYg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.16.tgz#5c47f6a7c2cada6ed4b4d4e72d8c66e76d812812" - integrity sha512-baLqRpLe4JnKrUXLJChoTN0iXZH7El/mu58GE3WIA6/H834k0XWvLRmGLG8y8arTRS9hJJibPnF0tiGhmWeZgw== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.17.tgz#1b3b5a702a69b88deef342a7a80df4c894e4f065" + integrity sha512-E6VAZwN7diCa3labs0GYvhEPL2M94WLF8A+czO8hfjREXxba8Ng7nM5VxV+9ihNXIY1iQO1XxUU4P7hbqbICxg== "@esbuild/[email protected]": version "0.17.11" @@ -1581,10 +1581,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.15.tgz#d2d12a7676b2589864281b2274355200916540bc" integrity sha512-MzDqnNajQZ63YkaUWVl9uuhcWyEyh69HGpMIrf+acR4otMkfLJ4sUCxqwbCyPGicE9dVlrysI3lMcDBjGiBBcQ== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.16.tgz#8686a6e98359071ffd5312046551943e7244c51a" - integrity sha512-G4wfHhrrz99XJgHnzFvB4UwwPxAWZaZBOFXh+JH1Duf1I4vIVfuYY9uVLpx4eiV2D/Jix8LJY+TAdZ3i40tDow== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.17.tgz#6781527e3c4ea4de532b149d18a2167f06783e7f" + integrity sha512-446zpfJ3nioMC7ASvJB1pszHVskkw4u/9Eu8s5yvvsSDTzYh4p4ZIRj0DznSl3FBF0Z/mZfrKXTtt0QCoFmoHA== "@esbuild/[email protected]": version "0.17.11" @@ -1596,10 +1596,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.15.tgz#2e88e79f1d327a2a7d9d06397e5232eb0a473d61" integrity sha512-7siLjBc88Z4+6qkMDxPT2juf2e8SJxmsbNVKFY2ifWCDT72v5YJz9arlvBw5oB4W/e61H1+HDB/jnu8nNg0rLA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.16.tgz#aa79fbf447630ca0696a596beba962a775bbf394" - integrity sha512-/Ofw8UXZxuzTLsNFmz1+lmarQI6ztMZ9XktvXedTbt3SNWDn0+ODTwxExLYQ/Hod91EZB4vZPQJLoqLF0jvEzA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.17.tgz#c5961ef4d3c1cc80dafe905cc145b5a71d2ac196" + integrity sha512-m/gwyiBwH3jqfUabtq3GH31otL/0sE0l34XKpSIqR7NjQ/XHQ3lpmQHLHbG8AHTGCw8Ao059GvV08MS0bhFIJQ== "@esbuild/[email protected]": version "0.17.11" @@ -1611,10 +1611,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.15.tgz#9384e64c0be91388c57be6d3a5eaf1c32a99c91d" integrity sha512-NbImBas2rXwYI52BOKTW342Tm3LTeVlaOQ4QPZ7XuWNKiO226DisFk/RyPk3T0CKZkKMuU69yOvlapJEmax7cg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.16.tgz#d5d68ee510507104da7e7503224c647c957e163e" - integrity sha512-SzBQtCV3Pdc9kyizh36Ol+dNVhkDyIrGb/JXZqFq8WL37LIyrXU0gUpADcNV311sCOhvY+f2ivMhb5Tuv8nMOQ== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.17.tgz#b81f3259cc349691f67ae30f7b333a53899b3c20" + integrity sha512-4utIrsX9IykrqYaXR8ob9Ha2hAY2qLc6ohJ8c0CN1DR8yWeMrTgYFjgdeQ9LIoTOfLetXjuCu5TRPHT9yKYJVg== "@esbuild/[email protected]": version "0.17.11" @@ -1626,10 +1626,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.15.tgz#2ad5a35bc52ebd9ca6b845dbc59ba39647a93c1a" integrity sha512-Xk9xMDjBVG6CfgoqlVczHAdJnCs0/oeFOspFap5NkYAmRCT2qTn1vJWA2f419iMtsHSLm+O8B6SLV/HlY5cYKg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.16.tgz#b00b4cc8c2e424907cfe3a607384ab24794edd52" - integrity sha512-ZqftdfS1UlLiH1DnS2u3It7l4Bc3AskKeu+paJSfk7RNOMrOxmeFDhLTMQqMxycP1C3oj8vgkAT6xfAuq7ZPRA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.17.tgz#db846ad16cf916fd3acdda79b85ea867cb100e87" + integrity sha512-4PxjQII/9ppOrpEwzQ1b0pXCsFLqy77i0GaHodrmzH9zq2/NEhHMAMJkJ635Ns4fyJPFOlHMz4AsklIyRqFZWA== "@esbuild/[email protected]": version "0.17.11" @@ -1641,10 +1641,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.15.tgz#b513a48446f96c75fda5bef470e64d342d4379cd" integrity sha512-3TWAnnEOdclvb2pnfsTWtdwthPfOz7qAfcwDLcfZyGJwm1SRZIMOeB5FODVhnM93mFSPsHB9b/PmxNNbSnd0RQ== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.16.tgz#84af4430a07730b50bbc945a90cf7036c1853b76" - integrity sha512-rHV6zNWW1tjgsu0dKQTX9L0ByiJHHLvQKrWtnz8r0YYJI27FU3Xu48gpK2IBj1uCSYhJ+pEk6Y0Um7U3rIvV8g== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.17.tgz#4dd99acbaaba00949d509e7c144b1b6ef9e1815b" + integrity sha512-lQRS+4sW5S3P1sv0z2Ym807qMDfkmdhUYX30GRBURtLTrJOPDpoU0kI6pVz1hz3U0+YQ0tXGS9YWveQjUewAJw== "@esbuild/[email protected]": version "0.17.11" @@ -1656,10 +1656,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.15.tgz#9697b168175bfd41fa9cc4a72dd0d48f24715f31" integrity sha512-T0MVnYw9KT6b83/SqyznTs/3Jg2ODWrZfNccg11XjDehIved2oQfrX/wVuev9N936BpMRaTR9I1J0tdGgUgpJA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.16.tgz#35571d15de6272c862d9ce6341372fb3cef0f266" - integrity sha512-8yoZhGkU6aHu38WpaM4HrRLTFc7/VVD9Q2SvPcmIQIipQt2I/GMTZNdEHXoypbbGao5kggLcxg0iBKjo0SQYKA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.17.tgz#7f9274140b2bb9f4230dbbfdf5dc2761215e30f6" + integrity sha512-2+pwLx0whKY1/Vqt8lyzStyda1v0qjJ5INWIe+d8+1onqQxHLLi3yr5bAa4gvbzhZqBztifYEu8hh1La5+7sUw== "@esbuild/[email protected]": version "0.17.11" @@ -1671,10 +1671,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.15.tgz#5b22062c54f48cd92fab9ffd993732a52db70cd3" integrity sha512-MLTgiXWEMAMr8nmS9Gigx43zPRmEfeBfGCwxFQEMgJ5MC53QKajaclW6XDPjwJvhbebv+RzK05TQjvH3/aM4Xw== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.16.tgz#b65c7cd5b0eadd08f91aab66b9dda81b6a4b2a70" - integrity sha512-n4O8oVxbn7nl4+m+ISb0a68/lcJClIbaGAoXwqeubj/D1/oMMuaAXmJVfFlRjJLu/ZvHkxoiFJnmbfp4n8cdSw== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.17.tgz#5c8e44c2af056bb2147cf9ad13840220bcb8948b" + integrity sha512-biDs7bjGdOdcmIk6xU426VgdRUpGg39Yz6sT9Xp23aq+IEHDb/u5cbmu/pAANpDB4rZpY/2USPhCA+w9t3roQg== "@esbuild/[email protected]": version "0.17.11" @@ -1686,10 +1686,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.15.tgz#eb28a13f9b60b5189fcc9e98e1024f6b657ba54c" integrity sha512-wp02sHs015T23zsQtU4Cj57WiteiuASHlD7rXjKUyAGYzlOKDAjqK6bk5dMi2QEl/KVOcsjwL36kD+WW7vJt8Q== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.16.tgz#673a68cb251ce44a00a6422ada29064c5a1cd2c0" - integrity sha512-9ZBjlkdaVYxPNO8a7OmzDbOH9FMQ1a58j7Xb21UfRU29KcEEU3VTHk+Cvrft/BNv0gpWJMiiZ/f4w0TqSP0gLA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.17.tgz#18a6b3798658be7f46e9873fa0c8d4bec54c9212" + integrity sha512-IBTTv8X60dYo6P2t23sSUYym8fGfMAiuv7PzJ+0LcdAndZRzvke+wTVxJeCq4WgjppkOpndL04gMZIFvwoU34Q== "@esbuild/[email protected]": version "0.17.11" @@ -1701,10 +1701,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.15.tgz#32454bdfe144cf74b77895a8ad21a15cb81cfbe5" integrity sha512-k7FsUJjGGSxwnBmMh8d7IbObWu+sF/qbwc+xKZkBe/lTAF16RqxRCnNHA7QTd3oS2AfGBAnHlXL67shV5bBThQ== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.16.tgz#477e2da34ab46ffdbf4740fa6441e80045249385" - integrity sha512-TIZTRojVBBzdgChY3UOG7BlPhqJz08AL7jdgeeu+kiObWMFzGnQD7BgBBkWRwOtKR1i2TNlO7YK6m4zxVjjPRQ== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.17.tgz#a8d93514a47f7b4232716c9f02aeb630bae24c40" + integrity sha512-WVMBtcDpATjaGfWfp6u9dANIqmU9r37SY8wgAivuKmgKHE+bWSuv0qXEFt/p3qXQYxJIGXQQv6hHcm7iWhWjiw== "@esbuild/[email protected]": version "0.17.11" @@ -1716,10 +1716,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.15.tgz#af12bde0d775a318fad90eb13a0455229a63987c" integrity sha512-ZLWk6czDdog+Q9kE/Jfbilu24vEe/iW/Sj2d8EVsmiixQ1rM2RKH2n36qfxK4e8tVcaXkvuV3mU5zTZviE+NVQ== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.16.tgz#e1e9687bbdaa831d7c34edc9278200982c1a4bf4" - integrity sha512-UPeRuFKCCJYpBbIdczKyHLAIU31GEm0dZl1eMrdYeXDH+SJZh/i+2cAmD3A1Wip9pIc5Sc6Kc5cFUrPXtR0XHA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.17.tgz#4784efb1c3f0eac8133695fa89253d558149ee1b" + integrity sha512-2kYCGh8589ZYnY031FgMLy0kmE4VoGdvfJkxLdxP4HJvWNXpyLhjOvxVsYjYZ6awqY4bgLR9tpdYyStgZZhi2A== "@esbuild/[email protected]": version "0.17.11" @@ -1731,10 +1731,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.15.tgz#34c5ed145b2dfc493d3e652abac8bd3baa3865a5" integrity sha512-mY6dPkIRAiFHRsGfOYZC8Q9rmr8vOBZBme0/j15zFUKM99d4ILY4WpOC7i/LqoY+RE7KaMaSfvY8CqjJtuO4xg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.16.tgz#2f19075d63622987e86e83a4b7866cd57b796c60" - integrity sha512-io6yShgIEgVUhExJejJ21xvO5QtrbiSeI7vYUnr7l+v/O9t6IowyhdiYnyivX2X5ysOVHAuyHW+Wyi7DNhdw6Q== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.17.tgz#ef6558ec5e5dd9dc16886343e0ccdb0699d70d3c" + integrity sha512-KIdG5jdAEeAKogfyMTcszRxy3OPbZhq0PPsW4iKKcdlbk3YE4miKznxV2YOSmiK/hfOZ+lqHri3v8eecT2ATwQ== "@esbuild/[email protected]": version "0.17.11" @@ -1746,10 +1746,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.15.tgz#87bd515e837f2eb004b45f9e6a94dc5b93f22b92" integrity sha512-EcyUtxffdDtWjjwIH8sKzpDRLcVtqANooMNASO59y+xmqqRYBBM7xVLQhqF7nksIbm2yHABptoioS9RAbVMWVA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.16.tgz#bbf40a38f03ba2434fe69b5ceeec5d13c742b329" - integrity sha512-WhlGeAHNbSdG/I2gqX2RK2gfgSNwyJuCiFHMc8s3GNEMMHUI109+VMBfhVqRb0ZGzEeRiibi8dItR3ws3Lk+cA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.17.tgz#13a87fdbcb462c46809c9d16bcf79817ecf9ce6f" + integrity sha512-Cj6uWLBR5LWhcD/2Lkfg2NrkVsNb2sFM5aVEfumKB2vYetkA/9Uyc1jVoxLZ0a38sUhFk4JOVKH0aVdPbjZQeA== "@esbuild/[email protected]": version "0.17.11" @@ -1761,10 +1761,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.15.tgz#20bf7947197f199ddac2ec412029a414ceae3aa3" integrity sha512-BuS6Jx/ezxFuHxgsfvz7T4g4YlVrmCmg7UAwboeyNNg0OzNzKsIZXpr3Sb/ZREDXWgt48RO4UQRDBxJN3B9Rbg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.16.tgz#d2b8c0779ccd2b7917cdf0fab8831a468e0f9c01" - integrity sha512-gHRReYsJtViir63bXKoFaQ4pgTyah4ruiMRQ6im9YZuv+gp3UFJkNTY4sFA73YDynmXZA6hi45en4BGhNOJUsw== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.17.tgz#83cb16d1d3ac0dca803b3f031ba3dc13f1ec7ade" + integrity sha512-lK+SffWIr0XsFf7E0srBjhpkdFVJf3HEgXCwzkm69kNbRar8MhezFpkIwpk0qo2IOQL4JE4mJPJI8AbRPLbuOQ== "@esbuild/[email protected]": version "0.17.11" @@ -1776,10 +1776,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.15.tgz#31b93f9c94c195e852c20cd3d1914a68aa619124" integrity sha512-JsdS0EgEViwuKsw5tiJQo9UdQdUJYuB+Mf6HxtJSPN35vez1hlrNb1KajvKWF5Sa35j17+rW1ECEO9iNrIXbNg== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.16.tgz#da48b39cfdc1b12a74976625f583f031eac43590" - integrity sha512-mfiiBkxEbUHvi+v0P+TS7UnA9TeGXR48aK4XHkTj0ZwOijxexgMF01UDFaBX7Q6CQsB0d+MFNv9IiXbIHTNd4g== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.17.tgz#7bc400568690b688e20a0c94b2faabdd89ae1a79" + integrity sha512-XcSGTQcWFQS2jx3lZtQi7cQmDYLrpLRyz1Ns1DzZCtn898cWfm5Icx/DEWNcTU+T+tyPV89RQtDnI7qL2PObPg== "@esbuild/[email protected]": version "0.17.11" @@ -1791,10 +1791,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.15.tgz#8da299b3ac6875836ca8cdc1925826498069ac65" integrity sha512-R6fKjtUysYGym6uXf6qyNephVUQAGtf3n2RCsOST/neIwPqRWcnc3ogcielOd6pT+J0RDR1RGcy0ZY7d3uHVLA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.16.tgz#ddef985aed37cc81908d2573b66c0299dbc49037" - integrity sha512-n8zK1YRDGLRZfVcswcDMDM0j2xKYLNXqei217a4GyBxHIuPMGrrVuJ+Ijfpr0Kufcm7C1k/qaIrGy6eG7wvgmA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.17.tgz#1b5dcfbc4bfba80e67a11e9148de836af5b58b6c" + integrity sha512-RNLCDmLP5kCWAJR+ItLM3cHxzXRTe4N00TQyQiimq+lyqVqZWGPAvcyfUBM0isE79eEZhIuGN09rAz8EL5KdLA== "@esbuild/[email protected]": version "0.17.11" @@ -1806,10 +1806,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.15.tgz#04a1ec3d4e919714dba68dcf09eeb1228ad0d20c" integrity sha512-mVD4PGc26b8PI60QaPUltYKeSX0wxuy0AltC+WCTFwvKCq2+OgLP4+fFd+hZXzO2xW1HPKcytZBdjqL6FQFa7w== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.16.tgz#85035bf89efd66e9068bc72aa6bb85a2c317d090" - integrity sha512-lEEfkfsUbo0xC47eSTBqsItXDSzwzwhKUSsVaVjVji07t8+6KA5INp2rN890dHZeueXJAI8q0tEIfbwVRYf6Ew== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.17.tgz#e275098902291149a5dcd012c9ea0796d6b7adff" + integrity sha512-PAXswI5+cQq3Pann7FNdcpSUrhrql3wKjj3gVkmuz6OHhqqYxKvi6GgRBoaHjaG22HV/ZZEgF9TlS+9ftHVigA== "@esbuild/[email protected]": version "0.17.11" @@ -1821,10 +1821,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.15.tgz#6694ebe4e16e5cd7dab6505ff7c28f9c1c695ce5" integrity sha512-U6tYPovOkw3459t2CBwGcFYfFRjivcJJc1WC8Q3funIwX8x4fP+R6xL/QuTPNGOblbq/EUDxj9GU+dWKX0oWlQ== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.16.tgz#16338ecab854cb2d831cc9ee9cc21ef69566e1f3" - integrity sha512-jlRjsuvG1fgGwnE8Afs7xYDnGz0dBgTNZfgCK6TlvPH3Z13/P5pi6I57vyLE8qZYLrGVtwcm9UbUx1/mZ8Ukag== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.17.tgz#10603474866f64986c0370a2d4fe5a2bb7fee4f5" + integrity sha512-V63egsWKnx/4V0FMYkr9NXWrKTB5qFftKGKuZKFIrAkO/7EWLFnbBZNM1CvJ6Sis+XBdPws2YQSHF1Gqf1oj/Q== "@esbuild/[email protected]": version "0.17.11" @@ -1836,10 +1836,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.15.tgz#1f95b2564193c8d1fee8f8129a0609728171d500" integrity sha512-W+Z5F++wgKAleDABemiyXVnzXgvRFs+GVKThSI+mGgleLWluv0D7Diz4oQpgdpNzh4i2nNDzQtWbjJiqutRp6Q== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.16.tgz#423f46bb744aff897a5f74435469e1ef4952e343" - integrity sha512-TzoU2qwVe2boOHl/3KNBUv2PNUc38U0TNnzqOAcgPiD/EZxT2s736xfC2dYQbszAwo4MKzzwBV0iHjhfjxMimg== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.17.tgz#521a6d97ee0f96b7c435930353cc4e93078f0b54" + integrity sha512-YtUXLdVnd6YBSYlZODjWzH+KzbaubV0YVd6UxSfoFfa5PtNJNaW+1i+Hcmjpg2nEe0YXUCNF5bkKy1NnBv1y7Q== "@esbuild/[email protected]": version "0.17.11" @@ -1851,10 +1851,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.15.tgz#c362b88b3df21916ed7bcf75c6d09c6bf3ae354a" integrity sha512-Muz/+uGgheShKGqSVS1KsHtCyEzcdOn/W/Xbh6H91Etm+wiIfwZaBn1W58MeGtfI8WA961YMHFYTthBdQs4t+w== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.16.tgz#1978be5b192c7063bd2c8d5960eb213e1964740e" - integrity sha512-B8b7W+oo2yb/3xmwk9Vc99hC9bNolvqjaTZYEfMQhzdpBsjTvZBlXQ/teUE55Ww6sg//wlcDjOaqldOKyigWdA== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.17.tgz#56f88462ebe82dad829dc2303175c0e0ccd8e38e" + integrity sha512-yczSLRbDdReCO74Yfc5tKG0izzm+lPMYyO1fFTcn0QNwnKmc3K+HdxZWLGKg4pZVte7XVgcFku7TIZNbWEJdeQ== "@esbuild/[email protected]": version "0.17.11" @@ -1866,10 +1866,10 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.15.tgz#c2e737f3a201ebff8e2ac2b8e9f246b397ad19b8" integrity sha512-DjDa9ywLUUmjhV2Y9wUTIF+1XsmuFGvZoCmOWkli1XcNAh5t25cc7fgsCx4Zi/Uurep3TTLyDiKATgGEg61pkA== -"@esbuild/[email protected]": - version "0.17.16" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.16.tgz#260f19b0a3300d22c3a3f52722c671dc561edaa3" - integrity sha512-xJ7OH/nanouJO9pf03YsL9NAFQBHd8AqfrQd7Pf5laGyyTt/gToul6QYOA/i5i/q8y9iaM5DQFNTgpi995VkOg== +"@esbuild/[email protected]": + version "0.17.17" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.17.tgz#2b577b976e6844106715bbe0cdc57cd1528063f9" + integrity sha512-FNZw7H3aqhF9OyRQbDDnzUApDXfC1N6fgBhkqEO2jvYCJ+DxMTfZVqg3AX0R1khg1wHTBRD5SdcibSJ+XF6bFg== "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" @@ -2209,9 +2209,9 @@ integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== "@rollup/plugin-commonjs@^24.0.0": - version "24.0.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz#d54ba26a3e3c495dc332bd27a81f7e9e2df46f90" - integrity sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow== + version "24.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.1.0.tgz#79e54bd83bb64396761431eee6c44152ef322100" + integrity sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ== dependencies: "@rollup/pluginutils" "^5.0.1" commondir "^1.0.1" @@ -2330,12 +2330,18 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== -"@tufjs/[email protected]": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-1.0.1.tgz#cc8bb0478188b4b6e58d5528668212724aac87ac" - integrity sha512-AY0VoG/AXdlSOocuREfPoEW4SNhOPp/7fw6mpAxfVIny1uZ+0fEtMoCi7NhELSlqQIRLMu7RgfKhkxT+AJ+EXg== +"@tufjs/[email protected]": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz#eade9fd1f537993bc1f0949f3aea276ecc4fab31" + integrity sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ== + +"@tufjs/[email protected]": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-1.0.2.tgz#6c1e99210ada62c057b1742b5528d85acbfe0a47" + integrity sha512-uxarDtxTIK3f8hJS4yFhW/lvTa3tsiQU5iDCRut+NCnOXvNtEul0Ct58NIIcIx9Rkt7OFEK31Ndpqsd663nsew== dependencies: - minimatch "^7.4.2" + "@tufjs/canonical-json" "1.0.0" + minimatch "^8.0.3" "@types/[email protected]": version "1.0.38" @@ -3010,14 +3016,14 @@ ajv-keywords@^3.5.2: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-keywords@^5.0.0: +ajv-keywords@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== dependencies: fast-deep-equal "^3.1.3" [email protected], ajv@^8.0.0, ajv@^8.8.0: [email protected], ajv@^8.0.0, ajv@^8.9.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -3647,9 +3653,9 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001464: - version "1.0.30001477" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001477.tgz#a2ffb2276258233034bbb869d4558b02658a511e" - integrity sha512-lZim4iUHhGcy5p+Ri/G7m84hJwncj+Kz7S5aD4hoQfslKZJgt0tHc/hafVbqHC5bbhHb+mrW2JOUHkI5KH7toQ== + version "1.0.30001480" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz#9bbd35ee44c2480a1e3a3b9f4496f5066817164a" + integrity sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ== caseless@~0.12.0: version "0.12.0" @@ -3821,9 +3827,9 @@ color-support@^1.1.3: integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== colorette@^2.0.10: - version "2.0.19" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" - integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + version "2.0.20" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== colors@~1.2.1: version "1.2.5" @@ -3837,16 +3843,16 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@^2.2.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^9.4.1: - version "9.5.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" - integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -3954,9 +3960,9 @@ [email protected]: serialize-javascript "^6.0.0" core-js-compat@^3.25.1: - version "3.30.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.0.tgz#99aa2789f6ed2debfa1df3232784126ee97f4d80" - integrity sha512-P5A2h/9mRYZFIAP+5Ab8ns6083IyVpSclU74UNvbGVQ8VM7n3n3/g2yF3AkKQ9NXz2O+ioxLbEWKnDtgsFamhg== + version "3.30.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.1.tgz#961541e22db9c27fc48bfc13a3cafa8734171dfe" + integrity sha512-d690npR7MC6P0gq4npTl5n2VQeNAmUrJ90n+MHiKS7W2+xno4o3F5GDEuylSdi6EJ3VssibSGXOa1r3YXD3Mhw== dependencies: browserslist "^4.21.5" @@ -4380,9 +4386,9 @@ [email protected]: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.284: - version "1.4.357" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.357.tgz#ad02bab69e696e9a122788da4460c86166a98a01" - integrity sha512-UTkCbNTAcGXABmEnQrGcW4m3cG6fcyBfD4KDF0iyEAlbrGZiY9dmslyDAGOD1Kr5biN2F743Y30aRCOtau35Vw== + version "1.4.365" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.365.tgz#ccd9e352d4493aa288d87e6ea36f3edf350c045e" + integrity sha512-FRHZO+1tUNO4TOPXmlxetkoaIY8uwHzd1kKopK/Gx2SKn1L47wJXWD44wxP5CGRyyP98z/c8e1eBzJrgPeiBOg== emoji-regex@^8.0.0: version "8.0.0" @@ -4452,9 +4458,9 @@ entities@^2.0.0: integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== entities@^4.3.0, entities@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" - integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== env-paths@^2.2.0: version "2.2.1" @@ -4629,32 +4635,32 @@ [email protected]: "@esbuild/win32-x64" "0.17.15" esbuild@^0.17.0, esbuild@^0.17.5: - version "0.17.16" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.16.tgz#5efec24a8ff29e0c157359f27e1b5532a728b720" - integrity sha512-aeSuUKr9aFVY9Dc8ETVELGgkj4urg5isYx8pLf4wlGgB0vTFjxJQdHnNH6Shmx4vYYrOTLCHtRI5i1XZ9l2Zcg== + version "0.17.17" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.17.tgz#fa906ab11b11d2ed4700f494f4f764229b25c916" + integrity sha512-/jUywtAymR8jR4qsa2RujlAF7Krpt5VWi72Q2yuLD4e/hvtNcFQ0I1j8m/bxq238pf3/0KO5yuXNpuLx8BE1KA== optionalDependencies: - "@esbuild/android-arm" "0.17.16" - "@esbuild/android-arm64" "0.17.16" - "@esbuild/android-x64" "0.17.16" - "@esbuild/darwin-arm64" "0.17.16" - "@esbuild/darwin-x64" "0.17.16" - "@esbuild/freebsd-arm64" "0.17.16" - "@esbuild/freebsd-x64" "0.17.16" - "@esbuild/linux-arm" "0.17.16" - "@esbuild/linux-arm64" "0.17.16" - "@esbuild/linux-ia32" "0.17.16" - "@esbuild/linux-loong64" "0.17.16" - "@esbuild/linux-mips64el" "0.17.16" - "@esbuild/linux-ppc64" "0.17.16" - "@esbuild/linux-riscv64" "0.17.16" - "@esbuild/linux-s390x" "0.17.16" - "@esbuild/linux-x64" "0.17.16" - "@esbuild/netbsd-x64" "0.17.16" - "@esbuild/openbsd-x64" "0.17.16" - "@esbuild/sunos-x64" "0.17.16" - "@esbuild/win32-arm64" "0.17.16" - "@esbuild/win32-ia32" "0.17.16" - "@esbuild/win32-x64" "0.17.16" + "@esbuild/android-arm" "0.17.17" + "@esbuild/android-arm64" "0.17.17" + "@esbuild/android-x64" "0.17.17" + "@esbuild/darwin-arm64" "0.17.17" + "@esbuild/darwin-x64" "0.17.17" + "@esbuild/freebsd-arm64" "0.17.17" + "@esbuild/freebsd-x64" "0.17.17" + "@esbuild/linux-arm" "0.17.17" + "@esbuild/linux-arm64" "0.17.17" + "@esbuild/linux-ia32" "0.17.17" + "@esbuild/linux-loong64" "0.17.17" + "@esbuild/linux-mips64el" "0.17.17" + "@esbuild/linux-ppc64" "0.17.17" + "@esbuild/linux-riscv64" "0.17.17" + "@esbuild/linux-s390x" "0.17.17" + "@esbuild/linux-x64" "0.17.17" + "@esbuild/netbsd-x64" "0.17.17" + "@esbuild/openbsd-x64" "0.17.17" + "@esbuild/sunos-x64" "0.17.17" + "@esbuild/win32-arm64" "0.17.17" + "@esbuild/win32-ia32" "0.17.17" + "@esbuild/win32-x64" "0.17.17" escalade@^3.1.1: version "3.1.1" @@ -4703,9 +4709,9 @@ eslint-import-resolver-node@^0.3.7: resolve "^1.22.1" eslint-module-utils@^2.7.4: - version "2.7.4" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" - integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== dependencies: debug "^3.2.7" @@ -4744,9 +4750,9 @@ [email protected], eslint-scope@^5.1.1: estraverse "^4.1.1" eslint-scope@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" - integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" + integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -5382,9 +5388,9 @@ globby@^11.1.0: slash "^3.0.0" globby@^13.1.1: - version "13.1.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" - integrity sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw== + version "13.1.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.4.tgz#2f91c116066bcec152465ba36e5caa4a13c01317" + integrity sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g== dependencies: dir-glob "^3.0.1" fast-glob "^3.2.11" @@ -5892,7 +5898,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.1.0, is-core-module@^2.11.0, is-core-module@^2.8.1, is-core-module@^2.9.0: +is-core-module@^2.1.0, is-core-module@^2.11.0, is-core-module@^2.12.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.12.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== @@ -6613,9 +6619,9 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== lru-cache@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.1.tgz#ac061ed291f8b9adaca2b085534bb1d3b61bef83" - integrity sha512-C8QsKIN1UIXeOs3iWmiZ1lQY+EnKDojWd37fXy1aSbJvH4iSma1uy2OWuoB3m4SYRli5+CUjDv3Dij5DVoetmg== + version "9.0.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.3.tgz#8a04f282df5320227bb7215c55df2660d3e4e25b" + integrity sha512-cyjNRew29d4kbgnz1sjDqxg7qg8NW4s+HQzCGjeon7DV5T2yDije16W9HaUFV1dhVEMh+SjrOcK0TomBmf3Egg== [email protected], magic-string@^0.30.0: version "0.30.0" @@ -6674,9 +6680,9 @@ make-fetch-happen@^10.0.3: ssri "^9.0.0" make-fetch-happen@^11.0.0, make-fetch-happen@^11.0.1: - version "11.0.3" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-11.0.3.tgz#ed83dd3685b97f75607156d2721848f6eca561b9" - integrity sha512-oPLh5m10lRNNZDjJ2kP8UpboUx2uFXVaVweVe/lWut4iHWcQEmfqSVJt2ihZsFI8HbpwyyocaXbCAWf0g1ukIA== + version "11.1.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-11.1.0.tgz#f26b05e89317e960b75fd5e080e40d40f8d7b2a5" + integrity sha512-7ChuOzCb1LzdQZrTy0ky6RsCoMYeM+Fh4cY0+4zsJVhNcH5Q3OJojLY1mGkD0xAhWB29lskECVb6ZopofwjldA== dependencies: agentkeepalive "^4.2.1" cacache "^17.0.0" @@ -6801,7 +6807,7 @@ minimatch@^7.4.2: dependencies: brace-expansion "^2.0.1" -minimatch@^8.0.2: +minimatch@^8.0.2, minimatch@^8.0.3: version "8.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229" integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA== @@ -6832,9 +6838,9 @@ minipass-fetch@^2.0.3: encoding "^0.1.13" minipass-fetch@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.1.tgz#bae3789f668d82ffae3ea47edc6b78b8283b3656" - integrity sha512-t9/wowtf7DYkwz8cfMSt0rMwiyNIBXf5CKZ3S5ZMqRqMYT0oLTp0x1WorMI9WTwvaPg21r1JbFxJMum8JrLGfw== + version "3.0.2" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.2.tgz#2f7275ae13f2fb0f2a469cee4f78250c25c80ab3" + integrity sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA== dependencies: minipass "^4.0.0" minipass-sized "^1.0.3" @@ -6879,9 +6885,9 @@ minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: yallist "^4.0.0" minipass@^4.0.0, minipass@^4.2.4: - version "4.2.7" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.7.tgz#14c6fc0dcab54d9c4dd64b2b7032fef04efec218" - integrity sha512-ScVIgqHcXRMyfflqHmEW0bm8z8rb5McHyOY3ewX9JBgZaR77G7nxq9L/mtV96/QbAAwtbCAHVVLzD1kkyfFQEw== + version "4.2.8" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.8.tgz#f0010f64393ecfc1d1ccb5f582bcaf45f48e1a3a" + integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ== minipass@^5.0.0: version "5.0.0" @@ -6934,7 +6940,7 @@ [email protected]: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanoid@^3.3.4: +nanoid@^3.3.4, nanoid@^3.3.6: version "3.3.6" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== @@ -7059,9 +7065,9 @@ npm-bundled@^3.0.0: npm-normalize-package-bin "^3.0.0" npm-install-checks@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-6.1.0.tgz#7221210d9d746a40c37bf6c9b6c7a39f85e92998" - integrity sha512-udSGENih/5xKh3Ex+L0PtZcOt0Pa+6ppDLnpG5D49/EhMja3LupaY9E/DtJTxyFBwE09ot7Fc+H4DywnZNWTVA== + version "6.1.1" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-6.1.1.tgz#b459b621634d06546664207fde16810815808db1" + integrity sha512-dH3GmQL4vsPtld59cOn8uY0iOqRmqKvV+DLGwNXV/Q7MDgD2QfOADWd/mFXcIE5LVhYYGjA3baz6W9JneqnuCw== dependencies: semver "^7.1.1" @@ -7098,9 +7104,9 @@ [email protected], npm-pick-manifest@^8.0.0: semver "^7.3.5" npm-registry-fetch@^14.0.0: - version "14.0.3" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-14.0.3.tgz#8545e321c2b36d2c6fe6e009e77e9f0e527f547b" - integrity sha512-YaeRbVNpnWvsGOjX2wk5s85XJ7l1qQBGAp724h8e2CZFFhMSuw9enom7K1mWVUtvXO1uUSFIAPofQK0pPN0ZcA== + version "14.0.4" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-14.0.4.tgz#43dfa55ce7c0d0c545d625c7a916bab5b95f7038" + integrity sha512-pMS2DRkwg+M44ct65zrN/Cr9IHK1+n6weuefAo6Er4lc+/8YBCU0Czq04H3ZiSigluh7pb2rMM5JpgcytctB+Q== dependencies: make-fetch-happen "^11.0.0" minipass "^4.0.0" @@ -7135,9 +7141,9 @@ nth-check@^2.0.1: boolbase "^1.0.0" nwsapi@^2.2.0, nwsapi@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.3.tgz#00e04dfd5a4a751e5ec2fecdc75dfd2f0db820fa" - integrity sha512-jscxIO4/VKScHlbmFBdV1Z6LXnLO+ZR4VMtypudUdfwtKxUN3TQcNFIHLwKtrUbDyHN4/GycY9+oRGZ2XMXYPw== + version "2.2.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.4.tgz#fd59d5e904e8e1f03c25a7d5a15cfa16c714a1e5" + integrity sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g== oauth-sign@~0.9.0: version "0.9.0" @@ -7484,9 +7490,9 @@ path-parse@^1.0.6, path-parse@^1.0.7: integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-scurry@^1.6.1: - version "1.6.4" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.4.tgz#020a9449e5382a4acb684f9c7e1283bc5695de66" - integrity sha512-Qp/9IHkdNiXJ3/Kon++At2nVpnhRiPq/aSvQN+H3U1WZbvNRK0RIQK/o4HMqPoXjpuGJUEWpHSs6Mnjxqh3TQg== + version "1.7.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.7.0.tgz#99c741a2cfbce782294a39994d63748b5a24f6db" + integrity sha512-UkZUeDjczjYRE495+9thsgcVgsaCPkaw80slmfVFgllxY+IO8ubTsOpFVjDPROBqJdHfVPUFRHPBV/WciOVfWg== dependencies: lru-cache "^9.0.0" minipass "^5.0.0" @@ -7624,7 +7630,7 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== [email protected], postcss@^8.2.14, postcss@^8.3.7, postcss@^8.4.19, postcss@^8.4.21: [email protected]: version "8.4.21" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== @@ -7633,6 +7639,15 @@ [email protected], postcss@^8.2.14, postcss@^8.3.7, postcss@^8.4.19, postcss@^8.4.2 picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.2.14, postcss@^8.3.7, postcss@^8.4.19, postcss@^8.4.21: + version "8.4.22" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.22.tgz#c29e6776b60ab3af602d4b513d5bd2ff9aa85dc1" + integrity sha512-XseknLAfRHzVWjCEtdviapiBtfLdgyzExD50Rg2ePaucEesyh8Wv4VPdW0nbyDa1ydbrAxV19jvMT4+LFmcNUA== + dependencies: + nanoid "^3.3.6" + picocolors "^1.0.0" + source-map-js "^1.0.2" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -8008,11 +8023,11 @@ [email protected]: supports-preserve-symlinks-flag "^1.0.0" resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.1, resolve@~1.22.1: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== + version "1.22.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.3.tgz#4b4055349ffb962600972da1fdc33c46a4eb3283" + integrity sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw== dependencies: - is-core-module "^2.11.0" + is-core-module "^2.12.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -8078,9 +8093,9 @@ rollup-plugin-sourcemaps@^0.6.0: source-map-resolve "^0.6.0" rollup@^3.18.0, rollup@~3.20.0: - version "3.20.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.20.2.tgz#f798c600317f216de2e4ad9f4d9ab30a89b690ff" - integrity sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg== + version "3.20.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.20.4.tgz#cde35731c5c0c637de0b532d5d1a84bd802c128e" + integrity sha512-n7J4tuctZXUErM9Uc916httwqmTc63zzCr2+TLCiSCpfO/Xuk3g/marGN1IlRJZi+QF3XMYx75PxXRfZDVgaRw== optionalDependencies: fsevents "~2.3.2" @@ -8205,23 +8220,23 @@ saxes@^6.0.0: xmlchars "^2.2.0" schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + version "3.1.2" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.2.tgz#36c10abca6f7577aeae136c804b0c741edeadc99" + integrity sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" ajv-keywords "^3.5.2" schema-utils@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" - integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== + version "4.0.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.1.tgz#eb2d042df8b01f4b5c276a2dfd41ba0faab72e8d" + integrity sha512-lELhBAAly9NowEsX0yZBlw9ahZG+sK/1RJ21EpzdYHKEs13Vku3LJ+MIPhh4sMs0oCCeufZQEQbMekiA4vuVIQ== dependencies: "@types/json-schema" "^7.0.9" - ajv "^8.8.0" + ajv "^8.9.0" ajv-formats "^2.1.1" - ajv-keywords "^5.0.0" + ajv-keywords "^5.1.0" select-hose@^2.0.0: version "2.0.0" @@ -8667,9 +8682,9 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^10.0.0: - version "10.0.2" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.2.tgz#3791753e5e119274a83e5af7cac2f615528db3d6" - integrity sha512-LWMXUSh7fEfCXNBq4UnRzC4Qc5Y1PPg5ogmb+6HX837i2cKzjB133aYmQ4lgO0shVTcTQHquKp3v5bn898q3Sw== + version "10.0.3" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.3.tgz#7f83da39058ca1d599d174e9eee4237659710bf4" + integrity sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg== dependencies: minipass "^4.0.0" @@ -9054,11 +9069,11 @@ [email protected], tsutils@^3.0.0, tsutils@^3.21.0: tslib "^1.8.1" tuf-js@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.2.tgz#09ca04a89783b739e67dd796f6562e3940628aea" - integrity sha512-gBfbnS6khluxjvoFCpRV0fhWT265xNfpiNXOcBX0Ze6HGbPhe93UG5V5DdKcgm/aXsMadnY76l/h6j63GmJS5g== + version "1.1.3" + resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.3.tgz#db3aada70fbf91fd9def9ad255645eaf81309f69" + integrity sha512-jGYi5nG/kqgfTFQSdoN6PW9eIn+XRZqdXku+fSwNk6UpWIsWaV7pzAqPgFr85edOPhoyJDyBqCS+DCnHroMvrw== dependencies: - "@tufjs/models" "1.0.1" + "@tufjs/models" "1.0.2" make-fetch-happen "^11.0.1" tunnel-agent@^0.6.0: @@ -9221,9 +9236,9 @@ [email protected], unpipe@~1.0.0: integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== update-browserslist-db@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== + version "1.0.11" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" + integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -9916,15 +9931,15 @@ yocto-queue@^0.1.0: integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== z-schema@~5.0.2: - version "5.0.5" - resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.5.tgz#6805a48c5366a6125cae0e58752babfd503daf32" - integrity sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q== + version "5.0.6" + resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.6.tgz#46d6a687b15e4a4369e18d6cb1c7b8618fc256c5" + integrity sha512-+XR1GhnWklYdfr8YaZv/iu+vY+ux7V5DS5zH1DQf6bO5ufrt/5cgNhVO5qyhsjFXvsqQb/f08DWE9b6uPscyAg== dependencies: lodash.get "^4.4.2" lodash.isequal "^4.5.0" validator "^13.7.0" optionalDependencies: - commander "^9.4.1" + commander "^10.0.0" zone.js@^0.13.0: version "0.13.0"
8d16f27b717043575772fdce36b26634ee39cd9f
2016-08-09 01:55:29
PatrickJS
chore(universal): update tasks
false
update tasks
chore
diff --git a/modules/@angular/universal-next-prototype/hello-world/package.json b/modules/@angular/universal-next-prototype/hello-world/package.json index 67f9e9232a84..2cc1cc6e6fae 100644 --- a/modules/@angular/universal-next-prototype/hello-world/package.json +++ b/modules/@angular/universal-next-prototype/hello-world/package.json @@ -6,9 +6,10 @@ "watch": "npm run build -- --watch", "prebuild": "rimraf dist", "build": "npm run copy:index && webpack", - "copy:index": "cpy 'index.html' '../dist' --cwd=src --parents", - "server": "nodemon ./dist/express-bundle.js -p 3000 --cors", - "server:prod": "http-server ./dist/express-bundle.js -p 3000 --cors", + "copy:index": "cpy 'index.html' '../dist/public' --cwd=src --parents", + "server": "npm run server:dev", + "server:dev": "nodemon ./dist/server/express-bundle.js", + "server:prod": "http-server ./dist/server/express-bundle.js -p 3000 --cors", "server:universal": "npm run build", "test": "echo \"Error: no test specified\" && exit 1" },
0c92ea5ca34d82849862d55c4210cf62c819d514
2021-08-11 01:10:19
Alan Agius
feat(@angular-devkit/core): remove deprecated schema id handling
false
remove deprecated schema id handling
feat
diff --git a/packages/angular_devkit/core/src/json/schema/registry.ts b/packages/angular_devkit/core/src/json/schema/registry.ts index 652b2327eef2..bc8262ba8540 100644 --- a/packages/angular_devkit/core/src/json/schema/registry.ts +++ b/packages/angular_devkit/core/src/json/schema/registry.ts @@ -235,7 +235,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { } private async _flatten(schema: JsonObject): Promise<JsonObject> { - this._replaceDeprecatedSchemaIdKeyword(schema); this._ajv.removeSchema(schema); this._currentCompilationSchemaInfo = undefined; @@ -294,8 +293,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { return async (data) => ({ success: schema, data }); } - this._replaceDeprecatedSchemaIdKeyword(schema); - const schemaInfo: SchemaInfo = { smartDefaultRecord: new Map<string, JsonObject>(), promptDefinitions: [], @@ -680,22 +677,6 @@ export class CoreSchemaRegistry implements SchemaRegistry { }); } - /** - * Workaround to avoid a breaking change in downstream schematics. - * @deprecated will be removed in version 13. - */ - private _replaceDeprecatedSchemaIdKeyword(schema: JsonObject): void { - if (typeof schema.id === 'string') { - schema.$id = schema.id; - delete schema.id; - - // eslint-disable-next-line no-console - console.warn( - `"${schema.$id}" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.`, - ); - } - } - private normalizeDataPathArr(it: SchemaObjCxt): (number | string)[] { return it.dataPathArr .slice(1, it.dataLevel + 1)
7b02161e94fe583ad732c3a5830d8b1ca91ab379
2023-10-30 13:30:18
Doug Parker
fix(@ngtools/webpack): skip transforming empty inline styles in Webpack JIT compilations
false
skip transforming empty inline styles in Webpack JIT compilations
fix
diff --git a/packages/ngtools/webpack/src/transformers/replace_resources.ts b/packages/ngtools/webpack/src/transformers/replace_resources.ts index 2a6adf29c07e..c31f171d1fb4 100644 --- a/packages/ngtools/webpack/src/transformers/replace_resources.ts +++ b/packages/ngtools/webpack/src/transformers/replace_resources.ts @@ -236,6 +236,11 @@ function transformInlineStyleLiteral( return node; } + // Don't transform empty strings as PostCSS will choke on them. No work to do anyways. + if (node.text === '') { + return node; + } + if (!isInlineStyle) { const url = getResourceUrl(node);
a296e9521264c29d525af8886eacf0c439677a56
2022-08-15 18:00:27
Angular Robot
build: update angular to 989a053
false
update angular to 989a053
build
diff --git a/.github/workflows/dev-infra.yml b/.github/workflows/dev-infra.yml index 7711858182f6..11daab646018 100644 --- a/.github/workflows/dev-infra.yml +++ b/.github/workflows/dev-infra.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 - - uses: angular/dev-infra/github-actions/commit-message-based-labels@55daf7df431dd8a4c38628df746e9d7658e58a1f + - uses: angular/dev-infra/github-actions/commit-message-based-labels@b158ee64c37844b5bc8fed167815f6f0e99c3ae7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} post_approval_changes: runs-on: ubuntu-latest steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2 - - uses: angular/dev-infra/github-actions/post-approval-changes@55daf7df431dd8a4c38628df746e9d7658e58a1f + - uses: angular/dev-infra/github-actions/post-approval-changes@b158ee64c37844b5bc8fed167815f6f0e99c3ae7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/feature-requests.yml b/.github/workflows/feature-requests.yml index 057e959907c5..713ffe96e4aa 100644 --- a/.github/workflows/feature-requests.yml +++ b/.github/workflows/feature-requests.yml @@ -16,6 +16,6 @@ jobs: if: github.repository == 'angular/angular-cli' runs-on: ubuntu-latest steps: - - uses: angular/dev-infra/github-actions/feature-request@55daf7df431dd8a4c38628df746e9d7658e58a1f + - uses: angular/dev-infra/github-actions/feature-request@b158ee64c37844b5bc8fed167815f6f0e99c3ae7 with: angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }} diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml index a2f73c6e9a7a..e919a1d5c27f 100644 --- a/.github/workflows/lock-closed.yml +++ b/.github/workflows/lock-closed.yml @@ -13,6 +13,6 @@ jobs: lock_closed: runs-on: ubuntu-latest steps: - - uses: angular/dev-infra/github-actions/lock-closed@55daf7df431dd8a4c38628df746e9d7658e58a1f + - uses: angular/dev-infra/github-actions/lock-closed@b158ee64c37844b5bc8fed167815f6f0e99c3ae7 with: lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }} diff --git a/package.json b/package.json index 6f3d0c8cea52..edbe07446b2b 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "devDependencies": { "@ampproject/remapping": "2.2.0", "@angular/animations": "14.1.2", - "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a9bafebdb359b24c28e09010c5e6ec3fc8f64032", + "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#08f0188fccf98139207fbd5e683533950e9068e2", "@angular/cdk": "14.1.2", "@angular/common": "14.1.2", "@angular/compiler": "14.1.2", @@ -75,7 +75,7 @@ "@angular/forms": "14.1.2", "@angular/localize": "14.1.2", "@angular/material": "14.1.2", - "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#b3fa973d98f1eee8969c4dd50fe7e7e93b6568c9", + "@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#a9d380df54092930c4eabbab114c29ac125759f4", "@angular/platform-browser": "14.1.2", "@angular/platform-browser-dynamic": "14.1.2", "@angular/platform-server": "14.1.2", diff --git a/tests/legacy-cli/e2e/ng-snapshot/package.json b/tests/legacy-cli/e2e/ng-snapshot/package.json index 40ab66f32d4d..70200a70e79b 100644 --- a/tests/legacy-cli/e2e/ng-snapshot/package.json +++ b/tests/legacy-cli/e2e/ng-snapshot/package.json @@ -2,21 +2,21 @@ "description": "snapshot versions of Angular for e2e testing", "private": true, "dependencies": { - "@angular/animations": "github:angular/animations-builds#99419a6fbf21674a6dda983e48859fca4e0856b5", - "@angular/cdk": "github:angular/cdk-builds#881b5f4edf50a3ff0c6c0aeae40fa7fde4e92df1", - "@angular/common": "github:angular/common-builds#765351be5c24fb2331f33575b9c85dae9f7b03ac", - "@angular/compiler": "github:angular/compiler-builds#61c714819ffcdaa9f06983541f5a02d2476b6d44", - "@angular/compiler-cli": "github:angular/compiler-cli-builds#a753ca828bf50d671f407132153a245938c5f173", - "@angular/core": "github:angular/core-builds#79234cfd1788238faa43c961c9a687d7cc376a5e", - "@angular/forms": "github:angular/forms-builds#a3b492195790bc46a0031c7cc075d0bf3c81e2e7", - "@angular/language-service": "github:angular/language-service-builds#b8a6da157301e697a8ff17a6109e9436c55384aa", - "@angular/localize": "github:angular/localize-builds#499b2c75c59e30145d83cdb62a0665451fe8cc49", - "@angular/material": "github:angular/material-builds#60fef759f3366294b83e6f50b1ef4fa073870e3c", - "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#432300fff602585ccb5b5b9237d36a5d786af06c", - "@angular/platform-browser": "github:angular/platform-browser-builds#1eed2dbeb61868b0a206e7e1789cb7dba9e0e9ad", - "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#5fce7a421ec77525ed00b47b6484ecc0416d42ca", - "@angular/platform-server": "github:angular/platform-server-builds#7e795c8300936df73aaa057cdddc68e1957ac097", - "@angular/router": "github:angular/router-builds#58e4c581e6aede81d6c34c4cb9bc264999db2b66", - "@angular/service-worker": "github:angular/service-worker-builds#e3eb24c8693e074016c5496190b5dbb3c383933b" + "@angular/animations": "github:angular/animations-builds#989a053608809400c9098dccdb72b3d2ee657a5d", + "@angular/cdk": "github:angular/cdk-builds#5e0dca89a524c025fc0cbf50fffd818e539d99f9", + "@angular/common": "github:angular/common-builds#58a4bdf58291f31d30562cd9f913051f75b9d2f3", + "@angular/compiler": "github:angular/compiler-builds#3231eb72796a0d26c6045cc485e03a2806306d02", + "@angular/compiler-cli": "github:angular/compiler-cli-builds#99aa837d074b5df5466c6a76944b16aa31a33c60", + "@angular/core": "github:angular/core-builds#4b78e9179cf038a9a048f66f1c712ad9f6b4e7e5", + "@angular/forms": "github:angular/forms-builds#14077d439487371d2ee039889c72a6d13e844904", + "@angular/language-service": "github:angular/language-service-builds#aa2b9c8a75568f0b0dceb5800b99357748f28b9d", + "@angular/localize": "github:angular/localize-builds#f70cde306a76a7daf3a62de9f49758d2808c5e5f", + "@angular/material": "github:angular/material-builds#840350f46870961a08fcb1fe57e40fc86736500d", + "@angular/material-moment-adapter": "github:angular/material-moment-adapter-builds#b09397a47bcee75bc4eceef65c020766b36fcf84", + "@angular/platform-browser": "github:angular/platform-browser-builds#e86b6bb35146314d95a2214f38060c316e18ecba", + "@angular/platform-browser-dynamic": "github:angular/platform-browser-dynamic-builds#a58a2962991687a2f864cdded606fd1c9255cd68", + "@angular/platform-server": "github:angular/platform-server-builds#409025011ce3cdaa470cfe0c7b65fc235618d0ab", + "@angular/router": "github:angular/router-builds#471200021e5f6531ec8cb6d5eac305255f5b2815", + "@angular/service-worker": "github:angular/service-worker-builds#526c2da8854c1e18a25bf4b439182337e914101f" } } diff --git a/yarn.lock b/yarn.lock index 06dad9458d42..33c322fd6b75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -127,10 +127,10 @@ "@angular/core" "^13.0.0 || ^14.0.0-0" reflect-metadata "^0.1.13" -"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#a9bafebdb359b24c28e09010c5e6ec3fc8f64032": - version "0.0.0-55daf7df431dd8a4c38628df746e9d7658e58a1f" - uid a9bafebdb359b24c28e09010c5e6ec3fc8f64032 - resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a9bafebdb359b24c28e09010c5e6ec3fc8f64032" +"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#08f0188fccf98139207fbd5e683533950e9068e2": + version "0.0.0-b158ee64c37844b5bc8fed167815f6f0e99c3ae7" + uid "08f0188fccf98139207fbd5e683533950e9068e2" + resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#08f0188fccf98139207fbd5e683533950e9068e2" dependencies: "@angular-devkit/build-angular" "14.2.0-next.0" "@angular/benchpress" "0.3.0" @@ -241,10 +241,10 @@ dependencies: tslib "^2.3.0" -"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#b3fa973d98f1eee8969c4dd50fe7e7e93b6568c9": - version "0.0.0-55daf7df431dd8a4c38628df746e9d7658e58a1f" - uid b3fa973d98f1eee8969c4dd50fe7e7e93b6568c9 - resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#b3fa973d98f1eee8969c4dd50fe7e7e93b6568c9" +"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#a9d380df54092930c4eabbab114c29ac125759f4": + version "0.0.0-b158ee64c37844b5bc8fed167815f6f0e99c3ae7" + uid a9d380df54092930c4eabbab114c29ac125759f4 + resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#a9d380df54092930c4eabbab114c29ac125759f4" dependencies: "@yarnpkg/lockfile" "^1.1.0" typescript "~4.7.3"
48e6060e02792cd614a1f80ae8b87109df88c893
2019-05-14 04:27:54
Charles Lyding
fix(@angular-devkit/schematics): use rxjs version of isObservable
false
use rxjs version of isObservable
fix
diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts index 08705de9406e..5c823fa3ec3d 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts @@ -10,7 +10,6 @@ import { InvalidJsonCharacterException, JsonObject, UnexpectedEndOfInputException, - isObservable, isPromise, normalize, virtualFs, @@ -21,6 +20,7 @@ import { dirname, isAbsolute, join, resolve } from 'path'; import { Observable, from as observableFrom, + isObservable, of as observableOf, throwError, } from 'rxjs';
ee7f96232632c8982501b47831ad34422b6167ea
2025-03-20 03:16:54
Charles Lyding
release: cut the v20.0.0-next.2 release
false
cut the v20.0.0-next.2 release
release
diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e491ec7cbd..c468ff28e932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,44 @@ +<a name="20.0.0-next.2"></a> + +# 20.0.0-next.2 (2025-03-19) + +## Breaking Changes + +### @schematics/angular + +- `--server-routing` option has been removed from several schematics. Server routing will be used when using the application builder. + +### @schematics/angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------------------------------- | +| [26fd4ea73](https://github.com/angular/angular-cli/commit/26fd4ea73ad2a0148ae587d582134c68a0bf4b86) | feat | add migrations for server rendering updates | +| [18e13e2ce](https://github.com/angular/angular-cli/commit/18e13e2ceed931d29aa5582980c7d6d1f66c9787) | feat | remove `--server-routing` option | +| [86d241629](https://github.com/angular/angular-cli/commit/86d241629ff51f0bb5988e81cac8658b01704d49) | fix | add `@angular/ssr` dependency only when `provideServerRendering` import has been updated | +| [da6ef626f](https://github.com/angular/angular-cli/commit/da6ef626f960b187a7862f0caa3d8aed38224ac2) | fix | ensure app-shell schematic consistently uses `withAppShell` | +| [f126f8d34](https://github.com/angular/angular-cli/commit/f126f8d34b087dd3a916dfb93cd255aac4d6c309) | fix | ensure module discovery checks for an NgModule decorator | +| [23fc8e1e1](https://github.com/angular/angular-cli/commit/23fc8e1e176f23442876b086bff52dd5f35abbc0) | fix | generate components without a `.component` extension/type | +| [8d715fa94](https://github.com/angular/angular-cli/commit/8d715fa948d432b18d06bcf42eed3a7681383523) | fix | generate directives without a .directive extension/type | +| [bc0f07b48](https://github.com/angular/angular-cli/commit/bc0f07b484300848ee81c5719c58909b40f99deb) | fix | generate services without a .service extension/type | +| [c0de72317](https://github.com/angular/angular-cli/commit/c0de723173549f62a524b6e6c58c6d80c8054581) | fix | replace `@angular/platform-browser-dynamic` with `@angular/platform-browser` | + +### @angular/build + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------- | +| [f4be83119](https://github.com/angular/angular-cli/commit/f4be831197010a17394264bc74b1eb385ba95028) | feat | Support Sass package importers | +| [cb2ab43ab](https://github.com/angular/angular-cli/commit/cb2ab43abcf0e3c1a2cc584a326e1eea5eede7a8) | fix | ensure errors for missing component resources | +| [f780e8beb](https://github.com/angular/angular-cli/commit/f780e8beb3ccea27ef0442d1d3814ec2a668057d) | fix | ensure relative karma stack traces for test failures | + +### @angular/ssr + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------- | +| [33b9de3eb](https://github.com/angular/angular-cli/commit/33b9de3eb1fa596a4d5a975d05275739f2f7b8ae) | feat | expose `provideServerRendering` and remove `provideServerRouting` | +| [cdfc50c29](https://github.com/angular/angular-cli/commit/cdfc50c29a2aa6f32d172b505a0ef09e563dfc59) | feat | stabilize `AngularNodeAppEngine`, `AngularAppEngine`, and `provideServerRouting` APIs | + +<!-- CHANGELOG SPLIT MARKER --> + <a name="19.2.4"></a> # 19.2.4 (2025-03-19) diff --git a/package.json b/package.json index b550ca0638f7..1e3605d3082b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/devkit-repo", - "version": "20.0.0-next.1", + "version": "20.0.0-next.2", "private": true, "description": "Software Development Kit for Angular", "keywords": [
f08cb649efe775f4acd7861c04ddd9365aabc342
2016-05-02 06:01:14
Hans
fix: add new line. (#588)
false
add new line. (#588)
fix
diff --git a/addon/ng2/blueprints/component/files/__path__/index.ts b/addon/ng2/blueprints/component/files/__path__/index.ts index 38c9dbf59603..40f21b7c040c 100644 --- a/addon/ng2/blueprints/component/files/__path__/index.ts +++ b/addon/ng2/blueprints/component/files/__path__/index.ts @@ -1 +1,2 @@ -export {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component'; \ No newline at end of file +export {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component'; +
5852f39c02a5b4a17dc8b126caa194e235d6e15b
2018-10-05 02:03:24
Filipe Silva
feat(@ngtools/webpack): support custom logging
false
support custom logging
feat
diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index 011fad1684f3..c25ff7563b28 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -5,7 +5,16 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import { Path, dirname, getSystemPath, normalize, resolve, virtualFs } from '@angular-devkit/core'; +import { + Path, + dirname, + getSystemPath, + logging, + normalize, + resolve, + virtualFs, +} from '@angular-devkit/core'; +import { createConsoleLogger } from '@angular-devkit/core/node'; import { CompilerHost, CompilerOptions, @@ -45,7 +54,15 @@ import { replaceServerBootstrap, } from './transformers'; import { collectDeepNodes } from './transformers/ast_helpers'; -import { AUTO_START_ARG, InitMessage, UpdateMessage } from './type_checker'; +import { + AUTO_START_ARG, +} from './type_checker'; +import { + InitMessage, + LogMessage, + MESSAGE_KIND, + UpdateMessage, +} from './type_checker_messages'; import { VirtualFileSystemDecorator, VirtualWatchFileSystemDecorator, @@ -59,7 +76,7 @@ import { WebpackInputHost } from './webpack-input-host'; const treeKill = require('tree-kill'); -export interface ContextElementDependency {} +export interface ContextElementDependency { } export interface ContextElementDependencyConstructor { new(modulePath: string, name: string): ContextElementDependency; @@ -85,6 +102,7 @@ export interface AngularCompilerPluginOptions { missingTranslation?: string; platform?: PLATFORM; nameLazyFiles?: boolean; + logger?: logging.Logger; // added to the list of lazy routes additionalLazyModules?: { [module: string]: string }; @@ -141,6 +159,9 @@ export class AngularCompilerPlugin { private _typeCheckerProcess: ChildProcess | null; private _forkedTypeCheckerInitialized = false; + // Logging. + private _logger: logging.Logger; + private get _ngCompilerSupportsNewApi() { if (this._JitMode) { return false; @@ -179,6 +200,8 @@ export class AngularCompilerPlugin { private _setupOptions(options: AngularCompilerPluginOptions) { time('AngularCompilerPlugin._setupOptions'); + this._logger = options.logger || createConsoleLogger(); + // Fill in the missing options. if (!options.hasOwnProperty('tsConfigPath')) { throw new Error('Must specify "tsConfigPath" in the configuration of @ngtools/webpack.'); @@ -415,7 +438,7 @@ export class AngularCompilerPlugin { }), // TODO: fix compiler-cli typings; entryModule should not be string, but also optional. // tslint:disable-next-line:no-non-null-assertion - entryModule: this._entryModule !, + entryModule: this._entryModule!, }); timeEnd('AngularCompilerPlugin._getLazyRoutesFromNgtools'); @@ -542,6 +565,18 @@ export class AngularCompilerPlugin { forkArgs, forkOptions); + // Handle child messages. + this._typeCheckerProcess.on('message', message => { + switch (message.kind) { + case MESSAGE_KIND.Log: + const logMessage = message as LogMessage; + this._logger.log(logMessage.level, logMessage.message); + break; + default: + throw new Error(`TypeChecker: Unexpected message received: ${message}.`); + } + }); + // Handle child process exit. this._typeCheckerProcess.once('exit', (_, signal) => { this._typeCheckerProcess = null; @@ -748,10 +783,10 @@ export class AngularCompilerPlugin { const name = request.request; const issuer = request.contextInfo.issuer; if (name.endsWith('.ts') || name.endsWith('.tsx') - || (issuer && /\.ts|ngfactory\.js$/.test(issuer))) { + || (issuer && /\.ts|ngfactory\.js$/.test(issuer))) { try { await this.done; - } catch {} + } catch { } } } diff --git a/packages/ngtools/webpack/src/type_checker.ts b/packages/ngtools/webpack/src/type_checker.ts index 7e134c9d3b81..57f18222b84c 100644 --- a/packages/ngtools/webpack/src/type_checker.ts +++ b/packages/ngtools/webpack/src/type_checker.ts @@ -5,7 +5,6 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import { terminal } from '@angular-devkit/core'; import { NodeJsSyncHost } from '@angular-devkit/core/node'; import { CompilerHost, @@ -19,37 +18,10 @@ import * as ts from 'typescript'; import { time, timeEnd } from './benchmark'; import { WebpackCompilerHost } from './compiler_host'; import { CancellationToken, gatherDiagnostics } from './gather_diagnostics'; +import { LogMessage, TypeCheckerMessage } from './type_checker_messages'; // This file should run in a child process with the AUTO_START_ARG argument - - -export enum MESSAGE_KIND { - Init, - Update, -} - -export abstract class TypeCheckerMessage { - constructor(public kind: MESSAGE_KIND) { } -} - -export class InitMessage extends TypeCheckerMessage { - constructor( - public compilerOptions: ts.CompilerOptions, - public basePath: string, - public jitMode: boolean, - public rootNames: string[], - ) { - super(MESSAGE_KIND.Init); - } -} - -export class UpdateMessage extends TypeCheckerMessage { - constructor(public rootNames: string[], public changedCompilationFiles: string[]) { - super(MESSAGE_KIND.Update); - } -} - export const AUTO_START_ARG = '9d93e901-158a-4cf9-ba1b-2f0582ffcfeb'; export class TypeChecker { @@ -124,7 +96,7 @@ export class TypeChecker { if (errors.length > 0) { const message = formatDiagnostics(errors); - console.error(terminal.bold(terminal.red('ERROR in ' + message))); + this.sendMessage(new LogMessage('error', 'ERROR in ' + message)); } else { // Reset the changed file tracker only if there are no errors. this._compilerHost.resetChangedFileTracker(); @@ -132,11 +104,17 @@ export class TypeChecker { if (warnings.length > 0) { const message = formatDiagnostics(warnings); - console.error(terminal.bold(terminal.yellow('WARNING in ' + message))); + this.sendMessage(new LogMessage('warn', 'WARNING in ' + message)); } } } + private sendMessage(msg: TypeCheckerMessage) { + if (process.send) { + process.send(msg); + } + } + public update(rootNames: string[], changedCompilationFiles: string[], cancellationToken: CancellationToken) { this._update(rootNames, changedCompilationFiles); diff --git a/packages/ngtools/webpack/src/type_checker_messages.ts b/packages/ngtools/webpack/src/type_checker_messages.ts new file mode 100644 index 000000000000..4fc0a65c9ba7 --- /dev/null +++ b/packages/ngtools/webpack/src/type_checker_messages.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { logging } from '@angular-devkit/core'; +import * as ts from 'typescript'; + + +export enum MESSAGE_KIND { + Init, + Update, + Log, +} + +export abstract class TypeCheckerMessage { + constructor(public kind: MESSAGE_KIND) { } +} + +export class InitMessage extends TypeCheckerMessage { + constructor( + public compilerOptions: ts.CompilerOptions, + public basePath: string, + public jitMode: boolean, + public rootNames: string[], + public hostReplacementPaths: { [path: string]: string }, + ) { + super(MESSAGE_KIND.Init); + } +} + +export class UpdateMessage extends TypeCheckerMessage { + constructor(public rootNames: string[], public changedCompilationFiles: string[]) { + super(MESSAGE_KIND.Update); + } +} + +export class LogMessage extends TypeCheckerMessage { + constructor(public level: logging.LogLevel, public message: string) { + super(MESSAGE_KIND.Log); + } +} + diff --git a/packages/ngtools/webpack/src/type_checker_worker.ts b/packages/ngtools/webpack/src/type_checker_worker.ts index 777477292357..5cbab0379de6 100644 --- a/packages/ngtools/webpack/src/type_checker_worker.ts +++ b/packages/ngtools/webpack/src/type_checker_worker.ts @@ -10,12 +10,14 @@ import { time, timeEnd } from './benchmark'; import { CancellationToken } from './gather_diagnostics'; import { AUTO_START_ARG, + TypeChecker, +} from './type_checker'; +import { InitMessage, MESSAGE_KIND, - TypeChecker, TypeCheckerMessage, UpdateMessage, -} from './type_checker'; +} from './type_checker_messages'; let typeChecker: TypeChecker; let lastCancellationToken: CancellationToken;