We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d543508 commit 3f4f08aCopy full SHA for 3f4f08a
polyfill.js
@@ -20,8 +20,11 @@ var clear = require('es5-ext/array/#/clear')
20
module.exports = MapPoly = function (/*iterable*/) {
21
var iterable = arguments[0], keys, values, self;
22
if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\'');
23
- if (isNative && setPrototypeOf) self = setPrototypeOf(new Map(), getPrototypeOf(this));
24
- else self = this;
+ if (isNative && setPrototypeOf && (Map !== MapPoly)) {
+ self = setPrototypeOf(new Map(), getPrototypeOf(this));
25
+ } else {
26
+ self = this;
27
+ }
28
if (iterable != null) iterator(iterable);
29
defineProperties(self, {
30
__mapKeysData__: d('c', keys = []),
0 commit comments