We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce68d3a commit 5402b06Copy full SHA for 5402b06
primitive/index.js
@@ -20,8 +20,11 @@ var clear = require('es5-ext/object/clear')
20
module.exports = PrimitiveMap = function (/*iterable, serialize*/) {
21
var iterable = arguments[0], serialize = arguments[1], self;
22
if (!(this instanceof PrimitiveMap)) throw new TypeError('Constructor requires \'new\'');
23
- if (isNative && setPrototypeOf) self = setPrototypeOf(new Map(), getPrototypeOf(this));
24
- else self = this;
+ if (isNative && setPrototypeOf && (Map !== MapPolyfill)) {
+ self = setPrototypeOf(new Map(), getPrototypeOf(this));
25
+ } else {
26
+ self = this;
27
+ }
28
if (iterable != null) iterator(iterable);
29
if (serialize !== undefined) {
30
callable(serialize);
0 commit comments