From f9404d9e7c80c9c55ce6c07595afea0b282767f0 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 15 May 2019 18:37:35 +0200 Subject: [PATCH] refactor: remove unused local imports and use spread instead of slice (#30482) This is a purly estatic change and a minor cleanup PR Close #30482 --- packages/compiler/test/aot/test_util.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/compiler/test/aot/test_util.ts b/packages/compiler/test/aot/test_util.ts index dad5d13b67..263bf4739a 100644 --- a/packages/compiler/test/aot/test_util.ts +++ b/packages/compiler/test/aot/test_util.ts @@ -32,11 +32,7 @@ export function isDirectory(data: MockFileOrDirectory | undefined): data is Mock return typeof data !== 'string'; } -const NODE_MODULES = '/node_modules/'; -const IS_GENERATED = /\.(ngfactory|ngstyle)$/; -const angularts = /@angular\/(\w|\/|-)+\.tsx?$/; const rxjs = /\/rxjs\//; -const tsxfile = /\.tsx$/; export const settings: ts.CompilerOptions = { target: ts.ScriptTarget.ES5, declaration: true, @@ -231,7 +227,7 @@ export class MockCompilerHost implements ts.CompilerHost { private traces: string[] = []; constructor(scriptNames: string[], private data: MockDirectory) { - this.scriptNames = scriptNames.slice(0); + this.scriptNames = [...scriptNames]; } // Test API @@ -778,7 +774,7 @@ export function compile( aotHost.tsFilesOnly(); } const tsSettings = {...settings, ...tsOptions}; - const program = ts.createProgram(host.scriptNames.slice(0), tsSettings, host); + const program = ts.createProgram([...host.scriptNames], tsSettings, host); preCompile(program); const {compiler, reflector} = createAotCompiler(aotHost, options, (err) => { throw err; }); const analyzedModules = @@ -792,7 +788,7 @@ export function compile( host.override(file.genFileUrl, source); } }); - const newProgram = ts.createProgram(host.scriptNames.slice(0), tsSettings, host); + const newProgram = ts.createProgram([...host.scriptNames], tsSettings, host); postCompile(newProgram); if (emit) { newProgram.emit();