From 7753eae1d0dbcc1a4b3ca294ff5a79b93af1a149 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Sat, 23 Jul 2022 19:57:37 -0700 Subject: [PATCH] Bump target up to ES2015 --- scripts/importDefinitelyTypedTests/tsconfig.json | 4 ++-- src/compiler/checker.ts | 6 +++--- src/instrumenter/tsconfig.json | 4 ++-- src/services/services.ts | 3 ++- src/tsconfig-base.json | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/importDefinitelyTypedTests/tsconfig.json b/scripts/importDefinitelyTypedTests/tsconfig.json index 30d589c119949..ce43993e84a08 100644 --- a/scripts/importDefinitelyTypedTests/tsconfig.json +++ b/scripts/importDefinitelyTypedTests/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES5", + "target": "ES2015", "outDir": "./", "rootDir": ".", "newLine": "lf", @@ -15,4 +15,4 @@ ], "exclude": [ ] -} \ No newline at end of file +} diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index abf3e9d9fe0e7..362c5897a48b4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27009,10 +27009,10 @@ namespace ts { case AssignmentDeclarationKind.ExportsProperty: case AssignmentDeclarationKind.Prototype: case AssignmentDeclarationKind.PrototypeProperty: - let valueDeclaration = binaryExpression.left.symbol?.valueDeclaration; - // falls through case AssignmentDeclarationKind.ModuleExports: - valueDeclaration ||= binaryExpression.symbol?.valueDeclaration; + const valueDeclaration = kind !== AssignmentDeclarationKind.ModuleExports + ? binaryExpression.left.symbol?.valueDeclaration + : binaryExpression.symbol?.valueDeclaration; const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration); return annotated ? getTypeFromTypeNode(annotated) : undefined; case AssignmentDeclarationKind.ObjectDefinePropertyValue: diff --git a/src/instrumenter/tsconfig.json b/src/instrumenter/tsconfig.json index 2f5b33f9e7f50..34b098f84d986 100644 --- a/src/instrumenter/tsconfig.json +++ b/src/instrumenter/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", + "target": "ES2015", "lib": [ "es6", "dom", @@ -13,4 +13,4 @@ "files": [ "instrumenter.ts" ] -} \ No newline at end of file +} diff --git a/src/services/services.ts b/src/services/services.ts index 8aab057808ba2..c5dcf03379bca 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1363,6 +1363,8 @@ namespace ts { onUnRecoverableConfigFileDiagnostic: noop, }; + const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); + // If the program is already up-to-date, we can reuse it if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), fileName => compilerHost!.fileExists(fileName), hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { return; @@ -1374,7 +1376,6 @@ namespace ts { // the program points to old source files that have been invalidated because of // incremental parsing. - const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); const options: CreateProgramOptions = { rootNames: rootFileNames, options: newSettings, diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index 51cf414728dc0..f912327eeb1bc 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -2,7 +2,7 @@ "compilerOptions": { "pretty": true, "lib": ["es2015.iterable", "es2015.generator", "es5"], - "target": "es5", + "target": "ES2015", "moduleResolution": "node", "rootDir": ".",