From a08d08e42a26ff2586ed0726e8f9f68bb4add984 Mon Sep 17 00:00:00 2001 From: gasolin Date: Sat, 23 Feb 2019 20:37:25 +0800 Subject: [PATCH] update to typescript 3.3.3333 --- src/cn/package.json | 2 +- src/common/compiler/binder.ts.diff | 4 ++-- src/common/compiler/checker.ts.diff | 4 ++-- src/patched/compiler/binder.ts | 8 ++++++-- src/patched/compiler/checker.ts | 17 ++++++++++++++++- src/patched/compiler/types.ts | 2 +- src/tw/package.json | 2 +- typescript | 2 +- 8 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/cn/package.json b/src/cn/package.json index 5dc069d..3cceb67 100644 --- a/src/cn/package.json +++ b/src/cn/package.json @@ -2,7 +2,7 @@ "name": "lingascript-cn", "author": "Fred Lin", "homepage": "https://github.com/gasolin/lingascript", - "version": "0.2.0", + "version": "0.3.0", "license": "Apache-2.0", "description": "LingaScript is TypeScript that support Simplified Chinese keywords", "keywords": [ diff --git a/src/common/compiler/binder.ts.diff b/src/common/compiler/binder.ts.diff index d543236..8288b20 100644 --- a/src/common/compiler/binder.ts.diff +++ b/src/common/compiler/binder.ts.diff @@ -1,8 +1,8 @@ -@@ -99118,16 +99118,134 @@ +@@ -99386,16 +99386,134 @@ guments%22 + %7C%7C%0D%0A node.escapedText === unicodeDic.Function.eval %7C%7C node.escapedText === unicodeDic.Function.arguments );%0D%0A -@@ -110481,16 +110481,141 @@ +@@ -110749,16 +110749,141 @@ strict'%22 + %7C%7C%0D%0A nodeText === %60%22$%7BunicodeDic.JavaScript.use_strict%7D%22%60 %7C%7C nodeText === %60'$%7BunicodeDic.JavaScript.use_strict%7D'%60 ;%0D%0A diff --git a/src/common/compiler/checker.ts.diff b/src/common/compiler/checker.ts.diff index a1e4d0f..9aafbd7 100644 --- a/src/common/compiler/checker.ts.diff +++ b/src/common/compiler/checker.ts.diff @@ -229,12 +229,12 @@ lue%22 as __String +) %7C%7C getTypeOfPropertyOfType(nextResult, unicodeDic.Iterator.value as __String) );%0D%0A -@@ -1826736,16 +1826736,62 @@ +@@ -1827560,16 +1827560,62 @@ %22target%22 - + && escapedText !== unicodeDic.MetaData.target ) %7B%0D%0A -@@ -1827136,16 +1827136,60 @@ +@@ -1827960,16 +1827960,60 @@ = %22meta%22 - + && escapedText !== unicodeDic.MetaData.meta diff --git a/src/patched/compiler/binder.ts b/src/patched/compiler/binder.ts index b7562e4..f194218 100644 --- a/src/patched/compiler/binder.ts +++ b/src/patched/compiler/binder.ts @@ -1120,11 +1120,15 @@ namespace ts { // We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block // (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will // have the end of the `try` block and the end of the `catch` block) + let preFinallyPrior = preTryFlow; if (!node.catchClause) { if (tryPriors.length) { + const preFinallyFlow = createBranchLabel(); + addAntecedent(preFinallyFlow, preTryFlow); for (const p of tryPriors) { - addAntecedent(preFinallyLabel, p); + addAntecedent(preFinallyFlow, p); } + preFinallyPrior = finishFlowLabel(preFinallyFlow); } } @@ -1156,7 +1160,7 @@ namespace ts { // // extra edges that we inject allows to control this behavior // if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped. - const preFinallyFlow: PreFinallyFlow = { flags: FlowFlags.PreFinally, antecedent: preTryFlow, lock: {} }; + const preFinallyFlow: PreFinallyFlow = { flags: FlowFlags.PreFinally, antecedent: preFinallyPrior, lock: {} }; addAntecedent(preFinallyLabel, preFinallyFlow); currentFlow = finishFlowLabel(preFinallyLabel); diff --git a/src/patched/compiler/checker.ts b/src/patched/compiler/checker.ts index 5fda62f..12b3d23 100644 --- a/src/patched/compiler/checker.ts +++ b/src/patched/compiler/checker.ts @@ -29496,9 +29496,12 @@ namespace ts { return; } const file = host.getSourceFile(resolvedDirective.resolvedFileName)!; - fileToDirective.set(file.path, key); + // Add the transitive closure of path references loaded by this file (as long as they are not) + // part of an existing type reference. + addReferencedFilesToTypeDirective(file, key); }); } + return { getReferencedExportContainer, getReferencedImportDeclaration, @@ -29657,6 +29660,18 @@ namespace ts { } return false; } + + function addReferencedFilesToTypeDirective(file: SourceFile, key: string) { + if (fileToDirective.has(file.path)) return; + fileToDirective.set(file.path, key); + for (const { fileName } of file.referencedFiles) { + const resolvedFile = resolveTripleslashReference(fileName, file.originalFileName); + const referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key); + } + } + } } function getExternalModuleFileFromDeclaration(declaration: AnyImportOrReExport | ModuleDeclaration | ImportTypeNode): SourceFile | undefined { diff --git a/src/patched/compiler/types.ts b/src/patched/compiler/types.ts index 859d200..03cbe82 100644 --- a/src/patched/compiler/types.ts +++ b/src/patched/compiler/types.ts @@ -5862,7 +5862,7 @@ namespace ts { export interface UserPreferences { readonly disableSuggestions?: boolean; - readonly quotePreference?: "double" | "single"; + readonly quotePreference?: "auto" | "double" | "single"; readonly includeCompletionsForModuleExports?: boolean; readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; diff --git a/src/tw/package.json b/src/tw/package.json index e51ae92..ef25e49 100644 --- a/src/tw/package.json +++ b/src/tw/package.json @@ -2,7 +2,7 @@ "name": "lingascript-tw", "author": "Fred Lin", "homepage": "https://github.com/gasolin/lingascript", - "version": "0.2.0", + "version": "0.3.0", "license": "Apache-2.0", "description": "LingaScript is TypeScript that support Traditional Chinese keywords", "keywords": [ diff --git a/typescript b/typescript index 76c94c5..b145eaf 160000 --- a/typescript +++ b/typescript @@ -1 +1 @@ -Subproject commit 76c94c5c1e16bf4f59069f5c9cb3cf4d71c78475 +Subproject commit b145eaf160e6b2729aaacb89856bc2346f85ac4c