UNPKG

weak-dictionary

Version:
1,006 lines (875 loc) 29.3 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["weakdictionary"] = factory(); else root["weakdictionary"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var _WeakMap = __webpack_require__(1)["default"]; var WeakDictionary = function WeakDictionary() { this._weakMap = new _WeakMap(); this._keys = []; }; WeakDictionary.prototype.set = function (key, value) { this._keys.push(key); return this._weakMap.set(key, value); }; WeakDictionary.prototype.has = function (key) { return this._weakMap.has(key); }; WeakDictionary.prototype.get = function (key) { return this._weakMap.get(key); }; WeakDictionary.prototype["delete"] = function (key) { var result = this._weakMap["delete"](key); this._keys.splice(this._keys.indexOf(key), 1); return result; }; WeakDictionary.prototype.forEach = function (cb) { var that = this; this._keys.forEach(function (key) { if (that.has(key)) cb(key, that.get(key)); }); }; WeakDictionary.prototype.clear = function () { var that = this; this._keys.forEach(function (key) { if (that.has(key)) { var value = that.get(key); if (value) that["delete"](key); } }); this._weakMap = new _WeakMap(); this._keys = []; }; WeakDictionary.prototype.getKeys = function () { return this._keys; }; WeakDictionary.prototype.getSize = function () { this.refresh(); return this._keys.length; }; WeakDictionary.prototype.refresh = function () { var that = this; var keysToRemove = []; this._keys.forEach(function (key) { if (!that.has(key)) { keysToRemove.push(key); } }); }; module.exports = WeakDictionary; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(2), __esModule: true }; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(3); __webpack_require__(4); __webpack_require__(30); module.exports = __webpack_require__(17).WeakMap; /***/ }, /* 3 */ /***/ function(module, exports) { /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { __webpack_require__(5); var Iterators = __webpack_require__(8); Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var addToUnscopables = __webpack_require__(6) , step = __webpack_require__(7) , Iterators = __webpack_require__(8) , toIObject = __webpack_require__(9); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__(13)(Array, 'Array', function(iterated, kind){ this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function(){ var O = this._t , kind = this._k , index = this._i++; if(!O || index >= O.length){ this._t = undefined; return step(1); } if(kind == 'keys' )return step(0, index); if(kind == 'values')return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }, /* 6 */ /***/ function(module, exports) { module.exports = function(){ /* empty */ }; /***/ }, /* 7 */ /***/ function(module, exports) { module.exports = function(done, value){ return {value: value, done: !!done}; }; /***/ }, /* 8 */ /***/ function(module, exports) { module.exports = {}; /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(10) , defined = __webpack_require__(12); module.exports = function(it){ return IObject(defined(it)); }; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(11); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }, /* 11 */ /***/ function(module, exports) { var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; /***/ }, /* 12 */ /***/ function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var LIBRARY = __webpack_require__(14) , $def = __webpack_require__(15) , $redef = __webpack_require__(18) , hide = __webpack_require__(19) , has = __webpack_require__(24) , SYMBOL_ITERATOR = __webpack_require__(25)('iterator') , Iterators = __webpack_require__(8) , $iterCreate = __webpack_require__(28) , setToStringTag = __webpack_require__(29) , getProto = __webpack_require__(20).getProto , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` , FF_ITERATOR = '@@iterator' , KEYS = 'keys' , VALUES = 'values'; var returnThis = function(){ return this; }; module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){ $iterCreate(Constructor, NAME, next); var getMethod = function(kind){ if(!BUGGY && kind in proto)return proto[kind]; switch(kind){ case KEYS: return function keys(){ return new Constructor(this, kind); }; case VALUES: return function values(){ return new Constructor(this, kind); }; } return function entries(){ return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator' , proto = Base.prototype , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] , _default = _native || getMethod(DEFAULT) , methods, key; // Fix native if(_native){ var IteratorPrototype = getProto(_default.call(new Base)); // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // FF fix if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, SYMBOL_ITERATOR, returnThis); } // Define iterator if((!LIBRARY || FORCE) && (BUGGY || !(SYMBOL_ITERATOR in proto))){ hide(proto, SYMBOL_ITERATOR, _default); } // Plug for library Iterators[NAME] = _default; Iterators[TAG] = returnThis; if(DEFAULT){ methods = { values: DEFAULT == VALUES ? _default : getMethod(VALUES), keys: IS_SET ? _default : getMethod(KEYS), entries: DEFAULT != VALUES ? _default : getMethod('entries') }; if(FORCE)for(key in methods){ if(!(key in proto))$redef(proto, key, methods[key]); } else $def($def.P + $def.F * BUGGY, NAME, methods); } return methods; }; /***/ }, /* 14 */ /***/ function(module, exports) { module.exports = true; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(16) , core = __webpack_require__(17) , PROTOTYPE = 'prototype'; var ctx = function(fn, that){ return function(){ return fn.apply(that, arguments); }; }; var $def = function(type, name, source){ var key, own, out, exp , isGlobal = type & $def.G , isProto = type & $def.P , target = isGlobal ? global : type & $def.S ? global[name] : (global[name] || {})[PROTOTYPE] , exports = isGlobal ? core : core[name] || (core[name] = {}); if(isGlobal)source = name; for(key in source){ // contains in native own = !(type & $def.F) && target && key in target; if(own && key in exports)continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces if(isGlobal && typeof target[key] != 'function')exp = source[key]; // bind timers to global for call from export context else if(type & $def.B && own)exp = ctx(out, global); // wrap global constructors for prevent change them in library else if(type & $def.W && target[key] == out)!function(C){ exp = function(param){ return this instanceof C ? new C(param) : C(param); }; exp[PROTOTYPE] = C[PROTOTYPE]; }(out); else exp = isProto && typeof out == 'function' ? ctx(Function.call, out) : out; // export exports[key] = exp; if(isProto)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out; } }; // type bitmap $def.F = 1; // forced $def.G = 2; // global $def.S = 4; // static $def.P = 8; // proto $def.B = 16; // bind $def.W = 32; // wrap module.exports = $def; /***/ }, /* 16 */ /***/ function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }, /* 17 */ /***/ function(module, exports) { var core = module.exports = {version: '1.2.5'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(19); /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { var $ = __webpack_require__(20) , createDesc = __webpack_require__(21); module.exports = __webpack_require__(22) ? function(object, key, value){ return $.setDesc(object, key, createDesc(1, value)); } : function(object, key, value){ object[key] = value; return object; }; /***/ }, /* 20 */ /***/ function(module, exports) { var $Object = Object; module.exports = { create: $Object.create, getProto: $Object.getPrototypeOf, isEnum: {}.propertyIsEnumerable, getDesc: $Object.getOwnPropertyDescriptor, setDesc: $Object.defineProperty, setDescs: $Object.defineProperties, getKeys: $Object.keys, getNames: $Object.getOwnPropertyNames, getSymbols: $Object.getOwnPropertySymbols, each: [].forEach }; /***/ }, /* 21 */ /***/ function(module, exports) { module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), configurable: !(bitmap & 2), writable : !(bitmap & 4), value : value }; }; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(23)(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); /***/ }, /* 23 */ /***/ function(module, exports) { module.exports = function(exec){ try { return !!exec(); } catch(e){ return true; } }; /***/ }, /* 24 */ /***/ function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { var store = __webpack_require__(26)('wks') , uid = __webpack_require__(27) , Symbol = __webpack_require__(16).Symbol; module.exports = function(name){ return store[name] || (store[name] = Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); }; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { var global = __webpack_require__(16) , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; /***/ }, /* 27 */ /***/ function(module, exports) { var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(20) , descriptor = __webpack_require__(21) , setToStringTag = __webpack_require__(29) , IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(19)(IteratorPrototype, __webpack_require__(25)('iterator'), function(){ return this; }); module.exports = function(Constructor, NAME, next){ Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { var def = __webpack_require__(20).setDesc , has = __webpack_require__(24) , TAG = __webpack_require__(25)('toStringTag'); module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var $ = __webpack_require__(20) , redef = __webpack_require__(18) , weak = __webpack_require__(31) , isObject = __webpack_require__(34) , has = __webpack_require__(24) , frozenStore = weak.frozenStore , WEAK = weak.WEAK , isExtensible = Object.isExtensible || isObject , tmp = {}; // 23.3 WeakMap Objects var $WeakMap = __webpack_require__(49)('WeakMap', function(get){ return function WeakMap(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key){ if(isObject(key)){ if(!isExtensible(key))return frozenStore(this).get(key); if(has(key, WEAK))return key[WEAK][this._i]; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value){ return weak.def(this, key, value); } }, weak, true, true); // IE11 WeakMap frozen keys fix if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ $.each.call(['delete', 'has', 'get', 'set'], function(key){ var proto = $WeakMap.prototype , method = proto[key]; redef(proto, key, function(a, b){ // store frozen objects on leaky map if(isObject(a) && !isExtensible(a)){ var result = frozenStore(this)[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }); }); } /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var hide = __webpack_require__(19) , mix = __webpack_require__(32) , anObject = __webpack_require__(33) , strictNew = __webpack_require__(35) , forOf = __webpack_require__(36) , method = __webpack_require__(45) , WEAK = __webpack_require__(27)('weak') , isObject = __webpack_require__(34) , $has = __webpack_require__(24) , isExtensible = Object.isExtensible || isObject , find = method(5) , findIndex = method(6) , id = 0; // fallback for frozen keys var frozenStore = function(that){ return that._l || (that._l = new FrozenStore); }; var FrozenStore = function(){ this.a = []; }; var findFrozen = function(store, key){ return find(store.a, function(it){ return it[0] === key; }); }; FrozenStore.prototype = { get: function(key){ var entry = findFrozen(this, key); if(entry)return entry[1]; }, has: function(key){ return !!findFrozen(this, key); }, set: function(key, value){ var entry = findFrozen(this, key); if(entry)entry[1] = value; else this.a.push([key, value]); }, 'delete': function(key){ var index = findIndex(this.a, function(it){ return it[0] === key; }); if(~index)this.a.splice(index, 1); return !!~index; } }; module.exports = { getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ var C = wrapper(function(that, iterable){ strictNew(that, C, NAME); that._i = id++; // collection id that._l = undefined; // leak store for frozen objects if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); }); mix(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function(key){ if(!isObject(key))return false; if(!isExtensible(key))return frozenStore(this)['delete'](key); return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key){ if(!isObject(key))return false; if(!isExtensible(key))return frozenStore(this).has(key); return $has(key, WEAK) && $has(key[WEAK], this._i); } }); return C; }, def: function(that, key, value){ if(!isExtensible(anObject(key))){ frozenStore(that).set(key, value); } else { $has(key, WEAK) || hide(key, WEAK, {}); key[WEAK][that._i] = value; } return that; }, frozenStore: frozenStore, WEAK: WEAK }; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var $redef = __webpack_require__(18); module.exports = function(target, src){ for(var key in src)$redef(target, key, src[key]); return target; }; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(34); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; /***/ }, /* 34 */ /***/ function(module, exports) { module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }, /* 35 */ /***/ function(module, exports) { module.exports = function(it, Constructor, name){ if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); return it; }; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { var ctx = __webpack_require__(37) , call = __webpack_require__(39) , isArrayIter = __webpack_require__(40) , anObject = __webpack_require__(33) , toLength = __webpack_require__(41) , getIterFn = __webpack_require__(43); module.exports = function(iterable, entries, fn, that){ var iterFn = getIterFn(iterable) , f = ctx(fn, that, entries ? 2 : 1) , index = 0 , length, step, iterator; if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ call(iterator, f, step.value, entries); } }; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(38); module.exports = function(fn, that, length){ aFunction(fn); if(that === undefined)return fn; switch(length){ case 1: return function(a){ return fn.call(that, a); }; case 2: return function(a, b){ return fn.call(that, a, b); }; case 3: return function(a, b, c){ return fn.call(that, a, b, c); }; } return function(/* ...args */){ return fn.apply(that, arguments); }; }; /***/ }, /* 38 */ /***/ function(module, exports) { module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error var anObject = __webpack_require__(33); module.exports = function(iterator, fn, value, entries){ try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch(e){ var ret = iterator['return']; if(ret !== undefined)anObject(ret.call(iterator)); throw e; } }; /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { // check on default Array iterator var Iterators = __webpack_require__(8) , ITERATOR = __webpack_require__(25)('iterator') , ArrayProto = Array.prototype; module.exports = function(it){ return (Iterators.Array || ArrayProto[ITERATOR]) === it; }; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(42) , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }, /* 42 */ /***/ function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { var classof = __webpack_require__(44) , ITERATOR = __webpack_require__(25)('iterator') , Iterators = __webpack_require__(8); module.exports = __webpack_require__(17).getIteratorMethod = function(it){ if(it != undefined)return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() var cof = __webpack_require__(11) , TAG = __webpack_require__(25)('toStringTag') // ES3 wrong here , ARG = cof(function(){ return arguments; }()) == 'Arguments'; module.exports = function(it){ var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = (O = Object(it))[TAG]) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__(37) , IObject = __webpack_require__(10) , toObject = __webpack_require__(46) , toLength = __webpack_require__(41) , asc = __webpack_require__(47); module.exports = function(TYPE){ var IS_MAP = TYPE == 1 , IS_FILTER = TYPE == 2 , IS_SOME = TYPE == 3 , IS_EVERY = TYPE == 4 , IS_FIND_INDEX = TYPE == 6 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function($this, callbackfn, that){ var O = toObject($this) , self = IObject(O) , f = ctx(callbackfn, that, 3) , length = toLength(self.length) , index = 0 , result = IS_MAP ? asc($this, length) : IS_FILTER ? asc($this, 0) : undefined , val, res; for(;length > index; index++)if(NO_HOLES || index in self){ val = self[index]; res = f(val, index, O); if(TYPE){ if(IS_MAP)result[index] = res; // map else if(res)switch(TYPE){ case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if(IS_EVERY)return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(12); module.exports = function(it){ return Object(defined(it)); }; /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var isObject = __webpack_require__(34) , isArray = __webpack_require__(48) , SPECIES = __webpack_require__(25)('species'); module.exports = function(original, length){ var C; if(isArray(original)){ C = original.constructor; // cross-realm fallback if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; if(isObject(C)){ C = C[SPECIES]; if(C === null)C = undefined; } } return new (C === undefined ? Array : C)(length); }; /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__(11); module.exports = Array.isArray || function(arg){ return cof(arg) == 'Array'; }; /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var global = __webpack_require__(16) , $ = __webpack_require__(20) , $def = __webpack_require__(15) , fails = __webpack_require__(23) , hide = __webpack_require__(19) , mix = __webpack_require__(32) , forOf = __webpack_require__(36) , strictNew = __webpack_require__(35) , isObject = __webpack_require__(34) , DESCRIPTORS = __webpack_require__(22) , setToStringTag = __webpack_require__(29); module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ var Base = global[NAME] , C = Base , ADDER = IS_MAP ? 'set' : 'add' , proto = C && C.prototype , O = {}; if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ new C().entries().next(); }))){ // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); mix(C.prototype, methods); } else { C = wrapper(function(target, iterable){ strictNew(target, C, NAME); target._c = new Base; if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); }); $.each.call('add,clear,delete,forEach,get,has,set,keys,values,entries'.split(','),function(KEY){ var IS_ADDER = KEY == 'add' || KEY == 'set'; if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false; var result = this._c[KEY](a === 0 ? 0 : a, b); return IS_ADDER ? this : result; }); }); if('size' in proto)$.setDesc(C.prototype, 'size', { get: function(){ return this._c.size; } }); } setToStringTag(C, NAME); O[NAME] = C; $def($def.G + $def.W + $def.F, O); if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); return C; }; /***/ } /******/ ]) }); ; //# sourceMappingURL=weak-dictionary-0.24.0.debug.js.map