From a07de82f79a6f5ad7f8025a760ea575443caf7c4 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 3 Aug 2019 19:42:24 +0300 Subject: [PATCH] refactor(upgrade): avoid using static inherited method (#31986) Using `ParentInjectorPromise.all()` (which is a static method inherited from `SyncPromise`) causes Closure Compiler (or some related tool) to complain: ``` TypeError: ...$packages$upgrade$src$common$src$downgrade_component_ParentInjectorPromise.all is not a function ``` Switching to `SyncPromise.all()` (the static method on the parent class) to avoid this error. PR Close #31986 --- packages/upgrade/src/common/src/downgrade_component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/upgrade/src/common/src/downgrade_component.ts b/packages/upgrade/src/common/src/downgrade_component.ts index 1284da138a..32ed154411 100644 --- a/packages/upgrade/src/common/src/downgrade_component.ts +++ b/packages/upgrade/src/common/src/downgrade_component.ts @@ -196,7 +196,11 @@ export function downgradeComponent(info: { wrapCallback(() => doDowngrade(pInjector, mInjector))(); }; - ParentInjectorPromise.all([finalParentInjector, finalModuleInjector]) + // NOTE: + // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because + // Closure Compiler (or some related tool) complains: + // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function` + SyncPromise.all([finalParentInjector, finalModuleInjector]) .then(([pInjector, mInjector]) => downgradeFn(pInjector, mInjector)); ranAsync = true;