Change canvasInRendering to a WeakSet instead of a WeakMap

Note how nowhere in the code `canvasInRendering.get()` is ever called, and that this structure is really only used to store references to `<canvas>` DOM elements.
The reason for this being a `WeakMap` is probably because at the time we weren't using `core-js` polyfills yet, and since there already existed a manually implemented `WeakMap` polyfill it was probably simpler to use that.
This commit is contained in:
Jonas Jenwald 2018-10-31 18:15:23 +01:00
parent 42b7bb4751
commit f23dba1c10
2 changed files with 10 additions and 2 deletions

View file

@ -187,6 +187,14 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
globalScope.WeakMap = require('core-js/fn/weak-map');
})();
// Support: IE11
(function checkWeakSet() {
if (globalScope.WeakSet) {
return;
}
globalScope.WeakSet = require('core-js/fn/weak-set');
})();
// Provides support for String.codePointAt in legacy browsers.
// Support: IE11.
(function checkStringCodePointAt() {