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[] {
let result: any[] = [];
parts.forEach((part) => result.push(...part));
parts.forEach((part) => part && result.push(...part));
return result;
}

View File

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

View File

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