fix(ivy): semantic module check incorrectly handles nested arrays (#30993)
In View Engine, developers can pass bootstrap and entry components as nested arrays. e.g. ```ts export const MyOtherEntryComponents = [A, B, C] @NgModule({ entryComponents: [MyComp, MyOtherEntryComponents] }) ``` Currently using nested arrays for these properties causes unexpected errors to be reported in Ivy since the semantic NgModule checks aren't properly recursing into the nested entry/bootstrap components. This issue has been unveiled by enabling the strict function parameter checks. PR Close #30993
This commit is contained in:

committed by
Miško Hevery

parent
dda781ecce
commit
e061e638cb
@ -11,6 +11,7 @@ import '../util/ng_dev_mode';
|
||||
import {OnDestroy} from '../interface/lifecycle_hooks';
|
||||
import {Type} from '../interface/type';
|
||||
import {throwCyclicDependencyError, throwInvalidProviderError, throwMixedMultiProviderError} from '../render3/errors';
|
||||
import {deepForEach} from '../util/array_utils';
|
||||
import {stringify} from '../util/stringify';
|
||||
|
||||
import {resolveForwardRef} from './forward_ref';
|
||||
@ -497,10 +498,6 @@ function makeRecord<T>(
|
||||
};
|
||||
}
|
||||
|
||||
function deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {
|
||||
input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
|
||||
}
|
||||
|
||||
function isValueProvider(value: SingleProvider): value is ValueProvider {
|
||||
return value !== null && typeof value == 'object' && USE_VALUE in value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user