build: fix internal Google closure issue with TS3.6 (#33257)

This patch fixes an internal Google issue that came up with the TS3.6
patch that landed earlier (go/b/142967802).

PR Close #33257
This commit is contained in:
Matias Niemelä 2019-10-18 14:21:48 -07:00
parent 8d44b5edac
commit 29bc3a775f
1 changed files with 7 additions and 1 deletions

View File

@ -225,7 +225,13 @@ export function createContainerRef(
ngModuleRef?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<C> {
const contextInjector = injector || this.parentInjector;
if (!ngModuleRef && (componentFactory as any).ngModule == null && contextInjector) {
ngModuleRef = contextInjector.get(viewEngine_NgModuleRef, null) || undefined;
// DO NOT REFACTOR. The code here used to have a `value || undefined` expression
// which seems to cause internal google apps to fail. This is documented in the
// following internal bug issue: go/b/142967802
const result = contextInjector.get(viewEngine_NgModuleRef, null);
if (result) {
ngModuleRef = result;
}
}
const componentRef =