diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/package.json b/aio/aio-builds-setup/dockerbuild/scripts-js/package.json index 1f42dbc4eb..f9a7a54bd4 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-js/package.json +++ b/aio/aio-builds-setup/dockerbuild/scripts-js/package.json @@ -49,6 +49,6 @@ "supertest": "^4.0.2", "tslint": "^6.1.3", "tslint-jasmine-noSkipOrFocus": "^1.0.9", - "typescript": "^4.0.2" + "typescript": "^4.1.2" } } diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/yarn.lock b/aio/aio-builds-setup/dockerbuild/scripts-js/yarn.lock index 01b93fcb31..f148e6b9a3 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-js/yarn.lock +++ b/aio/aio-builds-setup/dockerbuild/scripts-js/yarn.lock @@ -2563,10 +2563,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2" - integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== +typescript@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" + integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== undefsafe@^2.0.2: version "2.0.2" diff --git a/aio/src/app/custom-elements/elements-loader.spec.ts b/aio/src/app/custom-elements/elements-loader.spec.ts index 48c188df1b..bdc0e5cc20 100644 --- a/aio/src/app/custom-elements/elements-loader.spec.ts +++ b/aio/src/app/custom-elements/elements-loader.spec.ts @@ -304,6 +304,6 @@ class FakeModuleFactory extends NgModuleFactory { function returnPromisesFromSpy(spy: jasmine.Spy): Deferred[] { const deferreds: Deferred[] = []; - spy.and.callFake(() => new Promise((resolve, reject) => deferreds.push({resolve, reject}))); + spy.and.callFake(() => new Promise((resolve, reject) => deferreds.push({resolve, reject}))); return deferreds; } diff --git a/aio/yarn.lock b/aio/yarn.lock index b95cd148f7..4c64e7f868 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -13658,7 +13658,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.0.5: +typescript@4.0.5, typescript@~4.0.2: version "4.0.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== @@ -13668,11 +13668,6 @@ typescript@^3.2.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== -typescript@~4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" - integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== - ua-parser-js@0.7.21: version "0.7.21" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" diff --git a/dev-infra/caretaker/check/base.ts b/dev-infra/caretaker/check/base.ts index 338688a4c4..746c15cead 100644 --- a/dev-infra/caretaker/check/base.ts +++ b/dev-infra/caretaker/check/base.ts @@ -18,8 +18,8 @@ export abstract class BaseModule { protected git: GitClient, protected config: NgDevConfig<{caretaker: CaretakerConfig}>) {} /** Asyncronously retrieve data for the module. */ - protected abstract async retrieveData(): Promise; + protected abstract retrieveData(): Promise; /** Print the information discovered for the module to the terminal. */ - abstract async printToTerminal(): Promise; + abstract printToTerminal(): Promise; } diff --git a/modules/benchmarks/src/expanding_rows/benchmark.ts b/modules/benchmarks/src/expanding_rows/benchmark.ts index a2ec65c8a2..d1194447e5 100644 --- a/modules/benchmarks/src/expanding_rows/benchmark.ts +++ b/modules/benchmarks/src/expanding_rows/benchmark.ts @@ -83,7 +83,7 @@ export async function execTimed(description: string, func: () => Promise) } export async function nextTick(delay = 1) { - return new Promise((res, rej) => { + return new Promise((res, rej) => { setTimeout(() => { res(); }, delay); diff --git a/package.json b/package.json index 2b30de950f..4c4fe0ef19 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "tsickle": "0.38.1", "tslib": "^2.0.0", "tslint": "6.1.3", - "typescript": "~4.0.2", + "typescript": "~4.1.2", "xhr2": "0.2.0", "yaml": "^1.10.0", "yargs": "^16.1.1" diff --git a/packages/animations/browser/src/render/transition_animation_engine.ts b/packages/animations/browser/src/render/transition_animation_engine.ts index a6e23086d5..79703bc234 100644 --- a/packages/animations/browser/src/render/transition_animation_engine.ts +++ b/packages/animations/browser/src/render/transition_animation_engine.ts @@ -810,7 +810,7 @@ export class TransitionAnimationEngine { } whenRenderingDone(): Promise { - return new Promise(resolve => { + return new Promise(resolve => { if (this.players.length) { return optimizeGroupPlayer(this.players).onDone(() => resolve()); } else { diff --git a/packages/bazel/package.json b/packages/bazel/package.json index 798b8b2c7c..aa65c45fad 100644 --- a/packages/bazel/package.json +++ b/packages/bazel/package.json @@ -28,7 +28,7 @@ "@angular/compiler-cli": "0.0.0-PLACEHOLDER", "@bazel/typescript": ">=1.0.0", "terser": "^4.3.1", - "typescript": ">=4.0 <4.1", + "typescript": ">=4.0 <4.2", "rollup": ">=1.20.0", "rollup-plugin-commonjs": ">=9.0.0", "rollup-plugin-node-resolve": ">=4.2.0", diff --git a/packages/benchpress/src/common_options.ts b/packages/benchpress/src/common_options.ts index e923714567..1186b5edea 100644 --- a/packages/benchpress/src/common_options.ts +++ b/packages/benchpress/src/common_options.ts @@ -43,7 +43,7 @@ export class Options { } function writeFile(filename: string, content: string): Promise { - return new Promise(function(resolve, reject) { + return new Promise(function(resolve, reject) { fs.writeFile(filename, content, (error) => { if (error) { reject(error); diff --git a/packages/compiler-cli/ngcc/src/host/commonjs_umd_utils.ts b/packages/compiler-cli/ngcc/src/host/commonjs_umd_utils.ts index b762eafdec..2f20337b5e 100644 --- a/packages/compiler-cli/ngcc/src/host/commonjs_umd_utils.ts +++ b/packages/compiler-cli/ngcc/src/host/commonjs_umd_utils.ts @@ -78,7 +78,7 @@ export function findNamespaceOfIdentifier(id: ts.Identifier): ts.Identifier|null export function findRequireCallReference(id: ts.Identifier, checker: ts.TypeChecker): RequireCall| null { const symbol = checker.getSymbolAtLocation(id) || null; - const declaration = symbol && symbol.valueDeclaration; + const declaration = symbol?.valueDeclaration ?? symbol?.declarations?.[0]; const initializer = declaration && ts.isVariableDeclaration(declaration) && declaration.initializer || null; return initializer && isRequireCall(initializer) ? initializer : null; diff --git a/packages/compiler-cli/package.json b/packages/compiler-cli/package.json index 076066f2df..d47c5f2da5 100644 --- a/packages/compiler-cli/package.json +++ b/packages/compiler-cli/package.json @@ -29,7 +29,7 @@ }, "peerDependencies": { "@angular/compiler": "0.0.0-PLACEHOLDER", - "typescript": ">=4.0 <4.1" + "typescript": ">=4.0 <4.2" }, "engines": { "node": ">=10.0" diff --git a/packages/compiler-cli/src/ngtsc/testing/src/utils.ts b/packages/compiler-cli/src/ngtsc/testing/src/utils.ts index 7fe09b6686..13fe87a560 100644 --- a/packages/compiler-cli/src/ngtsc/testing/src/utils.ts +++ b/packages/compiler-cli/src/ngtsc/testing/src/utils.ts @@ -126,9 +126,9 @@ enum TsStructureIsReused { Completely = 2, } -export function expectCompleteReuse(oldProgram: ts.Program): void { +export function expectCompleteReuse(program: ts.Program): void { // Assert complete reuse using TypeScript's private API. - expect((oldProgram as any).structureIsReused) + expect((program as any).structureIsReused) .toBe(TsStructureIsReused.Completely, COMPLETE_REUSE_FAILURE_MESSAGE); } diff --git a/packages/compiler-cli/src/ngtsc/typecheck/test/program_spec.ts b/packages/compiler-cli/src/ngtsc/typecheck/test/program_spec.ts index 601808d55e..e1ae444dc2 100644 --- a/packages/compiler-cli/src/ngtsc/typecheck/test/program_spec.ts +++ b/packages/compiler-cli/src/ngtsc/typecheck/test/program_spec.ts @@ -44,7 +44,7 @@ runInEachFileSystem(() => { programStrategy.updateFiles( new Map([[typecheckPath, 'export const VERSION = 2;']]), UpdateMode.Complete); - expectCompleteReuse(program); + expectCompleteReuse(programStrategy.getProgram()); }); it('should have complete reuse if no structural changes are made to input files', () => { @@ -56,7 +56,7 @@ runInEachFileSystem(() => { programStrategy.updateFiles( new Map([[mainPath, 'export const STILL_NOT_A_COMPONENT = true;']]), UpdateMode.Complete); - expectCompleteReuse(program); + expectCompleteReuse(programStrategy.getProgram()); }); }); }); diff --git a/packages/compiler-cli/src/perform_watch.ts b/packages/compiler-cli/src/perform_watch.ts index 245d82eb91..7002bbe59a 100644 --- a/packages/compiler-cli/src/perform_watch.ts +++ b/packages/compiler-cli/src/perform_watch.ts @@ -127,7 +127,7 @@ export function performWatchCompilation(host: PerformWatchHost): // Watch basePath, ignoring .dotfiles let resolveReadyPromise: () => void; - const readyPromise = new Promise(resolve => resolveReadyPromise = resolve); + const readyPromise = new Promise(resolve => resolveReadyPromise = resolve); // Note: ! is ok as options are filled after the first compilation // Note: ! is ok as resolvedReadyPromise is filled by the previous call const fileWatcher = diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index b7abbfc535..f82477b43a 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -48,6 +48,17 @@ const LOWER_FIELDS = ['useValue', 'useFactory', 'data', 'id', 'loadChildren']; */ const R3_LOWER_FIELDS = [...LOWER_FIELDS, 'providers', 'imports', 'exports']; +/** + * Installs a handler for testing purposes to allow inspection of the temporary program. + */ +let tempProgramHandlerForTest: ((program: ts.Program) => void)|null = null; +export function setTempProgramHandlerForTest(handler: (program: ts.Program) => void): void { + tempProgramHandlerForTest = handler; +} +export function resetTempProgramHandlerForTest(): void { + tempProgramHandlerForTest = null; +} + const emptyModules: NgAnalyzedModules = { ngModules: [], ngModuleByPipeOrDirective: new Map(), @@ -618,6 +629,9 @@ class AngularCompilerProgram implements Program { } const tmpProgram = ts.createProgram(rootNames, this.options, this.hostAdapter, oldTsProgram); + if (tempProgramHandlerForTest !== null) { + tempProgramHandlerForTest(tmpProgram); + } const sourceFiles: string[] = []; const tsFiles: string[] = []; tmpProgram.getSourceFiles().forEach(sf => { diff --git a/packages/compiler-cli/test/ngc_spec.ts b/packages/compiler-cli/test/ngc_spec.ts index 0e35c3ee8c..0f8cd65c1a 100644 --- a/packages/compiler-cli/test/ngc_spec.ts +++ b/packages/compiler-cli/test/ngc_spec.ts @@ -1671,7 +1671,7 @@ describe('ngc transformer command-line', () => { const config = readCommandLineAndConfiguration(['-p', basePath]); const compile = watchMode(config.project, config.options, errorSpy); - return new Promise(resolve => { + return new Promise(resolve => { compile.ready(() => { cb(); diff --git a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts index def7a8bf16..2125d09409 100644 --- a/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts +++ b/packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts @@ -358,7 +358,7 @@ export declare class AnimationEvent { @Component({ selector: 'test', - template: '
', + template: '
', }) class TestCmp {} @@ -379,7 +379,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); - expect(diags[0].messageText).toEqual(`Type 'number' is not assignable to type 'string'.`); + expect(diags[0].messageText).toEqual(`Type 'boolean' is not assignable to type 'string'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -389,7 +389,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); - expect(diags[0].messageText).toEqual(`Type 'number' is not assignable to type 'string'.`); + expect(diags[0].messageText).toEqual(`Type 'boolean' is not assignable to type 'string'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -411,15 +411,15 @@ export declare class AnimationEvent { @Component({ selector: 'test', - template: '
', + template: '
', }) class TestCmp { - nullable: string | null | undefined; + nullable: boolean | null | undefined; } @Directive({selector: '[dir]'}) class TestDir { - @Input() foo: string; + @Input() foo: boolean; } @NgModule({ @@ -436,7 +436,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); expect((diags[0].messageText as ts.DiagnosticMessageChain).messageText) - .toEqual(`Type 'string | null | undefined' is not assignable to type 'string'.`); + .toEqual(`Type 'boolean | null | undefined' is not assignable to type 'boolean'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -448,7 +448,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); expect((diags[0].messageText as ts.DiagnosticMessageChain).messageText) - .toEqual(`Type 'string | null | undefined' is not assignable to type 'string'.`); + .toEqual(`Type 'boolean | null | undefined' is not assignable to type 'boolean'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -470,15 +470,15 @@ export declare class AnimationEvent { @Component({ selector: 'test', - template: '
', + template: '
', }) class TestCmp { - user?: {name: string}; + user?: {isMember: boolean}; } @Directive({selector: '[dir]'}) class TestDir { - @Input() foo: string; + @Input() foo: boolean; } @NgModule({ @@ -499,7 +499,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); expect((diags[0].messageText as ts.DiagnosticMessageChain).messageText) - .toEqual(`Type 'string | undefined' is not assignable to type 'string'.`); + .toEqual(`Type 'boolean | undefined' is not assignable to type 'boolean'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -511,7 +511,7 @@ export declare class AnimationEvent { const diags = env.driveDiagnostics(); expect(diags.length).toBe(2); expect((diags[0].messageText as ts.DiagnosticMessageChain).messageText) - .toEqual(`Type 'string | undefined' is not assignable to type 'string'.`); + .toEqual(`Type 'boolean | undefined' is not assignable to type 'boolean'.`); expect(diags[1].messageText) .toEqual(`Property 'invalid' does not exist on type 'TestCmp'.`); }); @@ -2325,7 +2325,8 @@ export declare class AnimationEvent { env.write('other.ts', `export const VERSION = 2;`); env.driveMain(); - expectCompleteReuse(firstProgram); + expectCompleteReuse(env.getTsProgram()); + expectCompleteReuse(env.getReuseTsProgram()); }); }); }); diff --git a/packages/compiler-cli/test/transformers/program_spec.ts b/packages/compiler-cli/test/transformers/program_spec.ts index 683612d723..c2f4588b17 100644 --- a/packages/compiler-cli/test/transformers/program_spec.ts +++ b/packages/compiler-cli/test/transformers/program_spec.ts @@ -13,7 +13,7 @@ import * as ts from 'typescript'; import {formatDiagnostics} from '../../src/perform_compile'; import {CompilerHost, EmitFlags, LazyRoute} from '../../src/transformers/api'; -import {createSrcToOutPathMapper} from '../../src/transformers/program'; +import {createSrcToOutPathMapper, resetTempProgramHandlerForTest, setTempProgramHandlerForTest} from '../../src/transformers/program'; import {StructureIsReused, tsStructureIsReused} from '../../src/transformers/util'; import {expectNoDiagnosticsInProgram, setup, stripAnsi, TestSupport} from '../test_support'; @@ -297,6 +297,17 @@ describe('ng program', () => { describe( 'verify that program structure is reused within tsc in order to speed up incremental compilation', () => { + afterEach(resetTempProgramHandlerForTest); + + function captureStructureReuse(compile: () => void): StructureIsReused|null { + let structureReuse: StructureIsReused|null = null; + setTempProgramHandlerForTest(program => { + structureReuse = tsStructureIsReused(program); + }); + compile(); + return structureReuse; + } + it('should reuse the old ts program completely if nothing changed', () => { testSupport.writeFiles({'src/index.ts': createModuleAndCompSource('main')}); const host = createWatchModeHost(); @@ -304,8 +315,9 @@ describe('ng program', () => { // and therefore changes the structure again const p1 = compile(undefined, undefined, undefined, host).program; const p2 = compile(p1, undefined, undefined, host).program; - compile(p2, undefined, undefined, host); - expect(tsStructureIsReused(p2.getTsProgram())).toBe(StructureIsReused.Completely); + const structureReuse = + captureStructureReuse(() => compile(p2, undefined, undefined, host)); + expect(structureReuse).toBe(StructureIsReused.Completely); }); it('should reuse the old ts program completely if a template or a ts file changed', @@ -328,8 +340,9 @@ describe('ng program', () => { 'src/main.html': `Another template`, 'src/util.ts': `export const x = 2`, }); - compile(p2, undefined, undefined, host); - expect(tsStructureIsReused(p2.getTsProgram())).toBe(StructureIsReused.Completely); + const structureReuse = + captureStructureReuse(() => compile(p2, undefined, undefined, host)); + expect(structureReuse).toBe(StructureIsReused.Completely); }); it('should not reuse the old ts program if an import changed', () => { @@ -348,8 +361,9 @@ describe('ng program', () => { const p2 = compile(p1, undefined, undefined, host).program; testSupport.writeFiles( {'src/util.ts': `import {Injectable} from '@angular/core'; export const x = 1;`}); - compile(p2, undefined, undefined, host); - expect(tsStructureIsReused(p2.getTsProgram())).toBe(StructureIsReused.SafeModules); + const structureReuse = + captureStructureReuse(() => compile(p2, undefined, undefined, host)); + expect(structureReuse).toBe(StructureIsReused.SafeModules); }); }); }); diff --git a/packages/compiler/test/expression_parser/parser_spec.ts b/packages/compiler/test/expression_parser/parser_spec.ts index 0bc5323920..52db296380 100644 --- a/packages/compiler/test/expression_parser/parser_spec.ts +++ b/packages/compiler/test/expression_parser/parser_spec.ts @@ -1048,7 +1048,7 @@ function expectParseTemplateBindingsError(attribute: string, error: string) { function _parseTemplateBindings(attribute: string, templateUrl: string) { const match = attribute.match(/^\*(.+)="(.*)"$/); expect(match).toBeTruthy(`failed to extract key and value from ${attribute}`); - const [_, key, value] = match; + const [_, key, value] = match!; const absKeyOffset = 1; // skip the * prefix const absValueOffset = attribute.indexOf('=') + '="'.length; const parser = createParser(); diff --git a/packages/platform-server/test/integration_spec.ts b/packages/platform-server/test/integration_spec.ts index 34740d10ac..11245bf6cb 100644 --- a/packages/platform-server/test/integration_spec.ts +++ b/packages/platform-server/test/integration_spec.ts @@ -53,7 +53,7 @@ function getMetaRenderHook(doc: any) { function getAsyncTitleRenderHook(doc: any) { return () => { // Async set the title as part of the render hook. - return new Promise(resolve => { + return new Promise(resolve => { setTimeout(() => { doc.title = 'AsyncRenderHook'; resolve(); @@ -64,7 +64,7 @@ function getAsyncTitleRenderHook(doc: any) { function asyncRejectRenderHook() { return () => { - return new Promise((_resolve, reject) => { + return new Promise((_resolve, reject) => { setTimeout(() => { reject('reject'); }); diff --git a/packages/upgrade/src/common/src/util.ts b/packages/upgrade/src/common/src/util.ts index 982b1365da..1c772f9bb4 100644 --- a/packages/upgrade/src/common/src/util.ts +++ b/packages/upgrade/src/common/src/util.ts @@ -97,7 +97,7 @@ export function validateInjectionKey( export class Deferred { promise: Promise; // TODO(issue/24571): remove '!'. - resolve!: (value?: R|PromiseLike) => void; + resolve!: (value: R|PromiseLike) => void; // TODO(issue/24571): remove '!'. reject!: (error?: any) => void; diff --git a/packages/upgrade/src/dynamic/src/upgrade_adapter.ts b/packages/upgrade/src/dynamic/src/upgrade_adapter.ts index 1e39bd7f9c..bbb304e494 100644 --- a/packages/upgrade/src/dynamic/src/upgrade_adapter.ts +++ b/packages/upgrade/src/dynamic/src/upgrade_adapter.ts @@ -396,7 +396,7 @@ export class UpgradeAdapter { this.ngZone.run(() => { bootstrap(element, [this.ng1Module.name], config!); }); - const ng1BootstrapPromise = new Promise((resolve) => { + const ng1BootstrapPromise = new Promise((resolve) => { if (windowAngular.resumeBootstrap) { const originalResumeBootstrap: () => void = windowAngular.resumeBootstrap; windowAngular.resumeBootstrap = function() { diff --git a/packages/zone.js/package.json b/packages/zone.js/package.json index 67f2b6e96d..960360682e 100644 --- a/packages/zone.js/package.json +++ b/packages/zone.js/package.json @@ -19,7 +19,7 @@ "mocha": "^3.1.2", "mock-require": "3.0.3", "promises-aplus-tests": "^2.1.2", - "typescript": "4.0.2" + "typescript": "4.1.2" }, "scripts": { "closuretest": "./scripts/closure/closure_compiler.sh", diff --git a/packages/zone.js/test/jasmine-patch.spec.ts b/packages/zone.js/test/jasmine-patch.spec.ts index 375f63ca1b..6091f7a50e 100644 --- a/packages/zone.js/test/jasmine-patch.spec.ts +++ b/packages/zone.js/test/jasmine-patch.spec.ts @@ -65,7 +65,7 @@ ifEnvSupports(supportJasmineSpec, () => { }); it('should wait for promise to resolve', () => { - return new Promise((res, _) => { + return new Promise((res, _) => { setTimeout(() => { log.push('resolved'); res(); diff --git a/packages/zone.js/test/mocha-patch.spec.ts b/packages/zone.js/test/mocha-patch.spec.ts index 7195eb06c0..9c32a61fca 100644 --- a/packages/zone.js/test/mocha-patch.spec.ts +++ b/packages/zone.js/test/mocha-patch.spec.ts @@ -103,7 +103,7 @@ ifEnvSupports('Mocha', function() { }); it('should wait for promise to resolve', () => { - return new Promise((res, _) => { + return new Promise((res, _) => { setTimeout(() => { log.push('resolved'); res(); diff --git a/packages/zone.js/test/typings/package.json b/packages/zone.js/test/typings/package.json index cb87d67ac1..76163fbb18 100644 --- a/packages/zone.js/test/typings/package.json +++ b/packages/zone.js/test/typings/package.json @@ -14,6 +14,6 @@ "zone.js": "file:../../../../dist/bin/packages/zone.js/npm_package" }, "devDependencies": { - "typescript": "~4.0.2" + "typescript": "~4.1.2" } } diff --git a/packages/zone.js/test/zone-spec/async-test.spec.ts b/packages/zone.js/test/zone-spec/async-test.spec.ts index 26c4ac0bd9..90e8be4980 100644 --- a/packages/zone.js/test/zone-spec/async-test.spec.ts +++ b/packages/zone.js/test/zone-spec/async-test.spec.ts @@ -98,7 +98,7 @@ describe('AsyncTestZoneSpec', function() { const atz = Zone.current.fork(testZoneSpec); atz.run(function() { - new Promise((resolve) => { + new Promise((resolve) => { setTimeout(() => { resolve(); }, 10); diff --git a/packages/zone.js/test/zone-spec/fake-async-test.spec.ts b/packages/zone.js/test/zone-spec/fake-async-test.spec.ts index 1d9436770c..22724223a2 100644 --- a/packages/zone.js/test/zone-spec/fake-async-test.spec.ts +++ b/packages/zone.js/test/zone-spec/fake-async-test.spec.ts @@ -942,7 +942,7 @@ describe('FakeAsyncTestZoneSpec', () => { }); it('should wait for promise to resolve', () => { - return new Promise((res, _) => { + return new Promise((res, _) => { setTimeout(() => { log.push('resolved'); res(); diff --git a/packages/zone.js/yarn.lock b/packages/zone.js/yarn.lock index a794853648..8ef9211599 100644 --- a/packages/zone.js/yarn.lock +++ b/packages/zone.js/yarn.lock @@ -3786,10 +3786,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2" - integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== +typescript@4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" + integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== underscore@~1.8.3: version "1.8.3" diff --git a/tools/ts-api-guardian/package.json b/tools/ts-api-guardian/package.json index 4df0b9840e..236d90b550 100644 --- a/tools/ts-api-guardian/package.json +++ b/tools/ts-api-guardian/package.json @@ -33,7 +33,7 @@ "chai": "^4.1.2", "jasmine": "^3.1.0", "source-map-support": "^0.5.9", - "typescript": "4.0.2" + "typescript": "4.1.2" }, "repository": {}, "keywords": [ @@ -51,4 +51,4 @@ "url": "https://github.com/angular/angular/issues" }, "homepage": "https://github.com/angular/angular/tools/ts-api-guardian" -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 698f3ef441..be08369a4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15621,10 +15621,10 @@ typescript@~3.7.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== -typescript@~4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2" - integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== +typescript@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9" + integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ== uglify-js@^1.3.3: version "1.3.5"