From beb8e5067e64b90f315a28b1031a95bf9f1c8146 Mon Sep 17 00:00:00 2001 From: William Chou Date: Thu, 16 Aug 2018 13:41:50 -0400 Subject: [PATCH] Avoid calling Object.assign before polyfill is installed. (#17544) --- src/polyfills.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/polyfills.js b/src/polyfills.js index 7b574c8b929e..430e38befc00 100644 --- a/src/polyfills.js +++ b/src/polyfills.js @@ -28,14 +28,15 @@ import {installCustomElements as installRegisterElement} from 'document-register-element/build/document-register-element.patched'; import {isExperimentOn} from './experiments'; -if (isExperimentOn(self, 'custom-elements-v1') || getMode().test) { - installCustomElements(self, class {}); -} else { - installRegisterElement(self, 'auto'); -} installDOMTokenListToggle(self); installMathSign(self); installObjectAssign(self); installPromise(self); installDocContains(self); installArrayIncludes(self); +// isExperimentOn() must be called after Object.assign polyfill is installed. +if (isExperimentOn(self, 'custom-elements-v1') || getMode().test) { + installCustomElements(self, class {}); +} else { + installRegisterElement(self, 'auto'); +}