Skip to content

Commit 3f4f08a

Browse files
committed
Fix prototype resolution
1 parent d543508 commit 3f4f08a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

polyfill.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ var clear = require('es5-ext/array/#/clear')
2020
module.exports = MapPoly = function (/*iterable*/) {
2121
var iterable = arguments[0], keys, values, self;
2222
if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\'');
23-
if (isNative && setPrototypeOf) self = setPrototypeOf(new Map(), getPrototypeOf(this));
24-
else self = this;
23+
if (isNative && setPrototypeOf && (Map !== MapPoly)) {
24+
self = setPrototypeOf(new Map(), getPrototypeOf(this));
25+
} else {
26+
self = this;
27+
}
2528
if (iterable != null) iterator(iterable);
2629
defineProperties(self, {
2730
__mapKeysData__: d('c', keys = []),

0 commit comments

Comments
 (0)