From 2bed482323cda8d081d87084e9bf38aa335c2725 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 16 Mar 2022 19:25:26 +0000 Subject: [PATCH] Bump version to 4.6.3 and LKG --- lib/lib.es2022.object.d.ts | 2 +- lib/tsc.js | 6 ++--- lib/tsserver.js | 49 ++++++++++++++++++++++++++++---------- lib/tsserverlibrary.js | 49 ++++++++++++++++++++++++++++---------- lib/typescript.js | 49 ++++++++++++++++++++++++++++---------- lib/typescriptServices.js | 49 ++++++++++++++++++++++++++++---------- lib/typingsInstaller.js | 14 ++--------- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 9 files changed, 155 insertions(+), 67 deletions(-) diff --git a/lib/lib.es2022.object.d.ts b/lib/lib.es2022.object.d.ts index 63460100667e4..2fe2a1917f15e 100644 --- a/lib/lib.es2022.object.d.ts +++ b/lib/lib.es2022.object.d.ts @@ -18,7 +18,7 @@ and limitations under the License. /// -interface Object { +interface ObjectConstructor { /** * Determines whether an object has a property with the specified name. * @param o An object. diff --git a/lib/tsc.js b/lib/tsc.js index 7704b1a2be538..15018eb19297b 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.6"; - ts.version = "4.6.2"; + ts.version = "4.6.3"; var NativeCollections; (function (NativeCollections) { var globals = typeof globalThis !== "undefined" ? globalThis : @@ -25262,9 +25262,7 @@ var ts; return; } if (initializer) { - if (token() === 18) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26)); return; } parseErrorForMissingSemicolonAfter(name); diff --git a/lib/tsserver.js b/lib/tsserver.js index ff74f351d1bd6..5b89bb70fc48a 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -100,7 +100,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.6.2"; + ts.version = "4.6.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -31354,18 +31354,8 @@ var ts; if (tryParseSemicolon()) { return; } - // If an initializer was parsed but there is still an error in finding the next semicolon, - // we generally know there was an error already reported in the initializer... - // class Example { a = new Map([), ) } - // ~ if (initializer) { - // ...unless we've found the start of a block after a property declaration, in which - // case we can know that regardless of the initializer we should complain on the block. - // class Example { a = 0 {} } - // ~ - if (token() === 18 /* OpenBraceToken */) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); return; } parseErrorForMissingSemicolonAfter(name); @@ -140014,6 +140004,41 @@ var ts; if (ts.scanner.getToken() === 1 /* EndOfFileToken */) { break; } + if (ts.scanner.getToken() === 15 /* TemplateHead */) { + var stack = [ts.scanner.getToken()]; + var token = ts.scanner.scan(); + loop: while (ts.length(stack)) { + switch (token) { + case 1 /* EndOfFileToken */: + break loop; + case 100 /* ImportKeyword */: + tryConsumeImport(); + break; + case 15 /* TemplateHead */: + stack.push(token); + break; + case 18 /* OpenBraceToken */: + if (ts.length(stack)) { + stack.push(token); + } + break; + case 19 /* CloseBraceToken */: + if (ts.length(stack)) { + if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) { + if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) { + stack.pop(); + } + } + else { + stack.pop(); + } + } + break; + } + token = ts.scanner.scan(); + } + nextToken(); + } // check if at least one of alternative have moved scanner forward if (tryConsumeDeclare() || tryConsumeImport() || diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 9290a3661080e..3da500f878173 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.6.2"; + ts.version = "4.6.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -31548,18 +31548,8 @@ var ts; if (tryParseSemicolon()) { return; } - // If an initializer was parsed but there is still an error in finding the next semicolon, - // we generally know there was an error already reported in the initializer... - // class Example { a = new Map([), ) } - // ~ if (initializer) { - // ...unless we've found the start of a block after a property declaration, in which - // case we can know that regardless of the initializer we should complain on the block. - // class Example { a = 0 {} } - // ~ - if (token() === 18 /* OpenBraceToken */) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); return; } parseErrorForMissingSemicolonAfter(name); @@ -140625,6 +140615,41 @@ var ts; if (ts.scanner.getToken() === 1 /* EndOfFileToken */) { break; } + if (ts.scanner.getToken() === 15 /* TemplateHead */) { + var stack = [ts.scanner.getToken()]; + var token = ts.scanner.scan(); + loop: while (ts.length(stack)) { + switch (token) { + case 1 /* EndOfFileToken */: + break loop; + case 100 /* ImportKeyword */: + tryConsumeImport(); + break; + case 15 /* TemplateHead */: + stack.push(token); + break; + case 18 /* OpenBraceToken */: + if (ts.length(stack)) { + stack.push(token); + } + break; + case 19 /* CloseBraceToken */: + if (ts.length(stack)) { + if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) { + if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) { + stack.pop(); + } + } + else { + stack.pop(); + } + } + break; + } + token = ts.scanner.scan(); + } + nextToken(); + } // check if at least one of alternative have moved scanner forward if (tryConsumeDeclare() || tryConsumeImport() || diff --git a/lib/typescript.js b/lib/typescript.js index 89cc0ba3ffb18..a852c867159d1 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.6.2"; + ts.version = "4.6.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -31548,18 +31548,8 @@ var ts; if (tryParseSemicolon()) { return; } - // If an initializer was parsed but there is still an error in finding the next semicolon, - // we generally know there was an error already reported in the initializer... - // class Example { a = new Map([), ) } - // ~ if (initializer) { - // ...unless we've found the start of a block after a property declaration, in which - // case we can know that regardless of the initializer we should complain on the block. - // class Example { a = 0 {} } - // ~ - if (token() === 18 /* OpenBraceToken */) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); return; } parseErrorForMissingSemicolonAfter(name); @@ -140625,6 +140615,41 @@ var ts; if (ts.scanner.getToken() === 1 /* EndOfFileToken */) { break; } + if (ts.scanner.getToken() === 15 /* TemplateHead */) { + var stack = [ts.scanner.getToken()]; + var token = ts.scanner.scan(); + loop: while (ts.length(stack)) { + switch (token) { + case 1 /* EndOfFileToken */: + break loop; + case 100 /* ImportKeyword */: + tryConsumeImport(); + break; + case 15 /* TemplateHead */: + stack.push(token); + break; + case 18 /* OpenBraceToken */: + if (ts.length(stack)) { + stack.push(token); + } + break; + case 19 /* CloseBraceToken */: + if (ts.length(stack)) { + if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) { + if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) { + stack.pop(); + } + } + else { + stack.pop(); + } + } + break; + } + token = ts.scanner.scan(); + } + nextToken(); + } // check if at least one of alternative have moved scanner forward if (tryConsumeDeclare() || tryConsumeImport() || diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index d1d97fe03d60c..bff3d39041a05 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -294,7 +294,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.6.2"; + ts.version = "4.6.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -31548,18 +31548,8 @@ var ts; if (tryParseSemicolon()) { return; } - // If an initializer was parsed but there is still an error in finding the next semicolon, - // we generally know there was an error already reported in the initializer... - // class Example { a = new Map([), ) } - // ~ if (initializer) { - // ...unless we've found the start of a block after a property declaration, in which - // case we can know that regardless of the initializer we should complain on the block. - // class Example { a = 0 {} } - // ~ - if (token() === 18 /* OpenBraceToken */) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); return; } parseErrorForMissingSemicolonAfter(name); @@ -140625,6 +140615,41 @@ var ts; if (ts.scanner.getToken() === 1 /* EndOfFileToken */) { break; } + if (ts.scanner.getToken() === 15 /* TemplateHead */) { + var stack = [ts.scanner.getToken()]; + var token = ts.scanner.scan(); + loop: while (ts.length(stack)) { + switch (token) { + case 1 /* EndOfFileToken */: + break loop; + case 100 /* ImportKeyword */: + tryConsumeImport(); + break; + case 15 /* TemplateHead */: + stack.push(token); + break; + case 18 /* OpenBraceToken */: + if (ts.length(stack)) { + stack.push(token); + } + break; + case 19 /* CloseBraceToken */: + if (ts.length(stack)) { + if (ts.lastOrUndefined(stack) === 15 /* TemplateHead */) { + if (ts.scanner.reScanTemplateToken(/* isTaggedTemplate */ false) === 17 /* TemplateTail */) { + stack.pop(); + } + } + else { + stack.pop(); + } + } + break; + } + token = ts.scanner.scan(); + } + nextToken(); + } // check if at least one of alternative have moved scanner forward if (tryConsumeDeclare() || tryConsumeImport() || diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 67aa6f7336aa4..3db755cbfc790 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -89,7 +89,7 @@ var ts; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - ts.version = "4.6.2"; + ts.version = "4.6.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -31343,18 +31343,8 @@ var ts; if (tryParseSemicolon()) { return; } - // If an initializer was parsed but there is still an error in finding the next semicolon, - // we generally know there was an error already reported in the initializer... - // class Example { a = new Map([), ) } - // ~ if (initializer) { - // ...unless we've found the start of a block after a property declaration, in which - // case we can know that regardless of the initializer we should complain on the block. - // class Example { a = 0 {} } - // ~ - if (token() === 18 /* OpenBraceToken */) { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); - } + parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26 /* SemicolonToken */)); return; } parseErrorForMissingSemicolonAfter(name); diff --git a/package.json b/package.json index 709da71b59b40..39326e0ed22b3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.6.2", + "version": "4.6.3", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 2e0d8a0eeff28..8f47cfd4f1dd2 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -5,7 +5,7 @@ namespace ts { // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ // eslint-disable-next-line @typescript-eslint/no-inferrable-types - export const version = "4.6.2" as string; + export const version = "4.6.3" as string; /** * Type of objects whose values are all of the same type.