mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
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:
parent
42b7bb4751
commit
f23dba1c10
2 changed files with 10 additions and 2 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue