chore: fixes some issues that happen with closure compiler. (#10392)

This commit is contained in:
Hans 2016-08-01 09:47:49 -07:00 committed by GitHub
parent f9573ece41
commit 4df7b1cfbc
3 changed files with 11 additions and 11 deletions

View File

@ -222,6 +222,6 @@ function _lastDefined<T>(args: T[]): T {
function _mergeArrays(parts: any[][]): any[] { function _mergeArrays(parts: any[][]): any[] {
let result: any[] = []; let result: any[] = [];
parts.forEach((part) => result.push(...part)); parts.forEach((part) => part && result.push(...part));
return result; return result;
} }

View File

@ -146,15 +146,15 @@ export class NgModuleMetadata extends InjectableMetadata implements NgModuleMeta
schemas: Array<SchemaMetadata|any[]>; schemas: Array<SchemaMetadata|any[]>;
constructor( constructor(options: NgModuleMetadataType = {}) {
{providers, declarations, imports, exports, entryComponents, // We cannot use destructuring of the constructor argument because `exports` is a
schemas}: NgModuleMetadataType = {}) { // protected symbol in CommonJS and closure tries to aggressively optimize it away.
super(); super();
this._providers = providers; this._providers = options.providers;
this.declarations = declarations; this.declarations = options.declarations;
this.imports = imports; this.imports = options.imports;
this.exports = exports; this.exports = options.exports;
this.entryComponents = entryComponents; this.entryComponents = options.entryComponents;
this.schemas = schemas; this.schemas = options.schemas;
} }
} }

View File

@ -805,7 +805,7 @@ export declare class NgModuleMetadata extends InjectableMetadata implements NgMo
imports: Array<Type | ModuleWithProviders | any[]>; imports: Array<Type | ModuleWithProviders | any[]>;
providers: any[]; providers: any[];
schemas: Array<SchemaMetadata | any[]>; schemas: Array<SchemaMetadata | any[]>;
constructor({providers, declarations, imports, exports, entryComponents, schemas}?: NgModuleMetadataType); constructor(options?: NgModuleMetadataType);
} }
/** @experimental */ /** @experimental */