chore: fixes some issues that happen with closure compiler. (#10392)
This commit is contained in:
parent
f9573ece41
commit
4df7b1cfbc
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue