diff --git a/packages/core-js-pure/override/internals/collection.js b/packages/core-js-pure/override/internals/collection.js index 7c77c5c711fd..a50e89232496 100644 --- a/packages/core-js-pure/override/internals/collection.js +++ b/packages/core-js-pure/override/internals/collection.js @@ -16,10 +16,12 @@ var InternalStateModule = require('../internals/internal-state'); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; -module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { +module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = global[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; - var ADDER = IS_MAP ? 'set' : 'add'; var exported = {}; var Constructor; diff --git a/packages/core-js/internals/collection.js b/packages/core-js/internals/collection.js index 776c6d3ade73..f9ac89100fe2 100644 --- a/packages/core-js/internals/collection.js +++ b/packages/core-js/internals/collection.js @@ -12,11 +12,13 @@ var checkCorrectnessOfIteration = require('../internals/check-correctness-of-ite var setToStringTag = require('../internals/set-to-string-tag'); var inheritIfRequired = require('../internals/inherit-if-required'); -module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { +module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = global[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; - var ADDER = IS_MAP ? 'set' : 'add'; var exported = {}; var fixMethod = function (KEY) { diff --git a/packages/core-js/modules/es.map.js b/packages/core-js/modules/es.map.js index ea5f598d8c58..fa8ecce40f50 100644 --- a/packages/core-js/modules/es.map.js +++ b/packages/core-js/modules/es.map.js @@ -4,6 +4,6 @@ var collectionStrong = require('../internals/collection-strong'); // `Map` constructor // https://tc39.github.io/ecma262/#sec-map-objects -module.exports = collection('Map', function (get) { - return function Map() { return get(this, arguments.length ? arguments[0] : undefined); }; -}, collectionStrong, true); +module.exports = collection('Map', function (init) { + return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); diff --git a/packages/core-js/modules/es.set.js b/packages/core-js/modules/es.set.js index 962dc8185b8b..ac9004139ffa 100644 --- a/packages/core-js/modules/es.set.js +++ b/packages/core-js/modules/es.set.js @@ -4,6 +4,6 @@ var collectionStrong = require('../internals/collection-strong'); // `Set` constructor // https://tc39.github.io/ecma262/#sec-set-objects -module.exports = collection('Set', function (get) { - return function Set() { return get(this, arguments.length ? arguments[0] : undefined); }; +module.exports = collection('Set', function (init) { + return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); diff --git a/packages/core-js/modules/es.weak-map.js b/packages/core-js/modules/es.weak-map.js index 89784bbcefc4..38f2f72fdd9a 100644 --- a/packages/core-js/modules/es.weak-map.js +++ b/packages/core-js/modules/es.weak-map.js @@ -12,15 +12,15 @@ var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; var isExtensible = Object.isExtensible; var InternalWeakMap; -var wrapper = function (get) { +var wrapper = function (init) { return function WeakMap() { - return get(this, arguments.length ? arguments[0] : undefined); + return init(this, arguments.length ? arguments[0] : undefined); }; }; // `WeakMap` constructor // https://tc39.github.io/ecma262/#sec-weakmap-constructor -var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak, true, true); +var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); // IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds diff --git a/packages/core-js/modules/es.weak-set.js b/packages/core-js/modules/es.weak-set.js index a412aa557a88..ef6b1bc4f62f 100644 --- a/packages/core-js/modules/es.weak-set.js +++ b/packages/core-js/modules/es.weak-set.js @@ -4,6 +4,6 @@ var collectionWeak = require('../internals/collection-weak'); // `WeakSet` constructor // https://tc39.github.io/ecma262/#sec-weakset-constructor -collection('WeakSet', function (get) { - return function WeakSet() { return get(this, arguments.length ? arguments[0] : undefined); }; -}, collectionWeak, false, true); +collection('WeakSet', function (init) { + return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionWeak);