diff --git a/core/src/globals.js b/core/src/globals.js index 98bb6f64db839..cd43b0ba931e6 100644 --- a/core/src/globals.js +++ b/core/src/globals.js @@ -86,11 +86,15 @@ const setDeprecatedProp = (global, cb, msg) => { } Object.defineProperty(window, global, { get: () => { + let value; if (msg) { - warnIfNotTesting(`${global} is deprecated: ${msg}`) + value = warnIfNotTesting(`${global} is deprecated: ${msg}`) } else { - warnIfNotTesting(`${global} is deprecated`) + value = warnIfNotTesting(`${global} is deprecated`) } + + delete window[global]; + window[global] = value; return cb() },