babel-source 5.0.0.beta4 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/lib/babel.js +4029 -5673
  3. data/lib/babel/polyfill.js +2307 -1835
  4. data/lib/babel/source.rb +2 -2
  5. metadata +4 -4
@@ -11,153 +11,503 @@ require("core-js/shim");
11
11
 
12
12
  require("regenerator-babel/runtime");
13
13
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
14
- },{"core-js/shim":2,"regenerator-babel/runtime":3}],2:[function(require,module,exports){
15
- /**
16
- * Core.js 0.6.1
17
- * https://github.com/zloirock/core-js
18
- * License: http://rock.mit-license.org
19
- * © 2015 Denis Pushkarev
20
- */
21
- !function(global, framework, undefined){
22
- 'use strict';
23
-
24
- /******************************************************************************
25
- * Module : common *
26
- ******************************************************************************/
27
-
28
- // Shortcuts for [[Class]] & property names
29
- var OBJECT = 'Object'
30
- , FUNCTION = 'Function'
31
- , ARRAY = 'Array'
32
- , STRING = 'String'
33
- , NUMBER = 'Number'
34
- , REGEXP = 'RegExp'
35
- , DATE = 'Date'
36
- , MAP = 'Map'
37
- , SET = 'Set'
38
- , WEAKMAP = 'WeakMap'
39
- , WEAKSET = 'WeakSet'
40
- , SYMBOL = 'Symbol'
41
- , PROMISE = 'Promise'
42
- , MATH = 'Math'
43
- , ARGUMENTS = 'Arguments'
44
- , PROTOTYPE = 'prototype'
45
- , CONSTRUCTOR = 'constructor'
46
- , TO_STRING = 'toString'
47
- , TO_STRING_TAG = TO_STRING + 'Tag'
48
- , TO_LOCALE = 'toLocaleString'
49
- , HAS_OWN = 'hasOwnProperty'
50
- , FOR_EACH = 'forEach'
51
- , ITERATOR = 'iterator'
52
- , FF_ITERATOR = '@@' + ITERATOR
53
- , PROCESS = 'process'
54
- , CREATE_ELEMENT = 'createElement'
55
- // Aliases global objects and prototypes
56
- , Function = global[FUNCTION]
57
- , Object = global[OBJECT]
58
- , Array = global[ARRAY]
59
- , String = global[STRING]
60
- , Number = global[NUMBER]
61
- , RegExp = global[REGEXP]
62
- , Date = global[DATE]
63
- , Map = global[MAP]
64
- , Set = global[SET]
65
- , WeakMap = global[WEAKMAP]
66
- , WeakSet = global[WEAKSET]
67
- , Symbol = global[SYMBOL]
68
- , Math = global[MATH]
69
- , TypeError = global.TypeError
70
- , RangeError = global.RangeError
71
- , setTimeout = global.setTimeout
72
- , setImmediate = global.setImmediate
73
- , clearImmediate = global.clearImmediate
74
- , parseInt = global.parseInt
75
- , isFinite = global.isFinite
76
- , process = global[PROCESS]
77
- , nextTick = process && process.nextTick
78
- , document = global.document
79
- , html = document && document.documentElement
80
- , navigator = global.navigator
81
- , define = global.define
82
- , console = global.console || {}
83
- , ArrayProto = Array[PROTOTYPE]
84
- , ObjectProto = Object[PROTOTYPE]
85
- , FunctionProto = Function[PROTOTYPE]
86
- , Infinity = 1 / 0
87
- , DOT = '.';
88
-
89
- // http://jsperf.com/core-js-isobject
90
- function isObject(it){
91
- return it !== null && (typeof it == 'object' || typeof it == 'function');
92
- }
93
- function isFunction(it){
94
- return typeof it == 'function';
95
- }
96
- // Native function?
97
- var isNative = ctx(/./.test, /\[native code\]\s*\}\s*$/, 1);
98
-
99
- // Object internal [[Class]] or toStringTag
100
- // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring
101
- var toString = ObjectProto[TO_STRING];
102
- function setToStringTag(it, tag, stat){
103
- if(it && !has(it = stat ? it : it[PROTOTYPE], SYMBOL_TAG))hidden(it, SYMBOL_TAG, tag);
14
+ },{"core-js/shim":70,"regenerator-babel/runtime":71}],2:[function(require,module,exports){
15
+ 'use strict';
16
+ // false -> Array#indexOf
17
+ // true -> Array#includes
18
+ var $ = require('./$');
19
+ module.exports = function(IS_INCLUDES){
20
+ return function(el /*, fromIndex = 0 */){
21
+ var O = $.toObject(this)
22
+ , length = $.toLength(O.length)
23
+ , index = $.toIndex(arguments[1], length)
24
+ , value;
25
+ if(IS_INCLUDES && el != el)while(length > index){
26
+ value = O[index++];
27
+ if(value != value)return true;
28
+ } else for(;length > index; index++)if(IS_INCLUDES || index in O){
29
+ if(O[index] === el)return IS_INCLUDES || index;
30
+ } return !IS_INCLUDES && -1;
31
+ };
32
+ };
33
+ },{"./$":15}],3:[function(require,module,exports){
34
+ 'use strict';
35
+ // 0 -> Array#forEach
36
+ // 1 -> Array#map
37
+ // 2 -> Array#filter
38
+ // 3 -> Array#some
39
+ // 4 -> Array#every
40
+ // 5 -> Array#find
41
+ // 6 -> Array#findIndex
42
+ var $ = require('./$')
43
+ , ctx = require('./$.ctx');
44
+ module.exports = function(TYPE){
45
+ var IS_MAP = TYPE == 1
46
+ , IS_FILTER = TYPE == 2
47
+ , IS_SOME = TYPE == 3
48
+ , IS_EVERY = TYPE == 4
49
+ , IS_FIND_INDEX = TYPE == 6
50
+ , NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
51
+ return function(callbackfn/*, that = undefined */){
52
+ var O = Object($.assertDefined(this))
53
+ , self = $.ES5Object(O)
54
+ , f = ctx(callbackfn, arguments[1], 3)
55
+ , length = $.toLength(self.length)
56
+ , index = 0
57
+ , result = IS_MAP ? Array(length) : IS_FILTER ? [] : undefined
58
+ , val, res;
59
+ for(;length > index; index++)if(NO_HOLES || index in self){
60
+ val = self[index];
61
+ res = f(val, index, O);
62
+ if(TYPE){
63
+ if(IS_MAP)result[index] = res; // map
64
+ else if(res)switch(TYPE){
65
+ case 3: return true; // some
66
+ case 5: return val; // find
67
+ case 6: return index; // findIndex
68
+ case 2: result.push(val); // filter
69
+ } else if(IS_EVERY)return false; // every
70
+ }
71
+ }
72
+ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
73
+ };
74
+ };
75
+ },{"./$":15,"./$.ctx":10}],4:[function(require,module,exports){
76
+ var $ = require('./$');
77
+ function assert(condition, msg1, msg2){
78
+ if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1);
104
79
  }
80
+ assert.def = $.assertDefined;
81
+ assert.fn = function(it){
82
+ if(!$.isFunction(it))throw TypeError(it + ' is not a function!');
83
+ return it;
84
+ };
85
+ assert.obj = function(it){
86
+ if(!$.isObject(it))throw TypeError(it + ' is not an object!');
87
+ return it;
88
+ };
89
+ assert.inst = function(it, Constructor, name){
90
+ if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!");
91
+ return it;
92
+ };
93
+ module.exports = assert;
94
+ },{"./$":15}],5:[function(require,module,exports){
95
+ var $ = require('./$');
96
+ // 19.1.2.1 Object.assign(target, source, ...)
97
+ module.exports = Object.assign || function(target, source){ // eslint-disable-line no-unused-vars
98
+ var T = Object($.assertDefined(target))
99
+ , l = arguments.length
100
+ , i = 1;
101
+ while(l > i){
102
+ var S = $.ES5Object(arguments[i++])
103
+ , keys = $.getKeys(S)
104
+ , length = keys.length
105
+ , j = 0
106
+ , key;
107
+ while(length > j)T[key = keys[j++]] = S[key];
108
+ }
109
+ return T;
110
+ };
111
+ },{"./$":15}],6:[function(require,module,exports){
112
+ var $ = require('./$')
113
+ , TAG = require('./$.wks')('toStringTag')
114
+ , toString = {}.toString;
105
115
  function cof(it){
106
116
  return toString.call(it).slice(8, -1);
107
117
  }
108
- function classof(it){
118
+ cof.classof = function(it){
109
119
  var O, T;
110
120
  return it == undefined ? it === undefined ? 'Undefined' : 'Null'
111
- : typeof (T = (O = Object(it))[SYMBOL_TAG]) == 'string' ? T : cof(O);
121
+ : typeof (T = (O = Object(it))[TAG]) == 'string' ? T : cof(O);
122
+ };
123
+ cof.set = function(it, tag, stat){
124
+ if(it && !$.has(it = stat ? it : it.prototype, TAG))$.hide(it, TAG, tag);
125
+ };
126
+ module.exports = cof;
127
+ },{"./$":15,"./$.wks":26}],7:[function(require,module,exports){
128
+ 'use strict';
129
+ var $ = require('./$')
130
+ , ctx = require('./$.ctx')
131
+ , safe = require('./$.uid').safe
132
+ , assert = require('./$.assert')
133
+ , $iter = require('./$.iter')
134
+ , has = $.has
135
+ , set = $.set
136
+ , isObject = $.isObject
137
+ , hide = $.hide
138
+ , step = $iter.step
139
+ , isFrozen = Object.isFrozen || $.core.Object.isFrozen
140
+ , ID = safe('id')
141
+ , O1 = safe('O1')
142
+ , LAST = safe('last')
143
+ , FIRST = safe('first')
144
+ , ITER = safe('iter')
145
+ , SIZE = $.DESC ? safe('size') : 'size'
146
+ , id = 0;
147
+
148
+ function fastKey(it, create){
149
+ // return primitive with prefix
150
+ if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it;
151
+ // can't set id to frozen object
152
+ if(isFrozen(it))return 'F';
153
+ if(!has(it, ID)){
154
+ // not necessary to add id
155
+ if(!create)return 'E';
156
+ // add missing object id
157
+ hide(it, ID, ++id);
158
+ // return object id with prefix
159
+ } return 'O' + it[ID];
112
160
  }
113
161
 
114
- // Function
115
- var call = FunctionProto.call
116
- , apply = FunctionProto.apply
117
- , REFERENCE_GET;
118
- // Partial apply
119
- function part(/* ...args */){
120
- var fn = assertFunction(this)
121
- , length = arguments.length
122
- , args = Array(length)
123
- , i = 0
124
- , _ = path._
125
- , holder = false;
126
- while(length > i)if((args[i] = arguments[i++]) === _)holder = true;
127
- return function(/* ...args */){
128
- var that = this
129
- , _length = arguments.length
130
- , i = 0, j = 0, _args;
131
- if(!holder && !_length)return invoke(fn, args, that);
132
- _args = args.slice();
133
- if(holder)for(;length > i; i++)if(_args[i] === _)_args[i] = arguments[j++];
134
- while(_length > j)_args.push(arguments[j++]);
135
- return invoke(fn, _args, that);
162
+ function getEntry(that, key){
163
+ // fast case
164
+ var index = fastKey(key), entry;
165
+ if(index != 'F')return that[O1][index];
166
+ // frozen object case
167
+ for(entry = that[FIRST]; entry; entry = entry.n){
168
+ if(entry.k == key)return entry;
169
+ }
170
+ }
171
+
172
+ module.exports = {
173
+ getConstructor: function(NAME, IS_MAP, ADDER){
174
+ function C(iterable){
175
+ var that = assert.inst(this, C, NAME);
176
+ set(that, O1, $.create(null));
177
+ set(that, SIZE, 0);
178
+ set(that, LAST, undefined);
179
+ set(that, FIRST, undefined);
180
+ if(iterable != undefined)$iter.forOf(iterable, IS_MAP, that[ADDER], that);
181
+ }
182
+ $.mix(C.prototype, {
183
+ // 23.1.3.1 Map.prototype.clear()
184
+ // 23.2.3.2 Set.prototype.clear()
185
+ clear: function(){
186
+ for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){
187
+ entry.r = true;
188
+ if(entry.p)entry.p = entry.p.n = undefined;
189
+ delete data[entry.i];
190
+ }
191
+ that[FIRST] = that[LAST] = undefined;
192
+ that[SIZE] = 0;
193
+ },
194
+ // 23.1.3.3 Map.prototype.delete(key)
195
+ // 23.2.3.4 Set.prototype.delete(value)
196
+ 'delete': function(key){
197
+ var that = this
198
+ , entry = getEntry(that, key);
199
+ if(entry){
200
+ var next = entry.n
201
+ , prev = entry.p;
202
+ delete that[O1][entry.i];
203
+ entry.r = true;
204
+ if(prev)prev.n = next;
205
+ if(next)next.p = prev;
206
+ if(that[FIRST] == entry)that[FIRST] = next;
207
+ if(that[LAST] == entry)that[LAST] = prev;
208
+ that[SIZE]--;
209
+ } return !!entry;
210
+ },
211
+ // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
212
+ // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
213
+ forEach: function(callbackfn /*, that = undefined */){
214
+ var f = ctx(callbackfn, arguments[1], 3)
215
+ , entry;
216
+ while(entry = entry ? entry.n : this[FIRST]){
217
+ f(entry.v, entry.k, this);
218
+ // revert to the last existing entry
219
+ while(entry && entry.r)entry = entry.p;
220
+ }
221
+ },
222
+ // 23.1.3.7 Map.prototype.has(key)
223
+ // 23.2.3.7 Set.prototype.has(value)
224
+ has: function(key){
225
+ return !!getEntry(this, key);
226
+ }
227
+ });
228
+ if($.DESC)$.setDesc(C.prototype, 'size', {
229
+ get: function(){
230
+ return assert.def(this[SIZE]);
231
+ }
232
+ });
233
+ return C;
234
+ },
235
+ def: function(that, key, value){
236
+ var entry = getEntry(that, key)
237
+ , prev, index;
238
+ // change existing entry
239
+ if(entry){
240
+ entry.v = value;
241
+ // create new entry
242
+ } else {
243
+ that[LAST] = entry = {
244
+ i: index = fastKey(key, true), // <- index
245
+ k: key, // <- key
246
+ v: value, // <- value
247
+ p: prev = that[LAST], // <- previous entry
248
+ n: undefined, // <- next entry
249
+ r: false // <- removed
250
+ };
251
+ if(!that[FIRST])that[FIRST] = entry;
252
+ if(prev)prev.n = entry;
253
+ that[SIZE]++;
254
+ // add to index
255
+ if(index != 'F')that[O1][index] = entry;
256
+ } return that;
257
+ },
258
+ getEntry: getEntry,
259
+ getIterConstructor: function(){
260
+ return function(iterated, kind){
261
+ set(this, ITER, {o: iterated, k: kind});
262
+ };
263
+ },
264
+ next: function(){
265
+ var iter = this[ITER]
266
+ , kind = iter.k
267
+ , entry = iter.l;
268
+ // revert to the last existing entry
269
+ while(entry && entry.r)entry = entry.p;
270
+ // get next entry
271
+ if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){
272
+ // or finish the iteration
273
+ iter.o = undefined;
274
+ return step(1);
275
+ }
276
+ // return step by kind
277
+ if(kind == 'key' )return step(0, entry.k);
278
+ if(kind == 'value')return step(0, entry.v);
279
+ return step(0, [entry.k, entry.v]);
136
280
  }
281
+ };
282
+ },{"./$":15,"./$.assert":4,"./$.ctx":10,"./$.iter":14,"./$.uid":24}],8:[function(require,module,exports){
283
+ 'use strict';
284
+ var $ = require('./$')
285
+ , safe = require('./$.uid').safe
286
+ , assert = require('./$.assert')
287
+ , forOf = require('./$.iter').forOf
288
+ , has = $.has
289
+ , isObject = $.isObject
290
+ , hide = $.hide
291
+ , isFrozen = Object.isFrozen || $.core.Object.isFrozen
292
+ , id = 0
293
+ , ID = safe('id')
294
+ , WEAK = safe('weak')
295
+ , LEAK = safe('leak')
296
+ , method = require('./$.array-methods')
297
+ , find = method(5)
298
+ , findIndex = method(6);
299
+ function findFrozen(store, key){
300
+ return find.call(store.array, function(it){
301
+ return it[0] === key;
302
+ });
303
+ }
304
+ // fallback for frozen keys
305
+ function leakStore(that){
306
+ return that[LEAK] || hide(that, LEAK, {
307
+ array: [],
308
+ get: function(key){
309
+ var entry = findFrozen(this, key);
310
+ if(entry)return entry[1];
311
+ },
312
+ has: function(key){
313
+ return !!findFrozen(this, key);
314
+ },
315
+ set: function(key, value){
316
+ var entry = findFrozen(this, key);
317
+ if(entry)entry[1] = value;
318
+ else this.array.push([key, value]);
319
+ },
320
+ 'delete': function(key){
321
+ var index = findIndex.call(this.array, function(it){
322
+ return it[0] === key;
323
+ });
324
+ if(~index)this.array.splice(index, 1);
325
+ return !!~index;
326
+ }
327
+ })[LEAK];
137
328
  }
329
+
330
+ module.exports = {
331
+ getConstructor: function(NAME, IS_MAP, ADDER){
332
+ function C(iterable){
333
+ $.set(assert.inst(this, C, NAME), ID, id++);
334
+ if(iterable != undefined)forOf(iterable, IS_MAP, this[ADDER], this);
335
+ }
336
+ $.mix(C.prototype, {
337
+ // 23.3.3.2 WeakMap.prototype.delete(key)
338
+ // 23.4.3.3 WeakSet.prototype.delete(value)
339
+ 'delete': function(key){
340
+ if(!isObject(key))return false;
341
+ if(isFrozen(key))return leakStore(this)['delete'](key);
342
+ return has(key, WEAK) && has(key[WEAK], this[ID]) && delete key[WEAK][this[ID]];
343
+ },
344
+ // 23.3.3.4 WeakMap.prototype.has(key)
345
+ // 23.4.3.4 WeakSet.prototype.has(value)
346
+ has: function(key){
347
+ if(!isObject(key))return false;
348
+ if(isFrozen(key))return leakStore(this).has(key);
349
+ return has(key, WEAK) && has(key[WEAK], this[ID]);
350
+ }
351
+ });
352
+ return C;
353
+ },
354
+ def: function(that, key, value){
355
+ if(isFrozen(assert.obj(key))){
356
+ leakStore(that).set(key, value);
357
+ } else {
358
+ has(key, WEAK) || hide(key, WEAK, {});
359
+ key[WEAK][that[ID]] = value;
360
+ } return that;
361
+ },
362
+ leakStore: leakStore,
363
+ WEAK: WEAK,
364
+ ID: ID
365
+ };
366
+ },{"./$":15,"./$.array-methods":3,"./$.assert":4,"./$.iter":14,"./$.uid":24}],9:[function(require,module,exports){
367
+ 'use strict';
368
+ var $ = require('./$')
369
+ , $def = require('./$.def')
370
+ , $iter = require('./$.iter')
371
+ , assertInstance = require('./$.assert').inst;
372
+
373
+ module.exports = function(NAME, methods, common, IS_MAP, isWeak){
374
+ var Base = $.g[NAME]
375
+ , C = Base
376
+ , ADDER = IS_MAP ? 'set' : 'add'
377
+ , proto = C && C.prototype
378
+ , O = {};
379
+ function fixMethod(KEY, CHAIN){
380
+ var method = proto[KEY];
381
+ if($.FW)proto[KEY] = function(a, b){
382
+ var result = method.call(this, a === 0 ? 0 : a, b);
383
+ return CHAIN ? this : result;
384
+ };
385
+ }
386
+ if(!$.isFunction(C) || !(isWeak || !$iter.BUGGY && proto.forEach && proto.entries)){
387
+ // create collection constructor
388
+ C = common.getConstructor(NAME, IS_MAP, ADDER);
389
+ $.mix(C.prototype, methods);
390
+ } else {
391
+ var inst = new C
392
+ , chain = inst[ADDER](isWeak ? {} : -0, 1)
393
+ , buggyZero;
394
+ // wrap for init collections from iterable
395
+ if($iter.fail(function(iter){
396
+ new C(iter); // eslint-disable-line no-new
397
+ }) || $iter.DANGER_CLOSING){
398
+ C = function(iterable){
399
+ assertInstance(this, C, NAME);
400
+ var that = new Base;
401
+ if(iterable != undefined)$iter.forOf(iterable, IS_MAP, that[ADDER], that);
402
+ return that;
403
+ };
404
+ C.prototype = proto;
405
+ if($.FW)proto.constructor = C;
406
+ }
407
+ isWeak || inst.forEach(function(val, key){
408
+ buggyZero = 1 / key === -Infinity;
409
+ });
410
+ // fix converting -0 key to +0
411
+ if(buggyZero){
412
+ fixMethod('delete');
413
+ fixMethod('has');
414
+ IS_MAP && fixMethod('get');
415
+ }
416
+ // + fix .add & .set for chaining
417
+ if(buggyZero || chain !== inst)fixMethod(ADDER, true);
418
+ }
419
+
420
+ require('./$.cof').set(C, NAME);
421
+ require('./$.species')(C);
422
+
423
+ O[NAME] = C;
424
+ $def($def.G + $def.W + $def.F * (C != Base), O);
425
+
426
+ // add .keys, .values, .entries, [@@iterator]
427
+ // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
428
+ if(!isWeak)$iter.std(
429
+ C, NAME,
430
+ common.getIterConstructor(), common.next,
431
+ IS_MAP ? 'key+value' : 'value' , !IS_MAP, true
432
+ );
433
+
434
+ return C;
435
+ };
436
+ },{"./$":15,"./$.assert":4,"./$.cof":6,"./$.def":11,"./$.iter":14,"./$.species":21}],10:[function(require,module,exports){
138
437
  // Optional / simple context binding
139
- function ctx(fn, that, length){
438
+ var assertFunction = require('./$.assert').fn;
439
+ module.exports = function(fn, that, length){
140
440
  assertFunction(fn);
141
441
  if(~length && that === undefined)return fn;
142
442
  switch(length){
143
443
  case 1: return function(a){
144
444
  return fn.call(that, a);
145
- }
445
+ };
146
446
  case 2: return function(a, b){
147
447
  return fn.call(that, a, b);
148
- }
448
+ };
149
449
  case 3: return function(a, b, c){
150
450
  return fn.call(that, a, b, c);
151
- }
451
+ };
152
452
  } return function(/* ...args */){
153
453
  return fn.apply(that, arguments);
454
+ };
455
+ };
456
+ },{"./$.assert":4}],11:[function(require,module,exports){
457
+ var $ = require('./$')
458
+ , global = $.g
459
+ , core = $.core
460
+ , isFunction = $.isFunction;
461
+ function ctx(fn, that){
462
+ return function(){
463
+ return fn.apply(that, arguments);
464
+ };
465
+ }
466
+ global.core = core;
467
+ // type bitmap
468
+ $def.F = 1; // forced
469
+ $def.G = 2; // global
470
+ $def.S = 4; // static
471
+ $def.P = 8; // proto
472
+ $def.B = 16; // bind
473
+ $def.W = 32; // wrap
474
+ function $def(type, name, source){
475
+ var key, own, out, exp
476
+ , isGlobal = type & $def.G
477
+ , target = isGlobal ? global : type & $def.S
478
+ ? global[name] : (global[name] || {}).prototype
479
+ , exports = isGlobal ? core : core[name] || (core[name] = {});
480
+ if(isGlobal)source = name;
481
+ for(key in source){
482
+ // contains in native
483
+ own = !(type & $def.F) && target && key in target;
484
+ // export native or passed
485
+ out = (own ? target : source)[key];
486
+ // bind timers to global for call from export context
487
+ if(type & $def.B && own)exp = ctx(out, global);
488
+ else exp = type & $def.P && isFunction(out) ? ctx(Function.call, out) : out;
489
+ // extend global
490
+ if(target && !own){
491
+ if(isGlobal)target[key] = out;
492
+ else delete target[key] && $.hide(target, key, out);
493
+ }
494
+ // export
495
+ if(exports[key] != out)$.hide(exports, key, exp);
154
496
  }
155
497
  }
498
+ module.exports = $def;
499
+ },{"./$":15}],12:[function(require,module,exports){
500
+ module.exports = function($){
501
+ $.FW = true;
502
+ $.path = $.g;
503
+ return $;
504
+ };
505
+ },{}],13:[function(require,module,exports){
156
506
  // Fast apply
157
507
  // http://jsperf.lnkit.com/fast-apply/5
158
- function invoke(fn, args, that){
508
+ module.exports = function(fn, args, that){
159
509
  var un = that === undefined;
160
- switch(args.length | 0){
510
+ switch(args.length){
161
511
  case 0: return un ? fn()
162
512
  : fn.call(that);
163
513
  case 1: return un ? fn(args[0])
@@ -171,215 +521,175 @@ function invoke(fn, args, that){
171
521
  case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4])
172
522
  : fn.call(that, args[0], args[1], args[2], args[3], args[4]);
173
523
  } return fn.apply(that, args);
524
+ };
525
+ },{}],14:[function(require,module,exports){
526
+ 'use strict';
527
+ var $ = require('./$')
528
+ , ctx = require('./$.ctx')
529
+ , cof = require('./$.cof')
530
+ , $def = require('./$.def')
531
+ , assertObject = require('./$.assert').obj
532
+ , SYMBOL_ITERATOR = require('./$.wks')('iterator')
533
+ , FF_ITERATOR = '@@iterator'
534
+ , Iterators = {}
535
+ , IteratorPrototype = {};
536
+ // Safari has byggy iterators w/o `next`
537
+ var BUGGY = 'keys' in [] && !('next' in [].keys());
538
+ // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
539
+ setIterator(IteratorPrototype, $.that);
540
+ function setIterator(O, value){
541
+ $.hide(O, SYMBOL_ITERATOR, value);
542
+ // Add iterator for FF iterator protocol
543
+ if(FF_ITERATOR in [])$.hide(O, FF_ITERATOR, value);
174
544
  }
175
-
176
- // Object:
177
- var create = Object.create
178
- , getPrototypeOf = Object.getPrototypeOf
179
- , setPrototypeOf = Object.setPrototypeOf
180
- , defineProperty = Object.defineProperty
181
- , defineProperties = Object.defineProperties
182
- , getOwnDescriptor = Object.getOwnPropertyDescriptor
183
- , getKeys = Object.keys
184
- , getNames = Object.getOwnPropertyNames
185
- , getSymbols = Object.getOwnPropertySymbols
186
- , isFrozen = Object.isFrozen
187
- , has = ctx(call, ObjectProto[HAS_OWN], 2)
188
- // Dummy, fix for not array-like ES3 string in es5 module
189
- , ES5Object = Object
190
- , Dict;
191
- function toObject(it){
192
- return ES5Object(assertDefined(it));
193
- }
194
- function returnIt(it){
195
- return it;
196
- }
197
- function returnThis(){
198
- return this;
545
+ function defineIterator(Constructor, NAME, value, DEFAULT){
546
+ var proto = Constructor.prototype
547
+ , iter = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] || value;
548
+ // Define iterator
549
+ if($.FW)setIterator(proto, iter);
550
+ if(iter !== value){
551
+ var iterProto = $.getProto(iter.call(new Constructor));
552
+ // Set @@toStringTag to native iterators
553
+ cof.set(iterProto, NAME + ' Iterator', true);
554
+ // FF fix
555
+ if($.FW)$.has(proto, FF_ITERATOR) && setIterator(iterProto, $.that);
556
+ }
557
+ // Plug for library
558
+ Iterators[NAME] = iter;
559
+ // FF & v8 fix
560
+ Iterators[NAME + ' Iterator'] = $.that;
561
+ return iter;
199
562
  }
200
- function get(object, key){
201
- if(has(object, key))return object[key];
563
+ function getIterator(it){
564
+ var Symbol = $.g.Symbol
565
+ , ext = it[Symbol && Symbol.iterator || FF_ITERATOR]
566
+ , getIter = ext || it[SYMBOL_ITERATOR] || Iterators[cof.classof(it)];
567
+ return assertObject(getIter.call(it));
202
568
  }
203
- function ownKeys(it){
204
- assertObject(it);
205
- return getSymbols ? getNames(it).concat(getSymbols(it)) : getNames(it);
569
+ function closeIterator(iterator){
570
+ var ret = iterator['return'];
571
+ if(ret !== undefined)assertObject(ret.call(iterator));
206
572
  }
207
- // 19.1.2.1 Object.assign(target, source, ...)
208
- var assign = Object.assign || function(target, source){
209
- var T = Object(assertDefined(target))
210
- , l = arguments.length
211
- , i = 1;
212
- while(l > i){
213
- var S = ES5Object(arguments[i++])
214
- , keys = getKeys(S)
215
- , length = keys.length
216
- , j = 0
217
- , key;
218
- while(length > j)T[key = keys[j++]] = S[key];
573
+ function stepCall(iterator, fn, value, entries){
574
+ try {
575
+ return entries ? fn(assertObject(value)[0], value[1]) : fn(value);
576
+ } catch(e){
577
+ closeIterator(iterator);
578
+ throw e;
219
579
  }
220
- return T;
221
- }
222
- function keyOf(object, el){
223
- var O = toObject(object)
224
- , keys = getKeys(O)
225
- , length = keys.length
226
- , index = 0
227
- , key;
228
- while(length > index)if(O[key = keys[index++]] === el)return key;
229
- }
230
-
231
- // Array
232
- // array('str1,str2,str3') => ['str1', 'str2', 'str3']
233
- function array(it){
234
- return String(it).split(',');
235
580
  }
236
- var push = ArrayProto.push
237
- , unshift = ArrayProto.unshift
238
- , slice = ArrayProto.slice
239
- , splice = ArrayProto.splice
240
- , indexOf = ArrayProto.indexOf
241
- , forEach = ArrayProto[FOR_EACH];
242
- /*
243
- * 0 -> forEach
244
- * 1 -> map
245
- * 2 -> filter
246
- * 3 -> some
247
- * 4 -> every
248
- * 5 -> find
249
- * 6 -> findIndex
250
- */
251
- function createArrayMethod(type){
252
- var isMap = type == 1
253
- , isFilter = type == 2
254
- , isSome = type == 3
255
- , isEvery = type == 4
256
- , isFindIndex = type == 6
257
- , noholes = type == 5 || isFindIndex;
258
- return function(callbackfn/*, that = undefined */){
259
- var O = Object(assertDefined(this))
260
- , that = arguments[1]
261
- , self = ES5Object(O)
262
- , f = ctx(callbackfn, that, 3)
263
- , length = toLength(self.length)
264
- , index = 0
265
- , result = isMap ? Array(length) : isFilter ? [] : undefined
266
- , val, res;
267
- for(;length > index; index++)if(noholes || index in self){
268
- val = self[index];
269
- res = f(val, index, O);
270
- if(type){
271
- if(isMap)result[index] = res; // map
272
- else if(res)switch(type){
273
- case 3: return true; // some
274
- case 5: return val; // find
275
- case 6: return index; // findIndex
276
- case 2: result.push(val); // filter
277
- } else if(isEvery)return false; // every
581
+ var DANGER_CLOSING = true;
582
+ !function(){
583
+ try {
584
+ var iter = [1].keys();
585
+ iter['return'] = function(){ DANGER_CLOSING = false; };
586
+ Array.from(iter, function(){ throw 2; });
587
+ } catch(e){ /* empty */ }
588
+ }();
589
+ var $iter = module.exports = {
590
+ BUGGY: BUGGY,
591
+ DANGER_CLOSING: DANGER_CLOSING,
592
+ fail: function(exec){
593
+ var fail = true;
594
+ try {
595
+ var arr = [[{}, 1]]
596
+ , iter = arr[SYMBOL_ITERATOR]()
597
+ , next = iter.next;
598
+ iter.next = function(){
599
+ fail = false;
600
+ return next.call(this);
601
+ };
602
+ arr[SYMBOL_ITERATOR] = function(){
603
+ return iter;
604
+ };
605
+ exec(arr);
606
+ } catch(e){ /* empty */ }
607
+ return fail;
608
+ },
609
+ Iterators: Iterators,
610
+ prototype: IteratorPrototype,
611
+ step: function(done, value){
612
+ return {value: value, done: !!done};
613
+ },
614
+ stepCall: stepCall,
615
+ close: closeIterator,
616
+ is: function(it){
617
+ var O = Object(it)
618
+ , Symbol = $.g.Symbol
619
+ , SYM = Symbol && Symbol.iterator || FF_ITERATOR;
620
+ return SYM in O || SYMBOL_ITERATOR in O || $.has(Iterators, cof.classof(O));
621
+ },
622
+ get: getIterator,
623
+ set: setIterator,
624
+ create: function(Constructor, NAME, next, proto){
625
+ Constructor.prototype = $.create(proto || $iter.prototype, {next: $.desc(1, next)});
626
+ cof.set(Constructor, NAME + ' Iterator');
627
+ },
628
+ define: defineIterator,
629
+ std: function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){
630
+ function createIter(kind){
631
+ return function(){
632
+ return new Constructor(this, kind);
633
+ };
634
+ }
635
+ $iter.create(Constructor, NAME, next);
636
+ var entries = createIter('key+value')
637
+ , values = createIter('value')
638
+ , proto = Base.prototype
639
+ , methods, key;
640
+ if(DEFAULT == 'value')values = defineIterator(Base, NAME, values, 'values');
641
+ else entries = defineIterator(Base, NAME, entries, 'entries');
642
+ if(DEFAULT){
643
+ methods = {
644
+ entries: entries,
645
+ keys: IS_SET ? values : createIter('key'),
646
+ values: values
647
+ };
648
+ $def($def.P + $def.F * BUGGY, NAME, methods);
649
+ if(FORCE)for(key in methods){
650
+ if(!(key in proto))$.hide(proto, key, methods[key]);
278
651
  }
279
652
  }
280
- return isFindIndex ? -1 : isSome || isEvery ? isEvery : result;
281
- }
282
- }
283
- function createArrayContains(isContains){
284
- return function(el /*, fromIndex = 0 */){
285
- var O = toObject(this)
286
- , length = toLength(O.length)
287
- , index = toIndex(arguments[1], length);
288
- if(isContains && el != el){
289
- for(;length > index; index++)if(sameNaN(O[index]))return isContains || index;
290
- } else for(;length > index; index++)if(isContains || index in O){
291
- if(O[index] === el)return isContains || index;
292
- } return !isContains && -1;
293
- }
294
- }
295
- function generic(A, B){
296
- // strange IE quirks mode bug -> use typeof vs isFunction
297
- return typeof A == 'function' ? A : B;
298
- }
299
-
300
- // Math
301
- var MAX_SAFE_INTEGER = 0x1fffffffffffff // pow(2, 53) - 1 == 9007199254740991
302
- , pow = Math.pow
303
- , abs = Math.abs
304
- , ceil = Math.ceil
305
- , floor = Math.floor
306
- , max = Math.max
307
- , min = Math.min
308
- , random = Math.random
309
- , trunc = Math.trunc || function(it){
310
- return (it > 0 ? floor : ceil)(it);
653
+ },
654
+ forOf: function(iterable, entries, fn, that){
655
+ var iterator = getIterator(iterable)
656
+ , f = ctx(fn, that, entries ? 2 : 1)
657
+ , step;
658
+ while(!(step = iterator.next()).done){
659
+ if(stepCall(iterator, f, step.value, entries) === false){
660
+ return closeIterator(iterator);
661
+ }
311
662
  }
312
- // 20.1.2.4 Number.isNaN(number)
313
- function sameNaN(number){
314
- return number != number;
315
- }
663
+ }
664
+ };
665
+ },{"./$":15,"./$.assert":4,"./$.cof":6,"./$.ctx":10,"./$.def":11,"./$.wks":26}],15:[function(require,module,exports){
666
+ 'use strict';
667
+ var global = typeof self != 'undefined' ? self : Function('return this')()
668
+ , core = {}
669
+ , defineProperty = Object.defineProperty
670
+ , hasOwnProperty = {}.hasOwnProperty
671
+ , ceil = Math.ceil
672
+ , floor = Math.floor
673
+ , max = Math.max
674
+ , min = Math.min;
675
+ // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty.
676
+ var DESC = !!function(){
677
+ try {
678
+ return defineProperty({}, 'a', {get: function(){ return 2; }}).a == 2;
679
+ } catch(e){ /* empty */ }
680
+ }();
681
+ var hide = createDefiner(1);
316
682
  // 7.1.4 ToInteger
317
683
  function toInteger(it){
318
- return isNaN(it) ? 0 : trunc(it);
319
- }
320
- // 7.1.15 ToLength
321
- function toLength(it){
322
- return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0;
323
- }
324
- function toIndex(index, length){
325
- var index = toInteger(index);
326
- return index < 0 ? max(index + length, 0) : min(index, length);
327
- }
328
- function lz(num){
329
- return num > 9 ? num : '0' + num;
330
- }
331
-
332
- function createReplacer(regExp, replace, isStatic){
333
- var replacer = isObject(replace) ? function(part){
334
- return replace[part];
335
- } : replace;
336
- return function(it){
337
- return String(isStatic ? it : this).replace(regExp, replacer);
338
- }
339
- }
340
- function createPointAt(toString){
341
- return function(pos){
342
- var s = String(assertDefined(this))
343
- , i = toInteger(pos)
344
- , l = s.length
345
- , a, b;
346
- if(i < 0 || i >= l)return toString ? '' : undefined;
347
- a = s.charCodeAt(i);
348
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
349
- ? toString ? s.charAt(i) : a
350
- : toString ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
351
- }
684
+ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
352
685
  }
353
-
354
- // Assertion & errors
355
- var REDUCE_ERROR = 'Reduce of empty object with no initial value';
356
- function assert(condition, msg1, msg2){
357
- if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1);
358
- }
359
- function assertDefined(it){
360
- if(it == undefined)throw TypeError('Function called on null or undefined');
361
- return it;
362
- }
363
- function assertFunction(it){
364
- assert(isFunction(it), it, ' is not a function!');
365
- return it;
366
- }
367
- function assertObject(it){
368
- assert(isObject(it), it, ' is not an object!');
369
- return it;
370
- }
371
- function assertInstance(it, Constructor, name){
372
- assert(it instanceof Constructor, name, ": use the 'new' operator!");
373
- }
374
-
375
- // Property descriptors & Symbol
376
- function descriptor(bitmap, value){
686
+ function desc(bitmap, value){
377
687
  return {
378
688
  enumerable : !(bitmap & 1),
379
689
  configurable: !(bitmap & 2),
380
690
  writable : !(bitmap & 4),
381
691
  value : value
382
- }
692
+ };
383
693
  }
384
694
  function simpleSet(object, key, value){
385
695
  object[key] = value;
@@ -387,884 +697,224 @@ function simpleSet(object, key, value){
387
697
  }
388
698
  function createDefiner(bitmap){
389
699
  return DESC ? function(object, key, value){
390
- return defineProperty(object, key, descriptor(bitmap, value));
700
+ return $.setDesc(object, key, desc(bitmap, value)); // eslint-disable-line no-use-before-define
391
701
  } : simpleSet;
392
702
  }
393
- function uid(key){
394
- return SYMBOL + '(' + key + ')_' + (++sid + random())[TO_STRING](36);
703
+
704
+ function isObject(it){
705
+ return it !== null && (typeof it == 'object' || typeof it == 'function');
395
706
  }
396
- function getWellKnownSymbol(name, setter){
397
- return (Symbol && Symbol[name]) || (setter ? Symbol : safeSymbol)(SYMBOL + DOT + name);
707
+ function isFunction(it){
708
+ return typeof it == 'function';
398
709
  }
399
- // The engine works fine with descriptors? Thank's IE8 for his funny defineProperty.
400
- var DESC = !!function(){
401
- try {
402
- return defineProperty({}, 'a', {get: function(){ return 2 }}).a == 2;
403
- } catch(e){}
404
- }()
405
- , sid = 0
406
- , hidden = createDefiner(1)
407
- , set = Symbol ? simpleSet : hidden
408
- , safeSymbol = Symbol || uid;
409
- function assignHidden(target, src){
410
- for(var key in src)hidden(target, key, src[key]);
411
- return target;
710
+ function assertDefined(it){
711
+ if(it == undefined)throw TypeError("Can't call method on " + it);
712
+ return it;
412
713
  }
413
714
 
414
- var SYMBOL_UNSCOPABLES = getWellKnownSymbol('unscopables')
415
- , ArrayUnscopables = ArrayProto[SYMBOL_UNSCOPABLES] || {}
416
- , SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG)
417
- , SYMBOL_SPECIES = getWellKnownSymbol('species')
418
- , SYMBOL_ITERATOR;
419
- function setSpecies(C){
420
- if(DESC && (framework || !isNative(C)))defineProperty(C, SYMBOL_SPECIES, {
421
- configurable: true,
422
- get: returnThis
423
- });
424
- }
425
-
426
- /******************************************************************************
427
- * Module : common.export *
428
- ******************************************************************************/
429
-
430
- var NODE = cof(process) == PROCESS
431
- , core = {}
432
- , path = framework ? global : core
433
- , old = global.core
434
- , exportGlobal
435
- // type bitmap
436
- , FORCED = 1
437
- , GLOBAL = 2
438
- , STATIC = 4
439
- , PROTO = 8
440
- , BIND = 16
441
- , WRAP = 32;
442
- function $define(type, name, source){
443
- var key, own, out, exp
444
- , isGlobal = type & GLOBAL
445
- , target = isGlobal ? global : (type & STATIC)
446
- ? global[name] : (global[name] || ObjectProto)[PROTOTYPE]
447
- , exports = isGlobal ? core : core[name] || (core[name] = {});
448
- if(isGlobal)source = name;
449
- for(key in source){
450
- // there is a similar native
451
- own = !(type & FORCED) && target && key in target
452
- && (!isFunction(target[key]) || isNative(target[key]));
453
- // export native or passed
454
- out = (own ? target : source)[key];
455
- // prevent global pollution for namespaces
456
- if(!framework && isGlobal && !isFunction(target[key]))exp = source[key];
457
- // bind timers to global for call from export context
458
- else if(type & BIND && own)exp = ctx(out, global);
459
- // wrap global constructors for prevent change them in library
460
- else if(type & WRAP && !framework && target[key] == out){
461
- exp = function(param){
462
- return this instanceof out ? new out(param) : out(param);
463
- }
464
- exp[PROTOTYPE] = out[PROTOTYPE];
465
- } else exp = type & PROTO && isFunction(out) ? ctx(call, out) : out;
466
- // extend global
467
- if(framework && target && !own){
468
- if(isGlobal)target[key] = out;
469
- else delete target[key] && hidden(target, key, out);
470
- }
471
- // export
472
- if(exports[key] != out)hidden(exports, key, exp);
473
- }
474
- }
475
- // CommonJS export
476
- if(typeof module != 'undefined' && module.exports)module.exports = core;
477
- // RequireJS export
478
- else if(isFunction(define) && define.amd)define(function(){return core});
479
- // Export to global object
480
- else exportGlobal = true;
481
- if(exportGlobal || framework){
482
- core.noConflict = function(){
483
- global.core = old;
484
- return core;
485
- }
486
- global.core = core;
487
- }
488
-
489
- /******************************************************************************
490
- * Module : common.iterators *
491
- ******************************************************************************/
492
-
493
- SYMBOL_ITERATOR = getWellKnownSymbol(ITERATOR);
494
- var ITER = safeSymbol('iter')
495
- , KEY = 1
496
- , VALUE = 2
497
- , Iterators = {}
498
- , IteratorPrototype = {}
499
- // Safari has byggy iterators w/o `next`
500
- , BUGGY_ITERATORS = 'keys' in ArrayProto && !('next' in [].keys());
501
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
502
- setIterator(IteratorPrototype, returnThis);
503
- function setIterator(O, value){
504
- hidden(O, SYMBOL_ITERATOR, value);
505
- // Add iterator for FF iterator protocol
506
- FF_ITERATOR in ArrayProto && hidden(O, FF_ITERATOR, value);
507
- }
508
- function createIterator(Constructor, NAME, next, proto){
509
- Constructor[PROTOTYPE] = create(proto || IteratorPrototype, {next: descriptor(1, next)});
510
- setToStringTag(Constructor, NAME + ' Iterator');
511
- }
512
- function defineIterator(Constructor, NAME, value, DEFAULT){
513
- var proto = Constructor[PROTOTYPE]
514
- , iter = get(proto, SYMBOL_ITERATOR) || get(proto, FF_ITERATOR) || (DEFAULT && get(proto, DEFAULT)) || value;
515
- if(framework){
516
- // Define iterator
517
- setIterator(proto, iter);
518
- if(iter !== value){
519
- var iterProto = getPrototypeOf(iter.call(new Constructor));
520
- // Set @@toStringTag to native iterators
521
- setToStringTag(iterProto, NAME + ' Iterator', true);
522
- // FF fix
523
- has(proto, FF_ITERATOR) && setIterator(iterProto, returnThis);
524
- }
525
- }
526
- // Plug for library
527
- Iterators[NAME] = iter;
528
- // FF & v8 fix
529
- Iterators[NAME + ' Iterator'] = returnThis;
530
- return iter;
531
- }
532
- function defineStdIterators(Base, NAME, Constructor, next, DEFAULT, IS_SET){
533
- function createIter(kind){
534
- return function(){
535
- return new Constructor(this, kind);
536
- }
537
- }
538
- createIterator(Constructor, NAME, next);
539
- var entries = createIter(KEY+VALUE)
540
- , values = createIter(VALUE);
541
- if(DEFAULT == VALUE)values = defineIterator(Base, NAME, values, 'values');
542
- else entries = defineIterator(Base, NAME, entries, 'entries');
543
- if(DEFAULT){
544
- $define(PROTO + FORCED * BUGGY_ITERATORS, NAME, {
545
- entries: entries,
546
- keys: IS_SET ? values : createIter(KEY),
547
- values: values
548
- });
549
- }
550
- }
551
- function iterResult(done, value){
552
- return {value: value, done: !!done};
553
- }
554
- function isIterable(it){
555
- var O = Object(it)
556
- , Symbol = global[SYMBOL]
557
- , hasExt = (Symbol && Symbol[ITERATOR] || FF_ITERATOR) in O;
558
- return hasExt || SYMBOL_ITERATOR in O || has(Iterators, classof(O));
559
- }
560
- function getIterator(it){
561
- var Symbol = global[SYMBOL]
562
- , ext = it[Symbol && Symbol[ITERATOR] || FF_ITERATOR]
563
- , getIter = ext || it[SYMBOL_ITERATOR] || Iterators[classof(it)];
564
- return assertObject(getIter.call(it));
565
- }
566
- function stepCall(fn, value, entries){
567
- return entries ? invoke(fn, value) : fn(value);
568
- }
569
- function checkDangerIterClosing(fn){
570
- var danger = true;
571
- var O = {
572
- next: function(){ throw 1 },
573
- 'return': function(){ danger = false }
574
- };
575
- O[SYMBOL_ITERATOR] = returnThis;
576
- try {
577
- fn(O);
578
- } catch(e){}
579
- return danger;
580
- }
581
- function closeIterator(iterator){
582
- var ret = iterator['return'];
583
- if(ret !== undefined)ret.call(iterator);
584
- }
585
- function safeIterClose(exec, iterator){
586
- try {
587
- exec(iterator);
588
- } catch(e){
589
- closeIterator(iterator);
590
- throw e;
591
- }
592
- }
593
- function forOf(iterable, entries, fn, that){
594
- safeIterClose(function(iterator){
595
- var f = ctx(fn, that, entries ? 2 : 1)
596
- , step;
597
- while(!(step = iterator.next()).done)if(stepCall(f, step.value, entries) === false){
598
- return closeIterator(iterator);
599
- }
600
- }, getIterator(iterable));
601
- }
602
-
603
- /******************************************************************************
604
- * Module : es6.symbol *
605
- ******************************************************************************/
606
-
607
- // ECMAScript 6 symbols shim
608
- !function(TAG, SymbolRegistry, AllSymbols, setter){
609
- // 19.4.1.1 Symbol([description])
610
- if(!isNative(Symbol)){
611
- Symbol = function(description){
612
- assert(!(this instanceof Symbol), SYMBOL + ' is not a ' + CONSTRUCTOR);
613
- var tag = uid(description)
614
- , sym = set(create(Symbol[PROTOTYPE]), TAG, tag);
615
- AllSymbols[tag] = sym;
616
- DESC && setter && defineProperty(ObjectProto, tag, {
617
- configurable: true,
618
- set: function(value){
619
- hidden(this, tag, value);
620
- }
621
- });
622
- return sym;
623
- }
624
- hidden(Symbol[PROTOTYPE], TO_STRING, function(){
625
- return this[TAG];
626
- });
627
- }
628
- $define(GLOBAL + WRAP, {Symbol: Symbol});
629
-
630
- var symbolStatics = {
631
- // 19.4.2.1 Symbol.for(key)
632
- 'for': function(key){
633
- return has(SymbolRegistry, key += '')
634
- ? SymbolRegistry[key]
635
- : SymbolRegistry[key] = Symbol(key);
636
- },
637
- // 19.4.2.4 Symbol.iterator
638
- iterator: SYMBOL_ITERATOR || getWellKnownSymbol(ITERATOR),
639
- // 19.4.2.5 Symbol.keyFor(sym)
640
- keyFor: part.call(keyOf, SymbolRegistry),
641
- // 19.4.2.10 Symbol.species
642
- species: SYMBOL_SPECIES,
643
- // 19.4.2.13 Symbol.toStringTag
644
- toStringTag: SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG, true),
645
- // 19.4.2.14 Symbol.unscopables
646
- unscopables: SYMBOL_UNSCOPABLES,
647
- pure: safeSymbol,
648
- set: set,
649
- useSetter: function(){setter = true},
650
- useSimple: function(){setter = false}
715
+ var $ = module.exports = require('./$.fw')({
716
+ g: global,
717
+ core: core,
718
+ html: global.document && document.documentElement,
719
+ // http://jsperf.com/core-js-isobject
720
+ isObject: isObject,
721
+ isFunction: isFunction,
722
+ it: function(it){
723
+ return it;
724
+ },
725
+ that: function(){
726
+ return this;
727
+ },
728
+ // 7.1.4 ToInteger
729
+ toInteger: toInteger,
730
+ // 7.1.15 ToLength
731
+ toLength: function(it){
732
+ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
733
+ },
734
+ toIndex: function(index, length){
735
+ index = toInteger(index);
736
+ return index < 0 ? max(index + length, 0) : min(index, length);
737
+ },
738
+ has: function(it, key){
739
+ return hasOwnProperty.call(it, key);
740
+ },
741
+ create: Object.create,
742
+ getProto: Object.getPrototypeOf,
743
+ DESC: DESC,
744
+ desc: desc,
745
+ getDesc: Object.getOwnPropertyDescriptor,
746
+ setDesc: defineProperty,
747
+ getKeys: Object.keys,
748
+ getNames: Object.getOwnPropertyNames,
749
+ getSymbols: Object.getOwnPropertySymbols,
750
+ // Dummy, fix for not array-like ES3 string in es5 module
751
+ assertDefined: assertDefined,
752
+ ES5Object: Object,
753
+ toObject: function(it){
754
+ return $.ES5Object(assertDefined(it));
755
+ },
756
+ hide: hide,
757
+ def: createDefiner(0),
758
+ set: global.Symbol ? simpleSet : hide,
759
+ mix: function(target, src){
760
+ for(var key in src)hide(target, key, src[key]);
761
+ return target;
762
+ },
763
+ each: [].forEach
764
+ });
765
+ if(typeof __e != 'undefined')__e = core;
766
+ if(typeof __g != 'undefined')__g = global;
767
+ },{"./$.fw":12}],16:[function(require,module,exports){
768
+ var $ = require('./$');
769
+ module.exports = function(object, el){
770
+ var O = $.toObject(object)
771
+ , keys = $.getKeys(O)
772
+ , length = keys.length
773
+ , index = 0
774
+ , key;
775
+ while(length > index)if(O[key = keys[index++]] === el)return key;
776
+ };
777
+ },{"./$":15}],17:[function(require,module,exports){
778
+ var $ = require('./$')
779
+ , assertObject = require('./$.assert').obj;
780
+ module.exports = function(it){
781
+ assertObject(it);
782
+ return $.getSymbols ? $.getNames(it).concat($.getSymbols(it)) : $.getNames(it);
783
+ };
784
+ },{"./$":15,"./$.assert":4}],18:[function(require,module,exports){
785
+ 'use strict';
786
+ var $ = require('./$')
787
+ , invoke = require('./$.invoke')
788
+ , assertFunction = require('./$.assert').fn;
789
+ module.exports = function(/* ...pargs */){
790
+ var fn = assertFunction(this)
791
+ , length = arguments.length
792
+ , pargs = Array(length)
793
+ , i = 0
794
+ , _ = $.path._
795
+ , holder = false;
796
+ while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true;
797
+ return function(/* ...args */){
798
+ var that = this
799
+ , _length = arguments.length
800
+ , j = 0, k = 0, args;
801
+ if(!holder && !_length)return invoke(fn, pargs, that);
802
+ args = pargs.slice();
803
+ if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++];
804
+ while(_length > k)args.push(arguments[k++]);
805
+ return invoke(fn, args, that);
651
806
  };
652
- // 19.4.2.2 Symbol.hasInstance
653
- // 19.4.2.3 Symbol.isConcatSpreadable
654
- // 19.4.2.6 Symbol.match
655
- // 19.4.2.8 Symbol.replace
656
- // 19.4.2.9 Symbol.search
657
- // 19.4.2.11 Symbol.split
658
- // 19.4.2.12 Symbol.toPrimitive
659
- forEach.call(array('hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive'),
660
- function(it){
661
- symbolStatics[it] = getWellKnownSymbol(it);
662
- }
663
- );
664
- $define(STATIC, SYMBOL, symbolStatics);
665
-
666
- setToStringTag(Symbol, SYMBOL);
667
-
668
- $define(STATIC + FORCED * !isNative(Symbol), OBJECT, {
669
- // 19.1.2.7 Object.getOwnPropertyNames(O)
670
- getOwnPropertyNames: function(it){
671
- var names = getNames(toObject(it)), result = [], key, i = 0;
672
- while(names.length > i)has(AllSymbols, key = names[i++]) || result.push(key);
673
- return result;
674
- },
675
- // 19.1.2.8 Object.getOwnPropertySymbols(O)
676
- getOwnPropertySymbols: function(it){
677
- var names = getNames(toObject(it)), result = [], key, i = 0;
678
- while(names.length > i)has(AllSymbols, key = names[i++]) && result.push(AllSymbols[key]);
679
- return result;
680
- }
681
- });
682
-
683
- // 20.2.1.9 Math[@@toStringTag]
684
- setToStringTag(Math, MATH, true);
685
- // 24.3.3 JSON[@@toStringTag]
686
- setToStringTag(global.JSON, 'JSON', true);
687
- }(safeSymbol('tag'), {}, {}, true);
688
-
689
- /******************************************************************************
690
- * Module : es6.object.statics *
691
- ******************************************************************************/
692
-
693
- !function(){
694
- var objectStatic = {
695
- // 19.1.3.1 Object.assign(target, source)
696
- assign: assign,
697
- // 19.1.3.10 Object.is(value1, value2)
698
- is: function(x, y){
699
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
700
- }
807
+ };
808
+ },{"./$":15,"./$.assert":4,"./$.invoke":13}],19:[function(require,module,exports){
809
+ 'use strict';
810
+ module.exports = function(regExp, replace, isStatic){
811
+ var replacer = replace === Object(replace) ? function(part){
812
+ return replace[part];
813
+ } : replace;
814
+ return function(it){
815
+ return String(isStatic ? it : this).replace(regExp, replacer);
701
816
  };
702
- // 19.1.3.19 Object.setPrototypeOf(O, proto)
703
- // Works with __proto__ only. Old v8 can't works with null proto objects.
704
- '__proto__' in ObjectProto && function(buggy, set){
705
- try {
706
- set = ctx(call, getOwnDescriptor(ObjectProto, '__proto__').set, 2);
707
- set({}, ArrayProto);
708
- } catch(e){ buggy = true }
709
- objectStatic.setPrototypeOf = setPrototypeOf = setPrototypeOf || function(O, proto){
710
- assertObject(O);
711
- assert(proto === null || isObject(proto), proto, ": can't set as prototype!");
712
- if(buggy)O.__proto__ = proto;
713
- else set(O, proto);
714
- return O;
715
- }
716
- }();
717
- $define(STATIC, OBJECT, objectStatic);
718
- }();
719
-
720
- /******************************************************************************
721
- * Module : es6.object.prototype *
722
- ******************************************************************************/
723
-
724
- !function(tmp){
725
- // 19.1.3.6 Object.prototype.toString()
726
- tmp[SYMBOL_TAG] = DOT;
727
- if(cof(tmp) != DOT)hidden(ObjectProto, TO_STRING, function(){
728
- return '[object ' + classof(this) + ']';
729
- });
730
- }({});
731
-
732
- /******************************************************************************
733
- * Module : es6.object.statics-accept-primitives *
734
- ******************************************************************************/
735
-
736
- !function(){
737
- // Object static methods accept primitives
738
- function wrapObjectMethod(key, MODE){
739
- var fn = Object[key]
740
- , exp = core[OBJECT][key]
741
- , f = 0
742
- , o = {};
743
- if(!exp || isNative(exp)){
744
- o[key] = MODE == 1 ? function(it){
745
- return isObject(it) ? fn(it) : it;
746
- } : MODE == 2 ? function(it){
747
- return isObject(it) ? fn(it) : true;
748
- } : MODE == 3 ? function(it){
749
- return isObject(it) ? fn(it) : false;
750
- } : MODE == 4 ? function(it, key){
751
- return fn(toObject(it), key);
752
- } : function(it){
753
- return fn(toObject(it));
817
+ };
818
+ },{}],20:[function(require,module,exports){
819
+ // Works with __proto__ only. Old v8 can't works with null proto objects.
820
+ /*eslint-disable no-proto */
821
+ var $ = require('./$')
822
+ , assert = require('./$.assert');
823
+ module.exports = Object.setPrototypeOf || ('__proto__' in {} // eslint-disable-line
824
+ ? function(buggy, set){
825
+ try {
826
+ set = require('./$.ctx')(Function.call, $.getDesc(Object.prototype, '__proto__').set, 2);
827
+ set({}, []);
828
+ } catch(e){ buggy = true; }
829
+ return function(O, proto){
830
+ assert.obj(O);
831
+ assert(proto === null || $.isObject(proto), proto, ": can't set as prototype!");
832
+ if(buggy)O.__proto__ = proto;
833
+ else set(O, proto);
834
+ return O;
754
835
  };
755
- try { fn(DOT) }
756
- catch(e){ f = 1 }
757
- $define(STATIC + FORCED * f, OBJECT, o);
758
- }
759
- }
760
- wrapObjectMethod('freeze', 1);
761
- wrapObjectMethod('seal', 1);
762
- wrapObjectMethod('preventExtensions', 1);
763
- wrapObjectMethod('isFrozen', 2);
764
- wrapObjectMethod('isSealed', 2);
765
- wrapObjectMethod('isExtensible', 3);
766
- wrapObjectMethod('getOwnPropertyDescriptor', 4);
767
- wrapObjectMethod('getPrototypeOf');
768
- wrapObjectMethod('keys');
769
- wrapObjectMethod('getOwnPropertyNames');
770
- }();
771
-
772
- /******************************************************************************
773
- * Module : es6.function *
774
- ******************************************************************************/
775
-
776
- !function(NAME){
777
- // 19.2.4.2 name
778
- NAME in FunctionProto || (DESC && defineProperty(FunctionProto, NAME, {
836
+ }()
837
+ : undefined);
838
+ },{"./$":15,"./$.assert":4,"./$.ctx":10}],21:[function(require,module,exports){
839
+ var $ = require('./$');
840
+ module.exports = function(C){
841
+ if($.DESC && $.FW)$.setDesc(C, require('./$.wks')('species'), {
779
842
  configurable: true,
780
- get: function(){
781
- var match = String(this).match(/^\s*function ([^ (]*)/)
782
- , name = match ? match[1] : '';
783
- has(this, NAME) || defineProperty(this, NAME, descriptor(5, name));
784
- return name;
785
- },
786
- set: function(value){
787
- has(this, NAME) || defineProperty(this, NAME, descriptor(0, value));
788
- }
789
- }));
790
- }('name');
791
-
792
- /******************************************************************************
793
- * Module : es6.number.constructor *
794
- ******************************************************************************/
795
-
796
- Number('0o1') && Number('0b1') || function(_Number, NumberProto){
797
- function toNumber(it){
798
- if(isObject(it))it = toPrimitive(it);
799
- if(typeof it == 'string' && it.length > 2 && it.charCodeAt(0) == 48){
800
- var binary = false;
801
- switch(it.charCodeAt(1)){
802
- case 66 : case 98 : binary = true;
803
- case 79 : case 111 : return parseInt(it.slice(2), binary ? 2 : 8);
804
- }
805
- } return +it;
806
- }
807
- function toPrimitive(it){
808
- var fn, val;
809
- if(isFunction(fn = it.valueOf) && !isObject(val = fn.call(it)))return val;
810
- if(isFunction(fn = it[TO_STRING]) && !isObject(val = fn.call(it)))return val;
811
- throw TypeError("Can't convert object to number");
812
- }
813
- Number = function Number(it){
814
- return this instanceof Number ? new _Number(toNumber(it)) : toNumber(it);
815
- }
816
- forEach.call(DESC ? getNames(_Number)
817
- : array('MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY'), function(key){
818
- key in Number || defineProperty(Number, key, getOwnDescriptor(_Number, key));
819
- });
820
- Number[PROTOTYPE] = NumberProto;
821
- NumberProto[CONSTRUCTOR] = Number;
822
- hidden(global, NUMBER, Number);
823
- }(Number, Number[PROTOTYPE]);
824
-
825
- /******************************************************************************
826
- * Module : es6.number.statics *
827
- ******************************************************************************/
828
-
829
- !function(isInteger){
830
- $define(STATIC, NUMBER, {
831
- // 20.1.2.1 Number.EPSILON
832
- EPSILON: pow(2, -52),
833
- // 20.1.2.2 Number.isFinite(number)
834
- isFinite: function(it){
835
- return typeof it == 'number' && isFinite(it);
836
- },
837
- // 20.1.2.3 Number.isInteger(number)
838
- isInteger: isInteger,
839
- // 20.1.2.4 Number.isNaN(number)
840
- isNaN: sameNaN,
841
- // 20.1.2.5 Number.isSafeInteger(number)
842
- isSafeInteger: function(number){
843
- return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER;
844
- },
845
- // 20.1.2.6 Number.MAX_SAFE_INTEGER
846
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,
847
- // 20.1.2.10 Number.MIN_SAFE_INTEGER
848
- MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER,
849
- // 20.1.2.12 Number.parseFloat(string)
850
- parseFloat: parseFloat,
851
- // 20.1.2.13 Number.parseInt(string, radix)
852
- parseInt: parseInt
843
+ get: $.that
853
844
  });
854
- // 20.1.2.3 Number.isInteger(number)
855
- }(Number.isInteger || function(it){
856
- return !isObject(it) && isFinite(it) && floor(it) === it;
857
- });
858
-
859
- /******************************************************************************
860
- * Module : es6.math *
861
- ******************************************************************************/
862
-
863
- // ECMAScript 6 shim
864
- !function(){
865
- // 20.2.2.28 Math.sign(x)
866
- var E = Math.E
867
- , exp = Math.exp
868
- , log = Math.log
869
- , sqrt = Math.sqrt
870
- , sign = Math.sign || function(x){
871
- return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
872
- };
873
-
874
- // 20.2.2.5 Math.asinh(x)
875
- function asinh(x){
876
- return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
877
- }
878
- // 20.2.2.14 Math.expm1(x)
879
- function expm1(x){
880
- return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
881
- }
882
-
883
- $define(STATIC, MATH, {
884
- // 20.2.2.3 Math.acosh(x)
885
- acosh: function(x){
886
- return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x;
887
- },
888
- // 20.2.2.5 Math.asinh(x)
889
- asinh: asinh,
890
- // 20.2.2.7 Math.atanh(x)
891
- atanh: function(x){
892
- return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
893
- },
894
- // 20.2.2.9 Math.cbrt(x)
895
- cbrt: function(x){
896
- return sign(x = +x) * pow(abs(x), 1 / 3);
897
- },
898
- // 20.2.2.11 Math.clz32(x)
899
- clz32: function(x){
900
- return (x >>>= 0) ? 32 - x[TO_STRING](2).length : 32;
901
- },
902
- // 20.2.2.12 Math.cosh(x)
903
- cosh: function(x){
904
- return (exp(x = +x) + exp(-x)) / 2;
905
- },
906
- // 20.2.2.14 Math.expm1(x)
907
- expm1: expm1,
908
- // 20.2.2.16 Math.fround(x)
909
- // TODO: fallback for IE9-
910
- fround: function(x){
911
- return new Float32Array([x])[0];
912
- },
913
- // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
914
- hypot: function(value1, value2){
915
- var sum = 0
916
- , len1 = arguments.length
917
- , len2 = len1
918
- , args = Array(len1)
919
- , larg = -Infinity
920
- , arg;
921
- while(len1--){
922
- arg = args[len1] = +arguments[len1];
923
- if(arg == Infinity || arg == -Infinity)return Infinity;
924
- if(arg > larg)larg = arg;
925
- }
926
- larg = arg || 1;
927
- while(len2--)sum += pow(args[len2] / larg, 2);
928
- return larg * sqrt(sum);
929
- },
930
- // 20.2.2.18 Math.imul(x, y)
931
- imul: function(x, y){
932
- var UInt16 = 0xffff
933
- , xn = +x
934
- , yn = +y
935
- , xl = UInt16 & xn
936
- , yl = UInt16 & yn;
937
- return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0);
938
- },
939
- // 20.2.2.20 Math.log1p(x)
940
- log1p: function(x){
941
- return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
942
- },
943
- // 20.2.2.21 Math.log10(x)
944
- log10: function(x){
945
- return log(x) / Math.LN10;
946
- },
947
- // 20.2.2.22 Math.log2(x)
948
- log2: function(x){
949
- return log(x) / Math.LN2;
950
- },
951
- // 20.2.2.28 Math.sign(x)
952
- sign: sign,
953
- // 20.2.2.30 Math.sinh(x)
954
- sinh: function(x){
955
- return (abs(x = +x) < 1) ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
956
- },
957
- // 20.2.2.33 Math.tanh(x)
958
- tanh: function(x){
959
- var a = expm1(x = +x)
960
- , b = expm1(-x);
961
- return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
962
- },
963
- // 20.2.2.34 Math.trunc(x)
964
- trunc: trunc
965
- });
966
- }();
967
-
968
- /******************************************************************************
969
- * Module : es6.string *
970
- ******************************************************************************/
971
-
972
- !function(fromCharCode){
973
- function assertNotRegExp(it){
974
- if(cof(it) == REGEXP)throw TypeError();
975
- }
976
-
977
- $define(STATIC, STRING, {
978
- // 21.1.2.2 String.fromCodePoint(...codePoints)
979
- fromCodePoint: function(x){
980
- var res = []
981
- , len = arguments.length
982
- , i = 0
983
- , code
984
- while(len > i){
985
- code = +arguments[i++];
986
- if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
987
- res.push(code < 0x10000
988
- ? fromCharCode(code)
989
- : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
990
- );
991
- } return res.join('');
992
- },
993
- // 21.1.2.4 String.raw(callSite, ...substitutions)
994
- raw: function(callSite){
995
- var raw = toObject(callSite.raw)
996
- , len = toLength(raw.length)
997
- , sln = arguments.length
998
- , res = []
999
- , i = 0;
1000
- while(len > i){
1001
- res.push(String(raw[i++]));
1002
- if(i < sln)res.push(String(arguments[i]));
1003
- } return res.join('');
1004
- }
1005
- });
1006
-
1007
- $define(PROTO, STRING, {
1008
- // 21.1.3.3 String.prototype.codePointAt(pos)
1009
- codePointAt: createPointAt(false),
1010
- // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
1011
- endsWith: function(searchString /*, endPosition = @length */){
1012
- assertNotRegExp(searchString);
1013
- var that = String(assertDefined(this))
1014
- , endPosition = arguments[1]
1015
- , len = toLength(that.length)
1016
- , end = endPosition === undefined ? len : min(toLength(endPosition), len);
1017
- searchString += '';
1018
- return that.slice(end - searchString.length, end) === searchString;
1019
- },
1020
- // 21.1.3.7 String.prototype.includes(searchString, position = 0)
1021
- includes: function(searchString /*, position = 0 */){
1022
- assertNotRegExp(searchString);
1023
- return !!~String(assertDefined(this)).indexOf(searchString, arguments[1]);
1024
- },
1025
- // 21.1.3.13 String.prototype.repeat(count)
1026
- repeat: function(count){
1027
- var str = String(assertDefined(this))
1028
- , res = ''
1029
- , n = toInteger(count);
1030
- if(0 > n || n == Infinity)throw RangeError("Count can't be negative");
1031
- for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
1032
- return res;
1033
- },
1034
- // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
1035
- startsWith: function(searchString /*, position = 0 */){
1036
- assertNotRegExp(searchString);
1037
- var that = String(assertDefined(this))
1038
- , index = toLength(min(arguments[1], that.length));
1039
- searchString += '';
1040
- return that.slice(index, index + searchString.length) === searchString;
1041
- }
1042
- });
1043
- }(String.fromCharCode);
1044
-
1045
- /******************************************************************************
1046
- * Module : es6.array.statics *
1047
- ******************************************************************************/
1048
-
1049
- !function(){
1050
- $define(STATIC + FORCED * checkDangerIterClosing(Array.from), ARRAY, {
1051
- // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
1052
- from: function(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
1053
- var O = Object(assertDefined(arrayLike))
1054
- , mapfn = arguments[1]
1055
- , mapping = mapfn !== undefined
1056
- , f = mapping ? ctx(mapfn, arguments[2], 2) : undefined
1057
- , index = 0
1058
- , length, result, step;
1059
- if(isIterable(O)){
1060
- result = new (generic(this, Array));
1061
- safeIterClose(function(iterator){
1062
- for(; !(step = iterator.next()).done; index++){
1063
- result[index] = mapping ? f(step.value, index) : step.value;
1064
- }
1065
- }, getIterator(O));
1066
- } else {
1067
- result = new (generic(this, Array))(length = toLength(O.length));
1068
- for(; length > index; index++){
1069
- result[index] = mapping ? f(O[index], index) : O[index];
1070
- }
1071
- }
1072
- result.length = index;
1073
- return result;
1074
- }
1075
- });
1076
-
1077
- $define(STATIC, ARRAY, {
1078
- // 22.1.2.3 Array.of( ...items)
1079
- of: function(/* ...args */){
1080
- var index = 0
1081
- , length = arguments.length
1082
- , result = new (generic(this, Array))(length);
1083
- while(length > index)result[index] = arguments[index++];
1084
- result.length = length;
1085
- return result;
1086
- }
1087
- });
1088
-
1089
- setSpecies(Array);
1090
- }();
1091
-
1092
- /******************************************************************************
1093
- * Module : es6.array.prototype *
1094
- ******************************************************************************/
1095
-
1096
- !function(){
1097
- $define(PROTO, ARRAY, {
1098
- // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
1099
- copyWithin: function(target /* = 0 */, start /* = 0, end = @length */){
1100
- var O = Object(assertDefined(this))
1101
- , len = toLength(O.length)
1102
- , to = toIndex(target, len)
1103
- , from = toIndex(start, len)
1104
- , end = arguments[2]
1105
- , fin = end === undefined ? len : toIndex(end, len)
1106
- , count = min(fin - from, len - to)
1107
- , inc = 1;
1108
- if(from < to && to < from + count){
1109
- inc = -1;
1110
- from = from + count - 1;
1111
- to = to + count - 1;
1112
- }
1113
- while(count-- > 0){
1114
- if(from in O)O[to] = O[from];
1115
- else delete O[to];
1116
- to += inc;
1117
- from += inc;
1118
- } return O;
1119
- },
1120
- // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
1121
- fill: function(value /*, start = 0, end = @length */){
1122
- var O = Object(assertDefined(this))
1123
- , length = toLength(O.length)
1124
- , index = toIndex(arguments[1], length)
1125
- , end = arguments[2]
1126
- , endPos = end === undefined ? length : toIndex(end, length);
1127
- while(endPos > index)O[index++] = value;
1128
- return O;
1129
- },
1130
- // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
1131
- find: createArrayMethod(5),
1132
- // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
1133
- findIndex: createArrayMethod(6)
1134
- });
1135
-
1136
- if(framework){
1137
- // 22.1.3.31 Array.prototype[@@unscopables]
1138
- forEach.call(array('find,findIndex,fill,copyWithin,entries,keys,values'), function(it){
1139
- ArrayUnscopables[it] = true;
1140
- });
1141
- SYMBOL_UNSCOPABLES in ArrayProto || hidden(ArrayProto, SYMBOL_UNSCOPABLES, ArrayUnscopables);
1142
- }
1143
- }();
1144
-
1145
- /******************************************************************************
1146
- * Module : es6.iterators *
1147
- ******************************************************************************/
1148
-
1149
- !function(at){
1150
- // 22.1.3.4 Array.prototype.entries()
1151
- // 22.1.3.13 Array.prototype.keys()
1152
- // 22.1.3.29 Array.prototype.values()
1153
- // 22.1.3.30 Array.prototype[@@iterator]()
1154
- defineStdIterators(Array, ARRAY, function(iterated, kind){
1155
- set(this, ITER, {o: toObject(iterated), i: 0, k: kind});
1156
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
1157
- }, function(){
1158
- var iter = this[ITER]
1159
- , O = iter.o
1160
- , kind = iter.k
1161
- , index = iter.i++;
1162
- if(!O || index >= O.length){
1163
- iter.o = undefined;
1164
- return iterResult(1);
1165
- }
1166
- if(kind == KEY) return iterResult(0, index);
1167
- if(kind == VALUE)return iterResult(0, O[index]);
1168
- return iterResult(0, [index, O[index]]);
1169
- }, VALUE);
1170
-
1171
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
1172
- Iterators[ARGUMENTS] = Iterators[ARRAY];
1173
-
1174
- // 21.1.3.27 String.prototype[@@iterator]()
1175
- defineStdIterators(String, STRING, function(iterated){
1176
- set(this, ITER, {o: String(iterated), i: 0});
1177
- // 21.1.5.2.1 %StringIteratorPrototype%.next()
1178
- }, function(){
1179
- var iter = this[ITER]
1180
- , O = iter.o
1181
- , index = iter.i
1182
- , point;
1183
- if(index >= O.length)return iterResult(1);
1184
- point = at.call(O, index);
1185
- iter.i += point.length;
1186
- return iterResult(0, point);
1187
- });
1188
- }(createPointAt(true));
1189
-
1190
- /******************************************************************************
1191
- * Module : es6.regexp *
1192
- ******************************************************************************/
1193
-
1194
- DESC && !function(RegExpProto, _RegExp){
1195
- // RegExp allows a regex with flags as the pattern
1196
- if(!function(){try{return RegExp(/a/g, 'i') == '/a/i'}catch(e){}}()){
1197
- RegExp = function RegExp(pattern, flags){
1198
- return new _RegExp(cof(pattern) == REGEXP && flags !== undefined
1199
- ? pattern.source : pattern, flags);
1200
- }
1201
- forEach.call(getNames(_RegExp), function(key){
1202
- key in RegExp || defineProperty(RegExp, key, {
1203
- configurable: true,
1204
- get: function(){ return _RegExp[key] },
1205
- set: function(it){ _RegExp[key] = it }
1206
- });
1207
- });
1208
- RegExpProto[CONSTRUCTOR] = RegExp;
1209
- RegExp[PROTOTYPE] = RegExpProto;
1210
- hidden(global, REGEXP, RegExp);
845
+ };
846
+ },{"./$":15,"./$.wks":26}],22:[function(require,module,exports){
847
+ 'use strict';
848
+ // true -> String#at
849
+ // false -> String#codePointAt
850
+ var $ = require('./$');
851
+ module.exports = function(TO_STRING){
852
+ return function(pos){
853
+ var s = String($.assertDefined(this))
854
+ , i = $.toInteger(pos)
855
+ , l = s.length
856
+ , a, b;
857
+ if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
858
+ a = s.charCodeAt(i);
859
+ return a < 0xd800 || a > 0xdbff || i + 1 === l
860
+ || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
861
+ ? TO_STRING ? s.charAt(i) : a
862
+ : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
863
+ };
864
+ };
865
+ },{"./$":15}],23:[function(require,module,exports){
866
+ 'use strict';
867
+ var $ = require('./$')
868
+ , ctx = require('./$.ctx')
869
+ , cof = require('./$.cof')
870
+ , invoke = require('./$.invoke')
871
+ , global = $.g
872
+ , isFunction = $.isFunction
873
+ , setTask = global.setImmediate
874
+ , clearTask = global.clearImmediate
875
+ , postMessage = global.postMessage
876
+ , addEventListener = global.addEventListener
877
+ , MessageChannel = global.MessageChannel
878
+ , counter = 0
879
+ , queue = {}
880
+ , ONREADYSTATECHANGE = 'onreadystatechange'
881
+ , defer, channel, port;
882
+ function run(){
883
+ var id = +this;
884
+ if($.has(queue, id)){
885
+ var fn = queue[id];
886
+ delete queue[id];
887
+ fn();
1211
888
  }
1212
-
1213
- // 21.2.5.3 get RegExp.prototype.flags()
1214
- if(/./g.flags != 'g')defineProperty(RegExpProto, 'flags', {
1215
- configurable: true,
1216
- get: createReplacer(/^.*\/(\w*)$/, '$1')
1217
- });
1218
-
1219
- setSpecies(RegExp);
1220
- }(RegExp[PROTOTYPE], RegExp);
1221
-
1222
- /******************************************************************************
1223
- * Module : web.immediate *
1224
- ******************************************************************************/
1225
-
1226
- // setImmediate shim
1227
- // Node.js 0.9+ & IE10+ has setImmediate, else:
1228
- isFunction(setImmediate) && isFunction(clearImmediate) || function(ONREADYSTATECHANGE){
1229
- var postMessage = global.postMessage
1230
- , addEventListener = global.addEventListener
1231
- , MessageChannel = global.MessageChannel
1232
- , counter = 0
1233
- , queue = {}
1234
- , defer, channel, port;
1235
- setImmediate = function(fn){
889
+ }
890
+ function listner(event){
891
+ run.call(event.data);
892
+ }
893
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
894
+ if(!isFunction(setTask) || !isFunction(clearTask)){
895
+ setTask = function(fn){
1236
896
  var args = [], i = 1;
1237
897
  while(arguments.length > i)args.push(arguments[i++]);
1238
898
  queue[++counter] = function(){
1239
899
  invoke(isFunction(fn) ? fn : Function(fn), args);
1240
- }
900
+ };
1241
901
  defer(counter);
1242
902
  return counter;
1243
- }
1244
- clearImmediate = function(id){
903
+ };
904
+ clearTask = function(id){
1245
905
  delete queue[id];
1246
- }
1247
- function run(id){
1248
- if(has(queue, id)){
1249
- var fn = queue[id];
1250
- delete queue[id];
1251
- fn();
1252
- }
1253
- }
1254
- function listner(event){
1255
- run(event.data);
1256
- }
906
+ };
1257
907
  // Node.js 0.8-
1258
- if(NODE){
908
+ if(cof(global.process) == 'process'){
1259
909
  defer = function(id){
1260
- nextTick(part.call(run, id));
1261
- }
910
+ global.process.nextTick(ctx(run, id, 1));
911
+ };
1262
912
  // Modern browsers, skip implementation for WebWorkers
1263
913
  // IE8 has postMessage, but it's sync & typeof its postMessage is object
1264
- } else if(addEventListener && isFunction(postMessage) && !global.importScripts){
914
+ } else if(addEventListener && isFunction(postMessage) && !$.g.importScripts){
1265
915
  defer = function(id){
1266
916
  postMessage(id, '*');
1267
- }
917
+ };
1268
918
  addEventListener('message', listner, false);
1269
919
  // WebWorkers
1270
920
  } else if(isFunction(MessageChannel)){
@@ -1273,724 +923,1546 @@ isFunction(setImmediate) && isFunction(clearImmediate) || function(ONREADYSTATEC
1273
923
  channel.port1.onmessage = listner;
1274
924
  defer = ctx(port.postMessage, port, 1);
1275
925
  // IE8-
1276
- } else if(document && ONREADYSTATECHANGE in document[CREATE_ELEMENT]('script')){
926
+ } else if($.g.document && ONREADYSTATECHANGE in document.createElement('script')){
1277
927
  defer = function(id){
1278
- html.appendChild(document[CREATE_ELEMENT]('script'))[ONREADYSTATECHANGE] = function(){
1279
- html.removeChild(this);
1280
- run(id);
1281
- }
1282
- }
928
+ $.html.appendChild(document.createElement('script'))[ONREADYSTATECHANGE] = function(){
929
+ $.html.removeChild(this);
930
+ run.call(id);
931
+ };
932
+ };
1283
933
  // Rest old browsers
1284
934
  } else {
1285
935
  defer = function(id){
1286
- setTimeout(run, 0, id);
1287
- }
936
+ setTimeout(ctx(run, id, 1), 0);
937
+ };
1288
938
  }
1289
- }('onreadystatechange');
1290
- $define(GLOBAL + BIND, {
1291
- setImmediate: setImmediate,
1292
- clearImmediate: clearImmediate
1293
- });
1294
-
1295
- /******************************************************************************
1296
- * Module : es6.promise *
1297
- ******************************************************************************/
1298
-
1299
- // ES6 promises shim
1300
- // Based on https://github.com/getify/native-promise-only/
1301
- !function(Promise, test){
1302
- isFunction(Promise) && isFunction(Promise.resolve)
1303
- && Promise.resolve(test = new Promise(function(){})) == test
1304
- || function(asap, RECORD){
1305
- function isThenable(it){
1306
- var then;
1307
- if(isObject(it))then = it.then;
1308
- return isFunction(then) ? then : false;
1309
- }
1310
- function handledRejectionOrHasOnRejected(promise){
1311
- var record = promise[RECORD]
1312
- , chain = record.c
1313
- , i = 0
1314
- , react;
1315
- if(record.h)return true;
1316
- while(chain.length > i){
1317
- react = chain[i++];
1318
- if(react.fail || handledRejectionOrHasOnRejected(react.P))return true;
1319
- }
939
+ }
940
+ module.exports = {
941
+ set: setTask,
942
+ clear: clearTask
943
+ };
944
+ },{"./$":15,"./$.cof":6,"./$.ctx":10,"./$.invoke":13}],24:[function(require,module,exports){
945
+ var sid = 0;
946
+ function uid(key){
947
+ return 'Symbol(' + key + ')_' + (++sid + Math.random()).toString(36);
948
+ }
949
+ uid.safe = require('./$').g.Symbol || uid;
950
+ module.exports = uid;
951
+ },{"./$":15}],25:[function(require,module,exports){
952
+ // 22.1.3.31 Array.prototype[@@unscopables]
953
+ var $ = require('./$')
954
+ , UNSCOPABLES = require('./$.wks')('unscopables');
955
+ if($.FW && !(UNSCOPABLES in []))$.hide(Array.prototype, UNSCOPABLES, {});
956
+ module.exports = function(key){
957
+ if($.FW)[][UNSCOPABLES][key] = true;
958
+ };
959
+ },{"./$":15,"./$.wks":26}],26:[function(require,module,exports){
960
+ var global = require('./$').g
961
+ , store = {};
962
+ module.exports = function(name){
963
+ return store[name] || (store[name] =
964
+ global.Symbol && global.Symbol[name] || require('./$.uid').safe('Symbol.' + name));
965
+ };
966
+ },{"./$":15,"./$.uid":24}],27:[function(require,module,exports){
967
+ var $ = require('./$')
968
+ , cof = require('./$.cof')
969
+ , $def = require('./$.def')
970
+ , invoke = require('./$.invoke')
971
+ , arrayMethod = require('./$.array-methods')
972
+ , IE_PROTO = require('./$.uid').safe('__proto__')
973
+ , assert = require('./$.assert')
974
+ , assertObject = assert.obj
975
+ , ObjectProto = Object.prototype
976
+ , A = []
977
+ , slice = A.slice
978
+ , indexOf = A.indexOf
979
+ , classof = cof.classof
980
+ , defineProperties = Object.defineProperties
981
+ , has = $.has
982
+ , defineProperty = $.setDesc
983
+ , getOwnDescriptor = $.getDesc
984
+ , isFunction = $.isFunction
985
+ , toObject = $.toObject
986
+ , toLength = $.toLength
987
+ , IE8_DOM_DEFINE = false;
988
+
989
+ if(!$.DESC){
990
+ try {
991
+ IE8_DOM_DEFINE = defineProperty(document.createElement('div'), 'x',
992
+ {get: function(){ return 8; }}
993
+ ).x == 8;
994
+ } catch(e){ /* empty */ }
995
+ $.setDesc = function(O, P, Attributes){
996
+ if(IE8_DOM_DEFINE)try {
997
+ return defineProperty(O, P, Attributes);
998
+ } catch(e){ /* empty */ }
999
+ if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
1000
+ if('value' in Attributes)assertObject(O)[P] = Attributes.value;
1001
+ return O;
1002
+ };
1003
+ $.getDesc = function(O, P){
1004
+ if(IE8_DOM_DEFINE)try {
1005
+ return getOwnDescriptor(O, P);
1006
+ } catch(e){ /* empty */ }
1007
+ if(has(O, P))return $.desc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]);
1008
+ };
1009
+ defineProperties = function(O, Properties){
1010
+ assertObject(O);
1011
+ var keys = $.getKeys(Properties)
1012
+ , length = keys.length
1013
+ , i = 0
1014
+ , P;
1015
+ while(length > i)$.setDesc(O, P = keys[i++], Properties[P]);
1016
+ return O;
1017
+ };
1018
+ }
1019
+ $def($def.S + $def.F * !$.DESC, 'Object', {
1020
+ // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P)
1021
+ getOwnPropertyDescriptor: $.getDesc,
1022
+ // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
1023
+ defineProperty: $.setDesc,
1024
+ // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
1025
+ defineProperties: defineProperties
1026
+ });
1027
+
1028
+ // IE 8- don't enum bug keys
1029
+ var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' +
1030
+ 'toLocaleString,toString,valueOf').split(',')
1031
+ // Additional keys for getOwnPropertyNames
1032
+ , keys2 = keys1.concat('length', 'prototype')
1033
+ , keysLen1 = keys1.length;
1034
+
1035
+ // Create object with `null` prototype: use iframe Object with cleared prototype
1036
+ var createDict = function(){
1037
+ // Thrash, waste and sodomy: IE GC bug
1038
+ var iframe = document.createElement('iframe')
1039
+ , i = keysLen1
1040
+ , iframeDocument;
1041
+ iframe.style.display = 'none';
1042
+ $.html.appendChild(iframe);
1043
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
1044
+ // createDict = iframe.contentWindow.Object;
1045
+ // html.removeChild(iframe);
1046
+ iframeDocument = iframe.contentWindow.document;
1047
+ iframeDocument.open();
1048
+ iframeDocument.write('<script>document.F=Object</script>');
1049
+ iframeDocument.close();
1050
+ createDict = iframeDocument.F;
1051
+ while(i--)delete createDict.prototype[keys1[i]];
1052
+ return createDict();
1053
+ };
1054
+ function createGetKeys(names, length){
1055
+ return function(object){
1056
+ var O = toObject(object)
1057
+ , i = 0
1058
+ , result = []
1059
+ , key;
1060
+ for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
1061
+ // Don't enum bug & hidden keys
1062
+ while(length > i)if(has(O, key = names[i++])){
1063
+ ~indexOf.call(result, key) || result.push(key);
1320
1064
  }
1321
- function notify(record, reject){
1322
- var chain = record.c;
1323
- if(reject || chain.length)asap(function(){
1324
- var promise = record.p
1325
- , value = record.v
1326
- , ok = record.s == 1
1327
- , i = 0;
1328
- if(reject && !handledRejectionOrHasOnRejected(promise)){
1329
- setTimeout(function(){
1330
- if(!handledRejectionOrHasOnRejected(promise)){
1331
- if(NODE){
1332
- if(!process.emit('unhandledRejection', value, promise)){
1333
- // default node.js behavior
1334
- }
1335
- } else if(isFunction(console.error)){
1336
- console.error('Unhandled promise rejection', value);
1337
- }
1338
- }
1339
- }, 1e3);
1340
- } else while(chain.length > i)!function(react){
1341
- var cb = ok ? react.ok : react.fail
1342
- , ret, then;
1343
- try {
1344
- if(cb){
1345
- if(!ok)record.h = true;
1346
- ret = cb === true ? value : cb(value);
1347
- if(ret === react.P){
1348
- react.rej(TypeError(PROMISE + '-chain cycle'));
1349
- } else if(then = isThenable(ret)){
1350
- then.call(ret, react.res, react.rej);
1351
- } else react.res(ret);
1352
- } else react.rej(value);
1353
- } catch(err){
1354
- react.rej(err);
1355
- }
1356
- }(chain[i++]);
1357
- chain.length = 0;
1358
- });
1065
+ return result;
1066
+ };
1067
+ }
1068
+ function isPrimitive(it){ return !$.isObject(it); }
1069
+ function Empty(){}
1070
+ $def($def.S, 'Object', {
1071
+ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
1072
+ getPrototypeOf: $.getProto = $.getProto || function(O){
1073
+ O = Object(assert.def(O));
1074
+ if(has(O, IE_PROTO))return O[IE_PROTO];
1075
+ if(isFunction(O.constructor) && O instanceof O.constructor){
1076
+ return O.constructor.prototype;
1077
+ } return O instanceof Object ? ObjectProto : null;
1078
+ },
1079
+ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
1080
+ getOwnPropertyNames: $.getNames = $.getNames || createGetKeys(keys2, keys2.length, true),
1081
+ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
1082
+ create: $.create = $.create || function(O, /*?*/Properties){
1083
+ var result;
1084
+ if(O !== null){
1085
+ Empty.prototype = assertObject(O);
1086
+ result = new Empty();
1087
+ Empty.prototype = null;
1088
+ // add "__proto__" for Object.getPrototypeOf shim
1089
+ result[IE_PROTO] = O;
1090
+ } else result = createDict();
1091
+ return Properties === undefined ? result : defineProperties(result, Properties);
1092
+ },
1093
+ // 19.1.2.14 / 15.2.3.14 Object.keys(O)
1094
+ keys: $.getKeys = $.getKeys || createGetKeys(keys1, keysLen1, false),
1095
+ // 19.1.2.17 / 15.2.3.8 Object.seal(O)
1096
+ seal: $.it, // <- cap
1097
+ // 19.1.2.5 / 15.2.3.9 Object.freeze(O)
1098
+ freeze: $.it, // <- cap
1099
+ // 19.1.2.15 / 15.2.3.10 Object.preventExtensions(O)
1100
+ preventExtensions: $.it, // <- cap
1101
+ // 19.1.2.13 / 15.2.3.11 Object.isSealed(O)
1102
+ isSealed: isPrimitive, // <- cap
1103
+ // 19.1.2.12 / 15.2.3.12 Object.isFrozen(O)
1104
+ isFrozen: isPrimitive, // <- cap
1105
+ // 19.1.2.11 / 15.2.3.13 Object.isExtensible(O)
1106
+ isExtensible: $.isObject // <- cap
1107
+ });
1108
+
1109
+ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
1110
+ $def($def.P, 'Function', {
1111
+ bind: function(that /*, args... */){
1112
+ var fn = assert.fn(this)
1113
+ , partArgs = slice.call(arguments, 1);
1114
+ function bound(/* args... */){
1115
+ var args = partArgs.concat(slice.call(arguments));
1116
+ return invoke(fn, args, this instanceof bound ? $.create(fn.prototype) : that);
1359
1117
  }
1360
- function resolve(value){
1361
- var record = this
1362
- , then, wrapper;
1363
- if(record.d)return;
1364
- record.d = true;
1365
- record = record.r || record; // unwrap
1366
- try {
1367
- if(then = isThenable(value)){
1368
- wrapper = {r: record, d: false}; // wrap
1369
- then.call(value, ctx(resolve, wrapper, 1), ctx(reject, wrapper, 1));
1370
- } else {
1371
- record.v = value;
1372
- record.s = 1;
1373
- notify(record);
1374
- }
1375
- } catch(err){
1376
- reject.call(wrapper || {r: record, d: false}, err); // wrap
1118
+ if(fn.prototype)bound.prototype = fn.prototype;
1119
+ return bound;
1120
+ }
1121
+ });
1122
+
1123
+ // Fix for not array-like ES3 string
1124
+ function arrayMethodFix(fn){
1125
+ return function(){
1126
+ return fn.apply($.ES5Object(this), arguments);
1127
+ };
1128
+ }
1129
+ if(!(0 in Object('z') && 'z'[0] == 'z')){
1130
+ $.ES5Object = function(it){
1131
+ return cof(it) == 'String' ? it.split('') : Object(it);
1132
+ };
1133
+ }
1134
+ $def($def.P + $def.F * ($.ES5Object != Object), 'Array', {
1135
+ slice: arrayMethodFix(slice),
1136
+ join: arrayMethodFix(A.join)
1137
+ });
1138
+
1139
+ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
1140
+ $def($def.S, 'Array', {
1141
+ isArray: function(arg){
1142
+ return cof(arg) == 'Array';
1143
+ }
1144
+ });
1145
+ function createArrayReduce(isRight){
1146
+ return function(callbackfn, memo){
1147
+ assert.fn(callbackfn);
1148
+ var O = toObject(this)
1149
+ , length = toLength(O.length)
1150
+ , index = isRight ? length - 1 : 0
1151
+ , i = isRight ? -1 : 1;
1152
+ if(arguments.length < 2)for(;;){
1153
+ if(index in O){
1154
+ memo = O[index];
1155
+ index += i;
1156
+ break;
1377
1157
  }
1158
+ index += i;
1159
+ assert(isRight ? index >= 0 : length > index, 'Reduce of empty array with no initial value');
1378
1160
  }
1379
- function reject(value){
1380
- var record = this;
1381
- if(record.d)return;
1382
- record.d = true;
1383
- record = record.r || record; // unwrap
1384
- record.v = value;
1385
- record.s = 2;
1386
- notify(record, true);
1387
- }
1388
- function getConstructor(C){
1389
- var S = assertObject(C)[SYMBOL_SPECIES];
1390
- return S != undefined ? S : C;
1161
+ for(;isRight ? index >= 0 : length > index; index += i)if(index in O){
1162
+ memo = callbackfn(memo, O[index], index, this);
1391
1163
  }
1392
- // 25.4.3.1 Promise(executor)
1393
- Promise = function(executor){
1394
- assertFunction(executor);
1395
- assertInstance(this, Promise, PROMISE);
1396
- var record = {
1397
- p: this, // promise
1398
- c: [], // chain
1399
- s: 0, // state
1400
- d: false, // done
1401
- v: undefined, // value
1402
- h: false // handled rejection
1403
- };
1404
- hidden(this, RECORD, record);
1405
- try {
1406
- executor(ctx(resolve, record, 1), ctx(reject, record, 1));
1407
- } catch(err){
1408
- reject.call(record, err);
1409
- }
1164
+ return memo;
1165
+ };
1166
+ }
1167
+ $def($def.P, 'Array', {
1168
+ // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
1169
+ forEach: $.each = $.each || arrayMethod(0),
1170
+ // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
1171
+ map: arrayMethod(1),
1172
+ // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
1173
+ filter: arrayMethod(2),
1174
+ // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
1175
+ some: arrayMethod(3),
1176
+ // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
1177
+ every: arrayMethod(4),
1178
+ // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
1179
+ reduce: createArrayReduce(false),
1180
+ // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
1181
+ reduceRight: createArrayReduce(true),
1182
+ // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
1183
+ indexOf: indexOf = indexOf || require('./$.array-includes')(false),
1184
+ // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
1185
+ lastIndexOf: function(el, fromIndex /* = @[*-1] */){
1186
+ var O = toObject(this)
1187
+ , length = toLength(O.length)
1188
+ , index = length - 1;
1189
+ if(arguments.length > 1)index = Math.min(index, $.toInteger(fromIndex));
1190
+ if(index < 0)index = toLength(length + index);
1191
+ for(;index >= 0; index--)if(index in O)if(O[index] === el)return index;
1192
+ return -1;
1193
+ }
1194
+ });
1195
+
1196
+ // 21.1.3.25 / 15.5.4.20 String.prototype.trim()
1197
+ $def($def.P, 'String', {trim: require('./$.replacer')(/^\s*([\s\S]*\S)?\s*$/, '$1')});
1198
+
1199
+ // 20.3.3.1 / 15.9.4.4 Date.now()
1200
+ $def($def.S, 'Date', {now: function(){
1201
+ return +new Date;
1202
+ }});
1203
+
1204
+ function lz(num){
1205
+ return num > 9 ? num : '0' + num;
1206
+ }
1207
+ // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
1208
+ $def($def.P, 'Date', {toISOString: function(){
1209
+ if(!isFinite(this))throw RangeError('Invalid time value');
1210
+ var d = this
1211
+ , y = d.getUTCFullYear()
1212
+ , m = d.getUTCMilliseconds()
1213
+ , s = y < 0 ? '-' : y > 9999 ? '+' : '';
1214
+ return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
1215
+ '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
1216
+ 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
1217
+ ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
1218
+ }});
1219
+
1220
+ if(classof(function(){ return arguments; }()) == 'Object')cof.classof = function(it){
1221
+ var tag = classof(it);
1222
+ return tag == 'Object' && isFunction(it.callee) ? 'Arguments' : tag;
1223
+ };
1224
+ },{"./$":15,"./$.array-includes":2,"./$.array-methods":3,"./$.assert":4,"./$.cof":6,"./$.def":11,"./$.invoke":13,"./$.replacer":19,"./$.uid":24}],28:[function(require,module,exports){
1225
+ 'use strict';
1226
+ var $ = require('./$')
1227
+ , $def = require('./$.def')
1228
+ , toIndex = $.toIndex;
1229
+ $def($def.P, 'Array', {
1230
+ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
1231
+ copyWithin: function(target/* = 0 */, start /* = 0, end = @length */){
1232
+ var O = Object($.assertDefined(this))
1233
+ , len = $.toLength(O.length)
1234
+ , to = toIndex(target, len)
1235
+ , from = toIndex(start, len)
1236
+ , end = arguments[2]
1237
+ , fin = end === undefined ? len : toIndex(end, len)
1238
+ , count = Math.min(fin - from, len - to)
1239
+ , inc = 1;
1240
+ if(from < to && to < from + count){
1241
+ inc = -1;
1242
+ from = from + count - 1;
1243
+ to = to + count - 1;
1410
1244
  }
1411
- assignHidden(Promise[PROTOTYPE], {
1412
- // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
1413
- then: function(onFulfilled, onRejected){
1414
- var S = assertObject(assertObject(this)[CONSTRUCTOR])[SYMBOL_SPECIES];
1415
- var react = {
1416
- ok: isFunction(onFulfilled) ? onFulfilled : true,
1417
- fail: isFunction(onRejected) ? onRejected : false
1418
- } , P = react.P = new (S != undefined ? S : Promise)(function(resolve, reject){
1419
- react.res = assertFunction(resolve);
1420
- react.rej = assertFunction(reject);
1421
- }), record = this[RECORD];
1422
- record.c.push(react);
1423
- record.s && notify(record);
1424
- return P;
1425
- },
1426
- // 25.4.5.1 Promise.prototype.catch(onRejected)
1427
- 'catch': function(onRejected){
1428
- return this.then(undefined, onRejected);
1429
- }
1430
- });
1431
- assignHidden(Promise, {
1432
- // 25.4.4.1 Promise.all(iterable)
1433
- all: function(iterable){
1434
- var Promise = getConstructor(this)
1435
- , values = [];
1436
- return new Promise(function(resolve, reject){
1437
- forOf(iterable, false, push, values);
1438
- var remaining = values.length
1439
- , results = Array(remaining);
1440
- if(remaining)forEach.call(values, function(promise, index){
1441
- Promise.resolve(promise).then(function(value){
1442
- results[index] = value;
1443
- --remaining || resolve(results);
1444
- }, reject);
1445
- });
1446
- else resolve(results);
1447
- });
1448
- },
1449
- // 25.4.4.4 Promise.race(iterable)
1450
- race: function(iterable){
1451
- var Promise = getConstructor(this);
1452
- return new Promise(function(resolve, reject){
1453
- forOf(iterable, false, function(promise){
1454
- Promise.resolve(promise).then(resolve, reject);
1455
- });
1456
- });
1457
- },
1458
- // 25.4.4.5 Promise.reject(r)
1459
- reject: function(r){
1460
- return new (getConstructor(this))(function(resolve, reject){
1461
- reject(r);
1462
- });
1463
- },
1464
- // 25.4.4.6 Promise.resolve(x)
1465
- resolve: function(x){
1466
- return isObject(x) && RECORD in x && getPrototypeOf(x) === this[PROTOTYPE]
1467
- ? x : new (getConstructor(this))(function(resolve, reject){
1468
- resolve(x);
1469
- });
1245
+ while(count-- > 0){
1246
+ if(from in O)O[to] = O[from];
1247
+ else delete O[to];
1248
+ to += inc;
1249
+ from += inc;
1250
+ } return O;
1251
+ }
1252
+ });
1253
+ require('./$.unscope')('copyWithin');
1254
+ },{"./$":15,"./$.def":11,"./$.unscope":25}],29:[function(require,module,exports){
1255
+ 'use strict';
1256
+ var $ = require('./$')
1257
+ , $def = require('./$.def')
1258
+ , toIndex = $.toIndex;
1259
+ $def($def.P, 'Array', {
1260
+ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
1261
+ fill: function(value /*, start = 0, end = @length */){
1262
+ var O = Object($.assertDefined(this))
1263
+ , length = $.toLength(O.length)
1264
+ , index = toIndex(arguments[1], length)
1265
+ , end = arguments[2]
1266
+ , endPos = end === undefined ? length : toIndex(end, length);
1267
+ while(endPos > index)O[index++] = value;
1268
+ return O;
1269
+ }
1270
+ });
1271
+ require('./$.unscope')('fill');
1272
+ },{"./$":15,"./$.def":11,"./$.unscope":25}],30:[function(require,module,exports){
1273
+ var $def = require('./$.def');
1274
+ $def($def.P, 'Array', {
1275
+ // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
1276
+ findIndex: require('./$.array-methods')(6)
1277
+ });
1278
+ require('./$.unscope')('findIndex');
1279
+ },{"./$.array-methods":3,"./$.def":11,"./$.unscope":25}],31:[function(require,module,exports){
1280
+ var $def = require('./$.def');
1281
+ $def($def.P, 'Array', {
1282
+ // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
1283
+ find: require('./$.array-methods')(5)
1284
+ });
1285
+ require('./$.unscope')('find');
1286
+ },{"./$.array-methods":3,"./$.def":11,"./$.unscope":25}],32:[function(require,module,exports){
1287
+ var $ = require('./$')
1288
+ , ctx = require('./$.ctx')
1289
+ , $def = require('./$.def')
1290
+ , $iter = require('./$.iter')
1291
+ , stepCall = $iter.stepCall;
1292
+ $def($def.S + $def.F * $iter.DANGER_CLOSING, 'Array', {
1293
+ // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
1294
+ from: function(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
1295
+ var O = Object($.assertDefined(arrayLike))
1296
+ , mapfn = arguments[1]
1297
+ , mapping = mapfn !== undefined
1298
+ , f = mapping ? ctx(mapfn, arguments[2], 2) : undefined
1299
+ , index = 0
1300
+ , length, result, step, iterator;
1301
+ if($iter.is(O)){
1302
+ iterator = $iter.get(O);
1303
+ // strange IE quirks mode bug -> use typeof instead of isFunction
1304
+ result = new (typeof this == 'function' ? this : Array);
1305
+ for(; !(step = iterator.next()).done; index++){
1306
+ result[index] = mapping ? stepCall(iterator, f, [step.value, index], true) : step.value;
1470
1307
  }
1471
- });
1472
- }(nextTick || setImmediate, safeSymbol('record'));
1473
- setToStringTag(Promise, PROMISE);
1474
- setSpecies(Promise);
1475
- $define(GLOBAL + FORCED * !isNative(Promise), {Promise: Promise});
1476
- }(global[PROMISE]);
1477
-
1478
- /******************************************************************************
1479
- * Module : es6.collections *
1480
- ******************************************************************************/
1481
-
1482
- // ECMAScript 6 collections shim
1483
- !function(){
1484
- var UID = safeSymbol('uid')
1485
- , O1 = safeSymbol('O1')
1486
- , WEAK = safeSymbol('weak')
1487
- , LEAK = safeSymbol('leak')
1488
- , LAST = safeSymbol('last')
1489
- , FIRST = safeSymbol('first')
1490
- , SIZE = DESC ? safeSymbol('size') : 'size'
1491
- , uid = 0
1492
- , tmp = {};
1493
-
1494
- function getCollection(C, NAME, methods, commonMethods, isMap, isWeak){
1495
- var ADDER = isMap ? 'set' : 'add'
1496
- , proto = C && C[PROTOTYPE]
1497
- , O = {};
1498
- function initFromIterable(that, iterable){
1499
- if(iterable != undefined)forOf(iterable, isMap, that[ADDER], that);
1500
- return that;
1501
- }
1502
- function fixSVZ(key, chain){
1503
- var method = proto[key];
1504
- if(framework)proto[key] = function(a, b){
1505
- var result = method.call(this, a === 0 ? 0 : a, b);
1506
- return chain ? this : result;
1507
- };
1508
- }
1509
- if(!isNative(C) || !(isWeak || (!BUGGY_ITERATORS && has(proto, FOR_EACH) && has(proto, 'entries')))){
1510
- // create collection constructor
1511
- C = isWeak
1512
- ? function(iterable){
1513
- assertInstance(this, C, NAME);
1514
- set(this, UID, uid++);
1515
- initFromIterable(this, iterable);
1516
- }
1517
- : function(iterable){
1518
- var that = this;
1519
- assertInstance(that, C, NAME);
1520
- set(that, O1, create(null));
1521
- set(that, SIZE, 0);
1522
- set(that, LAST, undefined);
1523
- set(that, FIRST, undefined);
1524
- initFromIterable(that, iterable);
1525
- };
1526
- assignHidden(assignHidden(C[PROTOTYPE], methods), commonMethods);
1527
- isWeak || !DESC || defineProperty(C[PROTOTYPE], 'size', {get: function(){
1528
- return assertDefined(this[SIZE]);
1529
- }});
1530
1308
  } else {
1531
- var Native = C
1532
- , inst = new C
1533
- , chain = inst[ADDER](isWeak ? {} : -0, 1)
1534
- , buggyZero;
1535
- // wrap to init collections from iterable
1536
- if(checkDangerIterClosing(function(O){ new C(O) })){
1537
- C = function(iterable){
1538
- assertInstance(this, C, NAME);
1539
- return initFromIterable(new Native, iterable);
1540
- }
1541
- C[PROTOTYPE] = proto;
1542
- if(framework)proto[CONSTRUCTOR] = C;
1543
- }
1544
- isWeak || inst[FOR_EACH](function(val, key){
1545
- buggyZero = 1 / key === -Infinity;
1546
- });
1547
- // fix converting -0 key to +0
1548
- if(buggyZero){
1549
- fixSVZ('delete');
1550
- fixSVZ('has');
1551
- isMap && fixSVZ('get');
1309
+ // strange IE quirks mode bug -> use typeof instead of isFunction
1310
+ result = new (typeof this == 'function' ? this : Array)(length = $.toLength(O.length));
1311
+ for(; length > index; index++){
1312
+ result[index] = mapping ? f(O[index], index) : O[index];
1552
1313
  }
1553
- // + fix .add & .set for chaining
1554
- if(buggyZero || chain !== inst)fixSVZ(ADDER, true);
1555
1314
  }
1556
- setToStringTag(C, NAME);
1557
- setSpecies(C);
1558
-
1559
- O[NAME] = C;
1560
- $define(GLOBAL + WRAP + FORCED * !isNative(C), O);
1561
-
1562
- // add .keys, .values, .entries, [@@iterator]
1563
- // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
1564
- isWeak || defineStdIterators(C, NAME, function(iterated, kind){
1565
- set(this, ITER, {o: iterated, k: kind});
1566
- }, function(){
1567
- var iter = this[ITER]
1568
- , kind = iter.k
1569
- , entry = iter.l;
1570
- // revert to the last existing entry
1571
- while(entry && entry.r)entry = entry.p;
1572
- // get next entry
1573
- if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){
1574
- // or finish the iteration
1575
- iter.o = undefined;
1576
- return iterResult(1);
1577
- }
1578
- // return step by kind
1579
- if(kind == KEY) return iterResult(0, entry.k);
1580
- if(kind == VALUE)return iterResult(0, entry.v);
1581
- return iterResult(0, [entry.k, entry.v]);
1582
- }, isMap ? KEY+VALUE : VALUE, !isMap);
1583
-
1584
- return C;
1315
+ result.length = index;
1316
+ return result;
1585
1317
  }
1586
-
1587
- function fastKey(it, create){
1588
- // return primitive with prefix
1589
- if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it;
1590
- // can't set id to frozen object
1591
- if(isFrozen(it))return 'F';
1592
- if(!has(it, UID)){
1593
- // not necessary to add id
1594
- if(!create)return 'E';
1595
- // add missing object id
1596
- hidden(it, UID, ++uid);
1597
- // return object id with prefix
1598
- } return 'O' + it[UID];
1318
+ });
1319
+ },{"./$":15,"./$.ctx":10,"./$.def":11,"./$.iter":14}],33:[function(require,module,exports){
1320
+ var $ = require('./$')
1321
+ , setUnscope = require('./$.unscope')
1322
+ , ITER = require('./$.uid').safe('iter')
1323
+ , $iter = require('./$.iter')
1324
+ , step = $iter.step
1325
+ , Iterators = $iter.Iterators;
1326
+
1327
+ // 22.1.3.4 Array.prototype.entries()
1328
+ // 22.1.3.13 Array.prototype.keys()
1329
+ // 22.1.3.29 Array.prototype.values()
1330
+ // 22.1.3.30 Array.prototype[@@iterator]()
1331
+ $iter.std(Array, 'Array', function(iterated, kind){
1332
+ $.set(this, ITER, {o: $.toObject(iterated), i: 0, k: kind});
1333
+ // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
1334
+ }, function(){
1335
+ var iter = this[ITER]
1336
+ , O = iter.o
1337
+ , kind = iter.k
1338
+ , index = iter.i++;
1339
+ if(!O || index >= O.length){
1340
+ iter.o = undefined;
1341
+ return step(1);
1599
1342
  }
1600
- function getEntry(that, key){
1601
- // fast case
1602
- var index = fastKey(key), entry;
1603
- if(index != 'F')return that[O1][index];
1604
- // frozen object case
1605
- for(entry = that[FIRST]; entry; entry = entry.n){
1606
- if(entry.k == key)return entry;
1607
- }
1343
+ if(kind == 'key' )return step(0, index);
1344
+ if(kind == 'value')return step(0, O[index]);
1345
+ return step(0, [index, O[index]]);
1346
+ }, 'value');
1347
+
1348
+ // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
1349
+ Iterators.Arguments = Iterators.Array;
1350
+
1351
+ setUnscope('keys');
1352
+ setUnscope('values');
1353
+ setUnscope('entries');
1354
+ },{"./$":15,"./$.iter":14,"./$.uid":24,"./$.unscope":25}],34:[function(require,module,exports){
1355
+ var $def = require('./$.def');
1356
+ $def($def.S, 'Array', {
1357
+ // 22.1.2.3 Array.of( ...items)
1358
+ of: function(/* ...args */){
1359
+ var index = 0
1360
+ , length = arguments.length
1361
+ // strange IE quirks mode bug -> use typeof instead of isFunction
1362
+ , result = new (typeof this == 'function' ? this : Array)(length);
1363
+ while(length > index)result[index] = arguments[index++];
1364
+ result.length = length;
1365
+ return result;
1608
1366
  }
1609
- function def(that, key, value){
1610
- var entry = getEntry(that, key)
1611
- , prev, index;
1612
- // change existing entry
1613
- if(entry)entry.v = value;
1614
- // create new entry
1615
- else {
1616
- that[LAST] = entry = {
1617
- i: index = fastKey(key, true), // <- index
1618
- k: key, // <- key
1619
- v: value, // <- value
1620
- p: prev = that[LAST], // <- previous entry
1621
- n: undefined, // <- next entry
1622
- r: false // <- removed
1623
- };
1624
- if(!that[FIRST])that[FIRST] = entry;
1625
- if(prev)prev.n = entry;
1626
- that[SIZE]++;
1627
- // add to index
1628
- if(index != 'F')that[O1][index] = entry;
1629
- } return that;
1367
+ });
1368
+ },{"./$.def":11}],35:[function(require,module,exports){
1369
+ require('./$.species')(Array);
1370
+ },{"./$.species":21}],36:[function(require,module,exports){
1371
+ 'use strict';
1372
+ var $ = require('./$')
1373
+ , NAME = 'name'
1374
+ , setDesc = $.setDesc
1375
+ , FunctionProto = Function.prototype;
1376
+ // 19.2.4.2 name
1377
+ NAME in FunctionProto || $.FW && $.DESC && setDesc(FunctionProto, NAME, {
1378
+ configurable: true,
1379
+ get: function(){
1380
+ var match = String(this).match(/^\s*function ([^ (]*)/)
1381
+ , name = match ? match[1] : '';
1382
+ $.has(this, NAME) || setDesc(this, NAME, $.desc(5, name));
1383
+ return name;
1384
+ },
1385
+ set: function(value){
1386
+ $.has(this, NAME) || setDesc(this, NAME, $.desc(0, value));
1630
1387
  }
1388
+ });
1389
+ },{"./$":15}],37:[function(require,module,exports){
1390
+ 'use strict';
1391
+ var strong = require('./$.collection-strong');
1631
1392
 
1632
- var collectionMethods = {
1633
- // 23.1.3.1 Map.prototype.clear()
1634
- // 23.2.3.2 Set.prototype.clear()
1635
- clear: function(){
1636
- for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){
1637
- entry.r = true;
1638
- if(entry.p)entry.p = entry.p.n = undefined;
1639
- delete data[entry.i];
1640
- }
1641
- that[FIRST] = that[LAST] = undefined;
1642
- that[SIZE] = 0;
1643
- },
1644
- // 23.1.3.3 Map.prototype.delete(key)
1645
- // 23.2.3.4 Set.prototype.delete(value)
1646
- 'delete': function(key){
1647
- var that = this
1648
- , entry = getEntry(that, key);
1649
- if(entry){
1650
- var next = entry.n
1651
- , prev = entry.p;
1652
- delete that[O1][entry.i];
1653
- entry.r = true;
1654
- if(prev)prev.n = next;
1655
- if(next)next.p = prev;
1656
- if(that[FIRST] == entry)that[FIRST] = next;
1657
- if(that[LAST] == entry)that[LAST] = prev;
1658
- that[SIZE]--;
1659
- } return !!entry;
1660
- },
1661
- // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
1662
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
1663
- forEach: function(callbackfn /*, that = undefined */){
1664
- var f = ctx(callbackfn, arguments[1], 3)
1665
- , entry;
1666
- while(entry = entry ? entry.n : this[FIRST]){
1667
- f(entry.v, entry.k, this);
1668
- // revert to the last existing entry
1669
- while(entry && entry.r)entry = entry.p;
1670
- }
1671
- },
1672
- // 23.1.3.7 Map.prototype.has(key)
1673
- // 23.2.3.7 Set.prototype.has(value)
1674
- has: function(key){
1675
- return !!getEntry(this, key);
1676
- }
1393
+ // 23.1 Map Objects
1394
+ require('./$.collection')('Map', {
1395
+ // 23.1.3.6 Map.prototype.get(key)
1396
+ get: function(key){
1397
+ var entry = strong.getEntry(this, key);
1398
+ return entry && entry.v;
1399
+ },
1400
+ // 23.1.3.9 Map.prototype.set(key, value)
1401
+ set: function(key, value){
1402
+ return strong.def(this, key === 0 ? 0 : key, value);
1677
1403
  }
1678
-
1679
- // 23.1 Map Objects
1680
- Map = getCollection(Map, MAP, {
1681
- // 23.1.3.6 Map.prototype.get(key)
1682
- get: function(key){
1683
- var entry = getEntry(this, key);
1684
- return entry && entry.v;
1685
- },
1686
- // 23.1.3.9 Map.prototype.set(key, value)
1687
- set: function(key, value){
1688
- return def(this, key === 0 ? 0 : key, value);
1689
- }
1690
- }, collectionMethods, true);
1691
-
1692
- // 23.2 Set Objects
1693
- Set = getCollection(Set, SET, {
1694
- // 23.2.3.1 Set.prototype.add(value)
1695
- add: function(value){
1696
- return def(this, value = value === 0 ? 0 : value, value);
1404
+ }, strong, true);
1405
+ },{"./$.collection":9,"./$.collection-strong":7}],38:[function(require,module,exports){
1406
+ var Infinity = 1 / 0
1407
+ , $def = require('./$.def')
1408
+ , E = Math.E
1409
+ , pow = Math.pow
1410
+ , abs = Math.abs
1411
+ , exp = Math.exp
1412
+ , log = Math.log
1413
+ , sqrt = Math.sqrt
1414
+ , ceil = Math.ceil
1415
+ , floor = Math.floor
1416
+ , sign = Math.sign || function(x){
1417
+ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
1418
+ };
1419
+
1420
+ // 20.2.2.5 Math.asinh(x)
1421
+ function asinh(x){
1422
+ return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
1423
+ }
1424
+ // 20.2.2.14 Math.expm1(x)
1425
+ function expm1(x){
1426
+ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
1427
+ }
1428
+
1429
+ $def($def.S, 'Math', {
1430
+ // 20.2.2.3 Math.acosh(x)
1431
+ acosh: function(x){
1432
+ return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x;
1433
+ },
1434
+ // 20.2.2.5 Math.asinh(x)
1435
+ asinh: asinh,
1436
+ // 20.2.2.7 Math.atanh(x)
1437
+ atanh: function(x){
1438
+ return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
1439
+ },
1440
+ // 20.2.2.9 Math.cbrt(x)
1441
+ cbrt: function(x){
1442
+ return sign(x = +x) * pow(abs(x), 1 / 3);
1443
+ },
1444
+ // 20.2.2.11 Math.clz32(x)
1445
+ clz32: function(x){
1446
+ return (x >>>= 0) ? 32 - x.toString(2).length : 32;
1447
+ },
1448
+ // 20.2.2.12 Math.cosh(x)
1449
+ cosh: function(x){
1450
+ return (exp(x = +x) + exp(-x)) / 2;
1451
+ },
1452
+ // 20.2.2.14 Math.expm1(x)
1453
+ expm1: expm1,
1454
+ // 20.2.2.16 Math.fround(x)
1455
+ // TODO: fallback for IE9-
1456
+ fround: function(x){
1457
+ return new Float32Array([x])[0];
1458
+ },
1459
+ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
1460
+ hypot: function(value1, value2){ // eslint-disable-line no-unused-vars
1461
+ var sum = 0
1462
+ , len1 = arguments.length
1463
+ , len2 = len1
1464
+ , args = Array(len1)
1465
+ , larg = -Infinity
1466
+ , arg;
1467
+ while(len1--){
1468
+ arg = args[len1] = +arguments[len1];
1469
+ if(arg == Infinity || arg == -Infinity)return Infinity;
1470
+ if(arg > larg)larg = arg;
1697
1471
  }
1698
- }, collectionMethods);
1699
-
1700
- function defWeak(that, key, value){
1701
- if(isFrozen(assertObject(key)))leakStore(that).set(key, value);
1702
- else {
1703
- has(key, WEAK) || hidden(key, WEAK, {});
1704
- key[WEAK][that[UID]] = value;
1705
- } return that;
1706
- }
1707
- function leakStore(that){
1708
- return that[LEAK] || hidden(that, LEAK, new Map)[LEAK];
1472
+ larg = arg || 1;
1473
+ while(len2--)sum += pow(args[len2] / larg, 2);
1474
+ return larg * sqrt(sum);
1475
+ },
1476
+ // 20.2.2.18 Math.imul(x, y)
1477
+ imul: function(x, y){
1478
+ var UInt16 = 0xffff
1479
+ , xn = +x
1480
+ , yn = +y
1481
+ , xl = UInt16 & xn
1482
+ , yl = UInt16 & yn;
1483
+ return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0);
1484
+ },
1485
+ // 20.2.2.20 Math.log1p(x)
1486
+ log1p: function(x){
1487
+ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
1488
+ },
1489
+ // 20.2.2.21 Math.log10(x)
1490
+ log10: function(x){
1491
+ return log(x) / Math.LN10;
1492
+ },
1493
+ // 20.2.2.22 Math.log2(x)
1494
+ log2: function(x){
1495
+ return log(x) / Math.LN2;
1496
+ },
1497
+ // 20.2.2.28 Math.sign(x)
1498
+ sign: sign,
1499
+ // 20.2.2.30 Math.sinh(x)
1500
+ sinh: function(x){
1501
+ return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
1502
+ },
1503
+ // 20.2.2.33 Math.tanh(x)
1504
+ tanh: function(x){
1505
+ var a = expm1(x = +x)
1506
+ , b = expm1(-x);
1507
+ return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
1508
+ },
1509
+ // 20.2.2.34 Math.trunc(x)
1510
+ trunc: function(it){
1511
+ return (it > 0 ? floor : ceil)(it);
1709
1512
  }
1710
-
1711
- var weakMethods = {
1712
- // 23.3.3.2 WeakMap.prototype.delete(key)
1713
- // 23.4.3.3 WeakSet.prototype.delete(value)
1714
- 'delete': function(key){
1715
- if(!isObject(key))return false;
1716
- if(isFrozen(key))return leakStore(this)['delete'](key);
1717
- return has(key, WEAK) && has(key[WEAK], this[UID]) && delete key[WEAK][this[UID]];
1718
- },
1719
- // 23.3.3.4 WeakMap.prototype.has(key)
1720
- // 23.4.3.4 WeakSet.prototype.has(value)
1721
- has: function(key){
1722
- if(!isObject(key))return false;
1723
- if(isFrozen(key))return leakStore(this).has(key);
1724
- return has(key, WEAK) && has(key[WEAK], this[UID]);
1513
+ });
1514
+ },{"./$.def":11}],39:[function(require,module,exports){
1515
+ 'use strict';
1516
+ var $ = require('./$')
1517
+ , isObject = $.isObject
1518
+ , isFunction = $.isFunction
1519
+ , NUMBER = 'Number'
1520
+ , Number = $.g[NUMBER]
1521
+ , Base = Number
1522
+ , proto = Number.prototype;
1523
+ function toPrimitive(it){
1524
+ var fn, val;
1525
+ if(isFunction(fn = it.valueOf) && !isObject(val = fn.call(it)))return val;
1526
+ if(isFunction(fn = it.toString) && !isObject(val = fn.call(it)))return val;
1527
+ throw TypeError("Can't convert object to number");
1528
+ }
1529
+ function toNumber(it){
1530
+ if(isObject(it))it = toPrimitive(it);
1531
+ if(typeof it == 'string' && it.length > 2 && it.charCodeAt(0) == 48){
1532
+ var binary = false;
1533
+ switch(it.charCodeAt(1)){
1534
+ case 66 : case 98 : binary = true;
1535
+ case 79 : case 111 : return parseInt(it.slice(2), binary ? 2 : 8);
1725
1536
  }
1537
+ } return +it;
1538
+ }
1539
+ if($.FW && !(Number('0o1') && Number('0b1'))){
1540
+ Number = function Number(it){
1541
+ return this instanceof Number ? new Base(toNumber(it)) : toNumber(it);
1726
1542
  };
1727
-
1728
- // 23.3 WeakMap Objects
1729
- WeakMap = getCollection(WeakMap, WEAKMAP, {
1730
- // 23.3.3.3 WeakMap.prototype.get(key)
1731
- get: function(key){
1732
- if(isObject(key)){
1733
- if(isFrozen(key))return leakStore(this).get(key);
1734
- if(has(key, WEAK))return key[WEAK][this[UID]];
1543
+ $.each.call($.DESC ? $.getNames(Base) : (
1544
+ // ES3:
1545
+ 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
1546
+ // ES6 (in case, if modules with ES6 Number statics required before):
1547
+ 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
1548
+ 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
1549
+ ).split(','), function(key){
1550
+ if($.has(Base, key) && !$.has(Number, key)){
1551
+ $.setDesc(Number, key, $.getDesc(Base, key));
1735
1552
  }
1736
- },
1737
- // 23.3.3.5 WeakMap.prototype.set(key, value)
1738
- set: function(key, value){
1739
- return defWeak(this, key, value);
1740
1553
  }
1741
- }, weakMethods, true, true);
1742
-
1743
- // IE11 WeakMap frozen keys fix
1744
- if(framework && new WeakMap().set(Object.freeze(tmp), 7).get(tmp) != 7){
1745
- forEach.call(array('delete,has,get,set'), function(key){
1746
- var method = WeakMap[PROTOTYPE][key];
1747
- WeakMap[PROTOTYPE][key] = function(a, b){
1748
- // store frozen objects on leaky map
1749
- if(isObject(a) && isFrozen(a)){
1750
- var result = leakStore(this)[key](a, b);
1751
- return key == 'set' ? this : result;
1752
- // store all the rest on native weakmap
1753
- } return method.call(this, a, b);
1754
- };
1755
- });
1554
+ );
1555
+ Number.prototype = proto;
1556
+ proto.constructor = Number;
1557
+ $.hide($.g, NUMBER, Number);
1558
+ }
1559
+ },{"./$":15}],40:[function(require,module,exports){
1560
+ var $ = require('./$')
1561
+ , $def = require('./$.def')
1562
+ , abs = Math.abs
1563
+ , floor = Math.floor
1564
+ , MAX_SAFE_INTEGER = 0x1fffffffffffff; // pow(2, 53) - 1 == 9007199254740991;
1565
+ function isInteger(it){
1566
+ return !$.isObject(it) && isFinite(it) && floor(it) === it;
1567
+ }
1568
+ $def($def.S, 'Number', {
1569
+ // 20.1.2.1 Number.EPSILON
1570
+ EPSILON: Math.pow(2, -52),
1571
+ // 20.1.2.2 Number.isFinite(number)
1572
+ isFinite: function(it){
1573
+ return typeof it == 'number' && isFinite(it);
1574
+ },
1575
+ // 20.1.2.3 Number.isInteger(number)
1576
+ isInteger: isInteger,
1577
+ // 20.1.2.4 Number.isNaN(number)
1578
+ isNaN: function(number){
1579
+ return number != number;
1580
+ },
1581
+ // 20.1.2.5 Number.isSafeInteger(number)
1582
+ isSafeInteger: function(number){
1583
+ return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER;
1584
+ },
1585
+ // 20.1.2.6 Number.MAX_SAFE_INTEGER
1586
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,
1587
+ // 20.1.2.10 Number.MIN_SAFE_INTEGER
1588
+ MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER,
1589
+ // 20.1.2.12 Number.parseFloat(string)
1590
+ parseFloat: parseFloat,
1591
+ // 20.1.2.13 Number.parseInt(string, radix)
1592
+ parseInt: parseInt
1593
+ });
1594
+ },{"./$":15,"./$.def":11}],41:[function(require,module,exports){
1595
+ // 19.1.3.1 Object.assign(target, source)
1596
+ var $def = require('./$.def');
1597
+ $def($def.S, 'Object', {assign: require('./$.assign')});
1598
+ },{"./$.assign":5,"./$.def":11}],42:[function(require,module,exports){
1599
+ // 19.1.3.10 Object.is(value1, value2)
1600
+ var $def = require('./$.def');
1601
+ $def($def.S, 'Object', {
1602
+ is: function(x, y){
1603
+ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
1756
1604
  }
1757
-
1758
- // 23.4 WeakSet Objects
1759
- WeakSet = getCollection(WeakSet, WEAKSET, {
1760
- // 23.4.3.1 WeakSet.prototype.add(value)
1761
- add: function(value){
1762
- return defWeak(this, value, true);
1763
- }
1764
- }, weakMethods, false, true);
1765
- }();
1766
-
1767
- /******************************************************************************
1768
- * Module : es6.reflect *
1769
- ******************************************************************************/
1770
-
1771
- !function(){
1772
- function Enumerate(iterated){
1773
- var keys = [], key;
1774
- for(key in iterated)keys.push(key);
1775
- set(this, ITER, {o: iterated, a: keys, i: 0});
1605
+ });
1606
+ },{"./$.def":11}],43:[function(require,module,exports){
1607
+ // 19.1.3.19 Object.setPrototypeOf(O, proto)
1608
+ var $def = require('./$.def');
1609
+ $def($def.S, 'Object', {setPrototypeOf: require('./$.set-proto')});
1610
+ },{"./$.def":11,"./$.set-proto":20}],44:[function(require,module,exports){
1611
+ var $ = require('./$')
1612
+ , $def = require('./$.def')
1613
+ , isObject = $.isObject
1614
+ , toObject = $.toObject;
1615
+ function wrapObjectMethod(METHOD, MODE){
1616
+ var fn = ($.core.Object || {})[METHOD] || Object[METHOD]
1617
+ , f = 0
1618
+ , o = {};
1619
+ o[METHOD] = MODE == 1 ? function(it){
1620
+ return isObject(it) ? fn(it) : it;
1621
+ } : MODE == 2 ? function(it){
1622
+ return isObject(it) ? fn(it) : true;
1623
+ } : MODE == 3 ? function(it){
1624
+ return isObject(it) ? fn(it) : false;
1625
+ } : MODE == 4 ? function(it, key){
1626
+ return fn(toObject(it), key);
1627
+ } : MODE == 5 ? function(it){
1628
+ return fn(Object($.assertDefined(it)));
1629
+ } : function(it){
1630
+ return fn(toObject(it));
1631
+ };
1632
+ try {
1633
+ fn('z');
1634
+ } catch(e){
1635
+ f = 1;
1776
1636
  }
1777
- createIterator(Enumerate, OBJECT, function(){
1778
- var iter = this[ITER]
1779
- , keys = iter.a
1780
- , key;
1781
- do {
1782
- if(iter.i >= keys.length)return iterResult(1);
1783
- } while(!((key = keys[iter.i++]) in iter.o));
1784
- return iterResult(0, key);
1785
- });
1786
-
1787
- function wrap(fn){
1788
- return function(it){
1789
- assertObject(it);
1790
- try {
1791
- return fn.apply(undefined, arguments), true;
1792
- } catch(e){
1793
- return false;
1794
- }
1637
+ $def($def.S + $def.F * f, 'Object', o);
1638
+ }
1639
+ wrapObjectMethod('freeze', 1);
1640
+ wrapObjectMethod('seal', 1);
1641
+ wrapObjectMethod('preventExtensions', 1);
1642
+ wrapObjectMethod('isFrozen', 2);
1643
+ wrapObjectMethod('isSealed', 2);
1644
+ wrapObjectMethod('isExtensible', 3);
1645
+ wrapObjectMethod('getOwnPropertyDescriptor', 4);
1646
+ wrapObjectMethod('getPrototypeOf', 5);
1647
+ wrapObjectMethod('keys');
1648
+ wrapObjectMethod('getOwnPropertyNames');
1649
+ },{"./$":15,"./$.def":11}],45:[function(require,module,exports){
1650
+ 'use strict';
1651
+ // 19.1.3.6 Object.prototype.toString()
1652
+ var $ = require('./$')
1653
+ , cof = require('./$.cof')
1654
+ , tmp = {};
1655
+ tmp[require('./$.wks')('toStringTag')] = 'z';
1656
+ if($.FW && cof(tmp) != 'z')$.hide(Object.prototype, 'toString', function(){
1657
+ return '[object ' + cof.classof(this) + ']';
1658
+ });
1659
+ },{"./$":15,"./$.cof":6,"./$.wks":26}],46:[function(require,module,exports){
1660
+ 'use strict';
1661
+ var $ = require('./$')
1662
+ , ctx = require('./$.ctx')
1663
+ , cof = require('./$.cof')
1664
+ , $def = require('./$.def')
1665
+ , assert = require('./$.assert')
1666
+ , $iter = require('./$.iter')
1667
+ , SPECIES = require('./$.wks')('species')
1668
+ , RECORD = require('./$.uid').safe('record')
1669
+ , forOf = $iter.forOf
1670
+ , PROMISE = 'Promise'
1671
+ , global = $.g
1672
+ , process = global.process
1673
+ , asap = process && process.nextTick || require('./$.task').set
1674
+ , Promise = global[PROMISE]
1675
+ , Base = Promise
1676
+ , isFunction = $.isFunction
1677
+ , isObject = $.isObject
1678
+ , assertFunction = assert.fn
1679
+ , assertObject = assert.obj
1680
+ , test;
1681
+ function getConstructor(C){
1682
+ var S = assertObject(C)[SPECIES];
1683
+ return S != undefined ? S : C;
1684
+ }
1685
+ isFunction(Promise) && isFunction(Promise.resolve)
1686
+ && Promise.resolve(test = new Promise(function(){})) == test
1687
+ || function(){
1688
+ function isThenable(it){
1689
+ var then;
1690
+ if(isObject(it))then = it.then;
1691
+ return isFunction(then) ? then : false;
1692
+ }
1693
+ function handledRejectionOrHasOnRejected(promise){
1694
+ var record = promise[RECORD]
1695
+ , chain = record.c
1696
+ , i = 0
1697
+ , react;
1698
+ if(record.h)return true;
1699
+ while(chain.length > i){
1700
+ react = chain[i++];
1701
+ if(react.fail || handledRejectionOrHasOnRejected(react.P))return true;
1795
1702
  }
1796
1703
  }
1797
-
1798
- function reflectGet(target, propertyKey/*, receiver*/){
1799
- var receiver = arguments.length < 3 ? target : arguments[2]
1800
- , desc = getOwnDescriptor(assertObject(target), propertyKey), proto;
1801
- if(desc)return has(desc, 'value')
1802
- ? desc.value
1803
- : desc.get === undefined
1804
- ? undefined
1805
- : desc.get.call(receiver);
1806
- return isObject(proto = getPrototypeOf(target))
1807
- ? reflectGet(proto, propertyKey, receiver)
1808
- : undefined;
1704
+ function notify(record, isReject){
1705
+ var chain = record.c;
1706
+ if(isReject || chain.length)asap(function(){
1707
+ var promise = record.p
1708
+ , value = record.v
1709
+ , ok = record.s == 1
1710
+ , i = 0;
1711
+ if(isReject && !handledRejectionOrHasOnRejected(promise)){
1712
+ setTimeout(function(){
1713
+ if(!handledRejectionOrHasOnRejected(promise)){
1714
+ if(cof(process) == 'process'){
1715
+ process.emit('unhandledRejection', value, promise);
1716
+ } else if(global.console && isFunction(console.error)){
1717
+ console.error('Unhandled promise rejection', value);
1718
+ }
1719
+ }
1720
+ }, 1e3);
1721
+ } else while(chain.length > i)!function(react){
1722
+ var cb = ok ? react.ok : react.fail
1723
+ , ret, then;
1724
+ try {
1725
+ if(cb){
1726
+ if(!ok)record.h = true;
1727
+ ret = cb === true ? value : cb(value);
1728
+ if(ret === react.P){
1729
+ react.rej(TypeError(PROMISE + '-chain cycle'));
1730
+ } else if(then = isThenable(ret)){
1731
+ then.call(ret, react.res, react.rej);
1732
+ } else react.res(ret);
1733
+ } else react.rej(value);
1734
+ } catch(err){
1735
+ react.rej(err);
1736
+ }
1737
+ }(chain[i++]);
1738
+ chain.length = 0;
1739
+ });
1740
+ }
1741
+ function reject(value){
1742
+ var record = this;
1743
+ if(record.d)return;
1744
+ record.d = true;
1745
+ record = record.r || record; // unwrap
1746
+ record.v = value;
1747
+ record.s = 2;
1748
+ notify(record, true);
1809
1749
  }
1810
- function reflectSet(target, propertyKey, V/*, receiver*/){
1811
- var receiver = arguments.length < 4 ? target : arguments[3]
1812
- , ownDesc = getOwnDescriptor(assertObject(target), propertyKey)
1813
- , existingDescriptor, proto;
1814
- if(!ownDesc){
1815
- if(isObject(proto = getPrototypeOf(target))){
1816
- return reflectSet(proto, propertyKey, V, receiver);
1750
+ function resolve(value){
1751
+ var record = this
1752
+ , then, wrapper;
1753
+ if(record.d)return;
1754
+ record.d = true;
1755
+ record = record.r || record; // unwrap
1756
+ try {
1757
+ if(then = isThenable(value)){
1758
+ wrapper = {r: record, d: false}; // wrap
1759
+ then.call(value, ctx(resolve, wrapper, 1), ctx(reject, wrapper, 1));
1760
+ } else {
1761
+ record.v = value;
1762
+ record.s = 1;
1763
+ notify(record);
1817
1764
  }
1818
- ownDesc = descriptor(0);
1765
+ } catch(err){
1766
+ reject.call(wrapper || {r: record, d: false}, err); // wrap
1819
1767
  }
1820
- if(has(ownDesc, 'value')){
1821
- if(ownDesc.writable === false || !isObject(receiver))return false;
1822
- existingDescriptor = getOwnDescriptor(receiver, propertyKey) || descriptor(0);
1823
- existingDescriptor.value = V;
1824
- return defineProperty(receiver, propertyKey, existingDescriptor), true;
1825
- }
1826
- return ownDesc.set === undefined
1827
- ? false
1828
- : (ownDesc.set.call(receiver, V), true);
1829
1768
  }
1830
- var isExtensible = Object.isExtensible || returnIt;
1831
-
1832
- var reflect = {
1833
- // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
1834
- apply: ctx(call, apply, 3),
1835
- // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
1836
- construct: function(target, argumentsList /*, newTarget*/){
1837
- var proto = assertFunction(arguments.length < 3 ? target : arguments[2])[PROTOTYPE]
1838
- , instance = create(isObject(proto) ? proto : ObjectProto)
1839
- , result = apply.call(target, instance, argumentsList);
1840
- return isObject(result) ? result : instance;
1841
- },
1842
- // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
1843
- defineProperty: wrap(defineProperty),
1844
- // 26.1.4 Reflect.deleteProperty(target, propertyKey)
1845
- deleteProperty: function(target, propertyKey){
1846
- var desc = getOwnDescriptor(assertObject(target), propertyKey);
1847
- return desc && !desc.configurable ? false : delete target[propertyKey];
1848
- },
1849
- // 26.1.5 Reflect.enumerate(target)
1850
- enumerate: function(target){
1851
- return new Enumerate(assertObject(target));
1852
- },
1853
- // 26.1.6 Reflect.get(target, propertyKey [, receiver])
1854
- get: reflectGet,
1855
- // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
1856
- getOwnPropertyDescriptor: function(target, propertyKey){
1857
- return getOwnDescriptor(assertObject(target), propertyKey);
1858
- },
1859
- // 26.1.8 Reflect.getPrototypeOf(target)
1860
- getPrototypeOf: function(target){
1861
- return getPrototypeOf(assertObject(target));
1862
- },
1863
- // 26.1.9 Reflect.has(target, propertyKey)
1864
- has: function(target, propertyKey){
1865
- return propertyKey in target;
1866
- },
1867
- // 26.1.10 Reflect.isExtensible(target)
1868
- isExtensible: function(target){
1869
- return !!isExtensible(assertObject(target));
1769
+ // 25.4.3.1 Promise(executor)
1770
+ Promise = function(executor){
1771
+ assertFunction(executor);
1772
+ var record = {
1773
+ p: assert.inst(this, Promise, PROMISE), // <- promise
1774
+ c: [], // <- chain
1775
+ s: 0, // <- state
1776
+ d: false, // <- done
1777
+ v: undefined, // <- value
1778
+ h: false // <- handled rejection
1779
+ };
1780
+ $.hide(this, RECORD, record);
1781
+ try {
1782
+ executor(ctx(resolve, record, 1), ctx(reject, record, 1));
1783
+ } catch(err){
1784
+ reject.call(record, err);
1785
+ }
1786
+ };
1787
+ $.mix(Promise.prototype, {
1788
+ // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
1789
+ then: function(onFulfilled, onRejected){
1790
+ var S = assertObject(assertObject(this).constructor)[SPECIES];
1791
+ var react = {
1792
+ ok: isFunction(onFulfilled) ? onFulfilled : true,
1793
+ fail: isFunction(onRejected) ? onRejected : false
1794
+ };
1795
+ var P = react.P = new (S != undefined ? S : Promise)(function(res, rej){
1796
+ react.res = assertFunction(res);
1797
+ react.rej = assertFunction(rej);
1798
+ });
1799
+ var record = this[RECORD];
1800
+ record.c.push(react);
1801
+ record.s && notify(record);
1802
+ return P;
1870
1803
  },
1871
- // 26.1.11 Reflect.ownKeys(target)
1872
- ownKeys: ownKeys,
1873
- // 26.1.12 Reflect.preventExtensions(target)
1874
- preventExtensions: wrap(Object.preventExtensions || returnIt),
1875
- // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
1876
- set: reflectSet
1804
+ // 25.4.5.1 Promise.prototype.catch(onRejected)
1805
+ 'catch': function(onRejected){
1806
+ return this.then(undefined, onRejected);
1807
+ }
1808
+ });
1809
+ }();
1810
+ $def($def.G + $def.W + $def.F * (Promise != Base), {Promise: Promise});
1811
+ $def($def.S, PROMISE, {
1812
+ // 25.4.4.5 Promise.reject(r)
1813
+ reject: function(r){
1814
+ return new (getConstructor(this))(function(res, rej){
1815
+ rej(r);
1816
+ });
1817
+ },
1818
+ // 25.4.4.6 Promise.resolve(x)
1819
+ resolve: function(x){
1820
+ return isObject(x) && RECORD in x && $.getProto(x) === this.prototype
1821
+ ? x : new (getConstructor(this))(function(res){
1822
+ res(x);
1823
+ });
1877
1824
  }
1878
- // 26.1.14 Reflect.setPrototypeOf(target, proto)
1879
- if(setPrototypeOf)reflect.setPrototypeOf = function(target, proto){
1880
- return setPrototypeOf(assertObject(target), proto), true;
1825
+ });
1826
+ $def($def.S + $def.F * ($iter.fail(function(iter){
1827
+ Promise.all(iter)['catch'](function(){});
1828
+ }) || $iter.DANGER_CLOSING), PROMISE, {
1829
+ // 25.4.4.1 Promise.all(iterable)
1830
+ all: function(iterable){
1831
+ var C = getConstructor(this)
1832
+ , values = [];
1833
+ return new C(function(resolve, reject){
1834
+ forOf(iterable, false, values.push, values);
1835
+ var remaining = values.length
1836
+ , results = Array(remaining);
1837
+ if(remaining)$.each.call(values, function(promise, index){
1838
+ C.resolve(promise).then(function(value){
1839
+ results[index] = value;
1840
+ --remaining || resolve(results);
1841
+ }, reject);
1842
+ });
1843
+ else resolve(results);
1844
+ });
1845
+ },
1846
+ // 25.4.4.4 Promise.race(iterable)
1847
+ race: function(iterable){
1848
+ var C = getConstructor(this);
1849
+ return new C(function(resolve, reject){
1850
+ forOf(iterable, false, function(promise){
1851
+ C.resolve(promise).then(resolve, reject);
1852
+ });
1853
+ });
1854
+ }
1855
+ });
1856
+ cof.set(Promise, PROMISE);
1857
+ require('./$.species')(Promise);
1858
+ },{"./$":15,"./$.assert":4,"./$.cof":6,"./$.ctx":10,"./$.def":11,"./$.iter":14,"./$.species":21,"./$.task":23,"./$.uid":24,"./$.wks":26}],47:[function(require,module,exports){
1859
+ var $ = require('./$')
1860
+ , $def = require('./$.def')
1861
+ , setProto = require('./$.set-proto')
1862
+ , $iter = require('./$.iter')
1863
+ , ITER = require('./$.uid').safe('iter')
1864
+ , step = $iter.step
1865
+ , assert = require('./$.assert')
1866
+ , isObject = $.isObject
1867
+ , getDesc = $.getDesc
1868
+ , setDesc = $.setDesc
1869
+ , getProto = $.getProto
1870
+ , apply = Function.apply
1871
+ , assertObject = assert.obj
1872
+ , isExtensible = Object.isExtensible || $.it;
1873
+ function Enumerate(iterated){
1874
+ var keys = [], key;
1875
+ for(key in iterated)keys.push(key);
1876
+ $.set(this, ITER, {o: iterated, a: keys, i: 0});
1877
+ }
1878
+ $iter.create(Enumerate, 'Object', function(){
1879
+ var iter = this[ITER]
1880
+ , keys = iter.a
1881
+ , key;
1882
+ do {
1883
+ if(iter.i >= keys.length)return step(1);
1884
+ } while(!((key = keys[iter.i++]) in iter.o));
1885
+ return step(0, key);
1886
+ });
1887
+
1888
+ function wrap(fn){
1889
+ return function(it){
1890
+ assertObject(it);
1891
+ try {
1892
+ fn.apply(undefined, arguments);
1893
+ return true;
1894
+ } catch(e){
1895
+ return false;
1896
+ }
1881
1897
  };
1882
-
1883
- $define(GLOBAL, {Reflect: {}});
1884
- $define(STATIC, 'Reflect', reflect);
1885
- }();
1886
-
1887
- /******************************************************************************
1888
- * Module : es7.proposals *
1889
- ******************************************************************************/
1890
-
1891
- !function(){
1892
- $define(PROTO, ARRAY, {
1893
- // https://github.com/domenic/Array.prototype.includes
1894
- includes: createArrayContains(true)
1895
- });
1896
- $define(PROTO, STRING, {
1897
- // https://github.com/mathiasbynens/String.prototype.at
1898
- at: createPointAt(true)
1899
- });
1900
-
1901
- function createObjectToArray(isEntries){
1902
- return function(object){
1903
- var O = toObject(object)
1904
- , keys = getKeys(object)
1905
- , length = keys.length
1906
- , i = 0
1907
- , result = Array(length)
1908
- , key;
1909
- if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]];
1910
- else while(length > i)result[i] = O[keys[i++]];
1911
- return result;
1898
+ }
1899
+
1900
+ function reflectGet(target, propertyKey/*, receiver*/){
1901
+ var receiver = arguments.length < 3 ? target : arguments[2]
1902
+ , desc = getDesc(assertObject(target), propertyKey), proto;
1903
+ if(desc)return $.has(desc, 'value')
1904
+ ? desc.value
1905
+ : desc.get === undefined
1906
+ ? undefined
1907
+ : desc.get.call(receiver);
1908
+ return isObject(proto = getProto(target))
1909
+ ? reflectGet(proto, propertyKey, receiver)
1910
+ : undefined;
1911
+ }
1912
+ function reflectSet(target, propertyKey, V/*, receiver*/){
1913
+ var receiver = arguments.length < 4 ? target : arguments[3]
1914
+ , ownDesc = getDesc(assertObject(target), propertyKey)
1915
+ , existingDescriptor, proto;
1916
+ if(!ownDesc){
1917
+ if(isObject(proto = getProto(target))){
1918
+ return reflectSet(proto, propertyKey, V, receiver);
1912
1919
  }
1920
+ ownDesc = $.desc(0);
1921
+ }
1922
+ if($.has(ownDesc, 'value')){
1923
+ if(ownDesc.writable === false || !isObject(receiver))return false;
1924
+ existingDescriptor = getDesc(receiver, propertyKey) || $.desc(0);
1925
+ existingDescriptor.value = V;
1926
+ setDesc(receiver, propertyKey, existingDescriptor);
1927
+ return true;
1913
1928
  }
1914
- $define(STATIC, OBJECT, {
1915
- // https://gist.github.com/WebReflection/9353781
1916
- getOwnPropertyDescriptors: function(object){
1917
- var O = toObject(object)
1918
- , result = {};
1919
- forEach.call(ownKeys(O), function(key){
1920
- defineProperty(result, key, descriptor(0, getOwnDescriptor(O, key)));
1929
+ return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
1930
+ }
1931
+
1932
+ var reflect = {
1933
+ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
1934
+ apply: require('./$.ctx')(Function.call, apply, 3),
1935
+ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
1936
+ construct: function(target, argumentsList /*, newTarget*/){
1937
+ var proto = assert.fn(arguments.length < 3 ? target : arguments[2]).prototype
1938
+ , instance = $.create(isObject(proto) ? proto : Object.prototype)
1939
+ , result = apply.call(target, instance, argumentsList);
1940
+ return isObject(result) ? result : instance;
1941
+ },
1942
+ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
1943
+ defineProperty: wrap(setDesc),
1944
+ // 26.1.4 Reflect.deleteProperty(target, propertyKey)
1945
+ deleteProperty: function(target, propertyKey){
1946
+ var desc = getDesc(assertObject(target), propertyKey);
1947
+ return desc && !desc.configurable ? false : delete target[propertyKey];
1948
+ },
1949
+ // 26.1.5 Reflect.enumerate(target)
1950
+ enumerate: function(target){
1951
+ return new Enumerate(assertObject(target));
1952
+ },
1953
+ // 26.1.6 Reflect.get(target, propertyKey [, receiver])
1954
+ get: reflectGet,
1955
+ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
1956
+ getOwnPropertyDescriptor: function(target, propertyKey){
1957
+ return getDesc(assertObject(target), propertyKey);
1958
+ },
1959
+ // 26.1.8 Reflect.getPrototypeOf(target)
1960
+ getPrototypeOf: function(target){
1961
+ return getProto(assertObject(target));
1962
+ },
1963
+ // 26.1.9 Reflect.has(target, propertyKey)
1964
+ has: function(target, propertyKey){
1965
+ return propertyKey in target;
1966
+ },
1967
+ // 26.1.10 Reflect.isExtensible(target)
1968
+ isExtensible: function(target){
1969
+ return !!isExtensible(assertObject(target));
1970
+ },
1971
+ // 26.1.11 Reflect.ownKeys(target)
1972
+ ownKeys: require('./$.own-keys'),
1973
+ // 26.1.12 Reflect.preventExtensions(target)
1974
+ preventExtensions: wrap(Object.preventExtensions || $.it),
1975
+ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
1976
+ set: reflectSet
1977
+ };
1978
+ // 26.1.14 Reflect.setPrototypeOf(target, proto)
1979
+ if(setProto)reflect.setPrototypeOf = function(target, proto){
1980
+ setProto(assertObject(target), proto);
1981
+ return true;
1982
+ };
1983
+
1984
+ $def($def.G, {Reflect: {}});
1985
+ $def($def.S, 'Reflect', reflect);
1986
+ },{"./$":15,"./$.assert":4,"./$.ctx":10,"./$.def":11,"./$.iter":14,"./$.own-keys":17,"./$.set-proto":20,"./$.uid":24}],48:[function(require,module,exports){
1987
+ var $ = require('./$')
1988
+ , cof = require('./$.cof')
1989
+ , RegExp = $.g.RegExp
1990
+ , Base = RegExp
1991
+ , proto = RegExp.prototype;
1992
+ if($.FW && $.DESC){
1993
+ // RegExp allows a regex with flags as the pattern
1994
+ if(!function(){try{ return RegExp(/a/g, 'i') == '/a/i'; }catch(e){ /* empty */ }}()){
1995
+ RegExp = function RegExp(pattern, flags){
1996
+ return new Base(cof(pattern) == 'RegExp' && flags !== undefined
1997
+ ? pattern.source : pattern, flags);
1998
+ };
1999
+ $.each.call($.getNames(Base), function(key){
2000
+ key in RegExp || $.setDesc(RegExp, key, {
2001
+ configurable: true,
2002
+ get: function(){ return Base[key]; },
2003
+ set: function(it){ Base[key] = it; }
1921
2004
  });
1922
- return result;
1923
- },
1924
- // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-04/apr-9.md#51-objectentries-objectvalues
1925
- values: createObjectToArray(false),
1926
- entries: createObjectToArray(true)
2005
+ });
2006
+ proto.constructor = RegExp;
2007
+ RegExp.prototype = proto;
2008
+ $.hide($.g, 'RegExp', RegExp);
2009
+ }
2010
+ // 21.2.5.3 get RegExp.prototype.flags()
2011
+ if(/./g.flags != 'g')$.setDesc(proto, 'flags', {
2012
+ configurable: true,
2013
+ get: require('./$.replacer')(/^.*\/(\w*)$/, '$1')
1927
2014
  });
1928
- $define(STATIC, REGEXP, {
1929
- // https://gist.github.com/kangax/9698100
1930
- escape: createReplacer(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true)
2015
+ }
2016
+ require('./$.species')(RegExp);
2017
+ },{"./$":15,"./$.cof":6,"./$.replacer":19,"./$.species":21}],49:[function(require,module,exports){
2018
+ 'use strict';
2019
+ var strong = require('./$.collection-strong');
2020
+
2021
+ // 23.2 Set Objects
2022
+ require('./$.collection')('Set', {
2023
+ // 23.2.3.1 Set.prototype.add(value)
2024
+ add: function(value){
2025
+ return strong.def(this, value = value === 0 ? 0 : value, value);
2026
+ }
2027
+ }, strong);
2028
+ },{"./$.collection":9,"./$.collection-strong":7}],50:[function(require,module,exports){
2029
+ var $def = require('./$.def');
2030
+ $def($def.P, 'String', {
2031
+ // 21.1.3.3 String.prototype.codePointAt(pos)
2032
+ codePointAt: require('./$.string-at')(false)
2033
+ });
2034
+ },{"./$.def":11,"./$.string-at":22}],51:[function(require,module,exports){
2035
+ 'use strict';
2036
+ var $ = require('./$')
2037
+ , cof = require('./$.cof')
2038
+ , $def = require('./$.def')
2039
+ , toLength = $.toLength;
2040
+
2041
+ $def($def.P, 'String', {
2042
+ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
2043
+ endsWith: function(searchString /*, endPosition = @length */){
2044
+ if(cof(searchString) == 'RegExp')throw TypeError();
2045
+ var that = String($.assertDefined(this))
2046
+ , endPosition = arguments[1]
2047
+ , len = toLength(that.length)
2048
+ , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
2049
+ searchString += '';
2050
+ return that.slice(end - searchString.length, end) === searchString;
2051
+ }
2052
+ });
2053
+ },{"./$":15,"./$.cof":6,"./$.def":11}],52:[function(require,module,exports){
2054
+ var $def = require('./$.def')
2055
+ , toIndex = require('./$').toIndex
2056
+ , fromCharCode = String.fromCharCode;
2057
+
2058
+ $def($def.S, 'String', {
2059
+ // 21.1.2.2 String.fromCodePoint(...codePoints)
2060
+ fromCodePoint: function(x){ // eslint-disable-line no-unused-vars
2061
+ var res = []
2062
+ , len = arguments.length
2063
+ , i = 0
2064
+ , code;
2065
+ while(len > i){
2066
+ code = +arguments[i++];
2067
+ if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
2068
+ res.push(code < 0x10000
2069
+ ? fromCharCode(code)
2070
+ : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
2071
+ );
2072
+ } return res.join('');
2073
+ }
2074
+ });
2075
+ },{"./$":15,"./$.def":11}],53:[function(require,module,exports){
2076
+ 'use strict';
2077
+ var $ = require('./$')
2078
+ , cof = require('./$.cof')
2079
+ , $def = require('./$.def');
2080
+
2081
+ $def($def.P, 'String', {
2082
+ // 21.1.3.7 String.prototype.includes(searchString, position = 0)
2083
+ includes: function(searchString /*, position = 0 */){
2084
+ if(cof(searchString) == 'RegExp')throw TypeError();
2085
+ return !!~String($.assertDefined(this)).indexOf(searchString, arguments[1]);
2086
+ }
2087
+ });
2088
+ },{"./$":15,"./$.cof":6,"./$.def":11}],54:[function(require,module,exports){
2089
+ var set = require('./$').set
2090
+ , at = require('./$.string-at')(true)
2091
+ , ITER = require('./$.uid').safe('iter')
2092
+ , $iter = require('./$.iter')
2093
+ , step = $iter.step;
2094
+
2095
+ // 21.1.3.27 String.prototype[@@iterator]()
2096
+ $iter.std(String, 'String', function(iterated){
2097
+ set(this, ITER, {o: String(iterated), i: 0});
2098
+ // 21.1.5.2.1 %StringIteratorPrototype%.next()
2099
+ }, function(){
2100
+ var iter = this[ITER]
2101
+ , O = iter.o
2102
+ , index = iter.i
2103
+ , point;
2104
+ if(index >= O.length)return step(1);
2105
+ point = at.call(O, index);
2106
+ iter.i += point.length;
2107
+ return step(0, point);
2108
+ });
2109
+ },{"./$":15,"./$.iter":14,"./$.string-at":22,"./$.uid":24}],55:[function(require,module,exports){
2110
+ var $ = require('./$')
2111
+ , $def = require('./$.def');
2112
+
2113
+ $def($def.S, 'String', {
2114
+ // 21.1.2.4 String.raw(callSite, ...substitutions)
2115
+ raw: function(callSite){
2116
+ var raw = $.toObject(callSite.raw)
2117
+ , len = $.toLength(raw.length)
2118
+ , sln = arguments.length
2119
+ , res = []
2120
+ , i = 0;
2121
+ while(len > i){
2122
+ res.push(String(raw[i++]));
2123
+ if(i < sln)res.push(String(arguments[i]));
2124
+ } return res.join('');
2125
+ }
2126
+ });
2127
+ },{"./$":15,"./$.def":11}],56:[function(require,module,exports){
2128
+ 'use strict';
2129
+ var $ = require('./$')
2130
+ , $def = require('./$.def');
2131
+
2132
+ $def($def.P, 'String', {
2133
+ // 21.1.3.13 String.prototype.repeat(count)
2134
+ repeat: function(count){
2135
+ var str = String($.assertDefined(this))
2136
+ , res = ''
2137
+ , n = $.toInteger(count);
2138
+ if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
2139
+ for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
2140
+ return res;
2141
+ }
2142
+ });
2143
+ },{"./$":15,"./$.def":11}],57:[function(require,module,exports){
2144
+ 'use strict';
2145
+ var $ = require('./$')
2146
+ , cof = require('./$.cof')
2147
+ , $def = require('./$.def');
2148
+
2149
+ $def($def.P, 'String', {
2150
+ // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
2151
+ startsWith: function(searchString /*, position = 0 */){
2152
+ if(cof(searchString) == 'RegExp')throw TypeError();
2153
+ var that = String($.assertDefined(this))
2154
+ , index = $.toLength(Math.min(arguments[1], that.length));
2155
+ searchString += '';
2156
+ return that.slice(index, index + searchString.length) === searchString;
2157
+ }
2158
+ });
2159
+ },{"./$":15,"./$.cof":6,"./$.def":11}],58:[function(require,module,exports){
2160
+ 'use strict';
2161
+ // ECMAScript 6 symbols shim
2162
+ var $ = require('./$')
2163
+ , setTag = require('./$.cof').set
2164
+ , uid = require('./$.uid')
2165
+ , $def = require('./$.def')
2166
+ , has = $.has
2167
+ , hide = $.hide
2168
+ , getNames = $.getNames
2169
+ , toObject = $.toObject
2170
+ , Symbol = $.g.Symbol
2171
+ , Base = Symbol
2172
+ , setter = false
2173
+ , TAG = uid.safe('tag')
2174
+ , SymbolRegistry = {}
2175
+ , AllSymbols = {};
2176
+
2177
+ function wrap(tag){
2178
+ var sym = AllSymbols[tag] = $.set($.create(Symbol.prototype), TAG, tag);
2179
+ $.DESC && setter && $.setDesc(Object.prototype, tag, {
2180
+ configurable: true,
2181
+ set: function(value){
2182
+ hide(this, tag, value);
2183
+ }
1931
2184
  });
1932
- }();
1933
-
1934
- /******************************************************************************
1935
- * Module : es7.abstract-refs *
1936
- ******************************************************************************/
1937
-
1938
- // https://github.com/zenparsing/es-abstract-refs
1939
- !function(REFERENCE){
1940
- REFERENCE_GET = getWellKnownSymbol(REFERENCE+'Get', true);
1941
- var REFERENCE_SET = getWellKnownSymbol(REFERENCE+SET, true)
1942
- , REFERENCE_DELETE = getWellKnownSymbol(REFERENCE+'Delete', true);
1943
-
1944
- $define(STATIC, SYMBOL, {
1945
- referenceGet: REFERENCE_GET,
1946
- referenceSet: REFERENCE_SET,
1947
- referenceDelete: REFERENCE_DELETE
2185
+ return sym;
2186
+ }
2187
+
2188
+ // 19.4.1.1 Symbol([description])
2189
+ if(!$.isFunction(Symbol)){
2190
+ Symbol = function(description){
2191
+ if(this instanceof Symbol)throw TypeError('Symbol is not a constructor');
2192
+ return wrap(uid(description));
2193
+ };
2194
+ hide(Symbol.prototype, 'toString', function(){
2195
+ return this[TAG];
1948
2196
  });
1949
-
1950
- hidden(FunctionProto, REFERENCE_GET, returnThis);
1951
-
1952
- function setMapMethods(Constructor){
1953
- if(Constructor){
1954
- var MapProto = Constructor[PROTOTYPE];
1955
- hidden(MapProto, REFERENCE_GET, MapProto.get);
1956
- hidden(MapProto, REFERENCE_SET, MapProto.set);
1957
- hidden(MapProto, REFERENCE_DELETE, MapProto['delete']);
2197
+ }
2198
+ $def($def.G + $def.W, {Symbol: Symbol});
2199
+
2200
+ var symbolStatics = {
2201
+ // 19.4.2.1 Symbol.for(key)
2202
+ 'for': function(key){
2203
+ return has(SymbolRegistry, key += '')
2204
+ ? SymbolRegistry[key]
2205
+ : SymbolRegistry[key] = Symbol(key);
2206
+ },
2207
+ // 19.4.2.5 Symbol.keyFor(sym)
2208
+ keyFor: require('./$.partial').call(require('./$.keyof'), SymbolRegistry, 0),
2209
+ pure: uid.safe,
2210
+ set: $.set,
2211
+ useSetter: function(){ setter = true; },
2212
+ useSimple: function(){ setter = false; }
2213
+ };
2214
+ // 19.4.2.2 Symbol.hasInstance
2215
+ // 19.4.2.3 Symbol.isConcatSpreadable
2216
+ // 19.4.2.4 Symbol.iterator
2217
+ // 19.4.2.6 Symbol.match
2218
+ // 19.4.2.8 Symbol.replace
2219
+ // 19.4.2.9 Symbol.search
2220
+ // 19.4.2.10 Symbol.species
2221
+ // 19.4.2.11 Symbol.split
2222
+ // 19.4.2.12 Symbol.toPrimitive
2223
+ // 19.4.2.13 Symbol.toStringTag
2224
+ // 19.4.2.14 Symbol.unscopables
2225
+ $.each.call((
2226
+ 'hasInstance,isConcatSpreadable,iterator,match,replace,search,' +
2227
+ 'species,split,toPrimitive,toStringTag,unscopables'
2228
+ ).split(','), function(it){
2229
+ var sym = require('./$.wks')(it);
2230
+ symbolStatics[it] = Symbol === Base ? sym : wrap(sym);
2231
+ }
2232
+ );
2233
+
2234
+ setter = true;
2235
+
2236
+ $def($def.S, 'Symbol', symbolStatics);
2237
+
2238
+ $def($def.S + $def.F * (Symbol != Base), 'Object', {
2239
+ // 19.1.2.7 Object.getOwnPropertyNames(O)
2240
+ getOwnPropertyNames: function(it){
2241
+ var names = getNames(toObject(it)), result = [], key, i = 0;
2242
+ while(names.length > i)has(AllSymbols, key = names[i++]) || result.push(key);
2243
+ return result;
2244
+ },
2245
+ // 19.1.2.8 Object.getOwnPropertySymbols(O)
2246
+ getOwnPropertySymbols: function(it){
2247
+ var names = getNames(toObject(it)), result = [], key, i = 0;
2248
+ while(names.length > i)has(AllSymbols, key = names[i++]) && result.push(AllSymbols[key]);
2249
+ return result;
2250
+ }
2251
+ });
2252
+
2253
+ setTag(Symbol, 'Symbol');
2254
+ // 20.2.1.9 Math[@@toStringTag]
2255
+ setTag(Math, 'Math', true);
2256
+ // 24.3.3 JSON[@@toStringTag]
2257
+ setTag($.g.JSON, 'JSON', true);
2258
+ },{"./$":15,"./$.cof":6,"./$.def":11,"./$.keyof":16,"./$.partial":18,"./$.uid":24,"./$.wks":26}],59:[function(require,module,exports){
2259
+ 'use strict';
2260
+ var $ = require('./$')
2261
+ , weak = require('./$.collection-weak')
2262
+ , leakStore = weak.leakStore
2263
+ , ID = weak.ID
2264
+ , WEAK = weak.WEAK
2265
+ , has = $.has
2266
+ , isObject = $.isObject
2267
+ , isFrozen = Object.isFrozen || $.core.Object.isFrozen
2268
+ , tmp = {};
2269
+
2270
+ // 23.3 WeakMap Objects
2271
+ var WeakMap = require('./$.collection')('WeakMap', {
2272
+ // 23.3.3.3 WeakMap.prototype.get(key)
2273
+ get: function(key){
2274
+ if(isObject(key)){
2275
+ if(isFrozen(key))return leakStore(this).get(key);
2276
+ if(has(key, WEAK))return key[WEAK][this[ID]];
1958
2277
  }
2278
+ },
2279
+ // 23.3.3.5 WeakMap.prototype.set(key, value)
2280
+ set: function(key, value){
2281
+ return weak.def(this, key, value);
1959
2282
  }
1960
- setMapMethods(Map);
1961
- setMapMethods(WeakMap);
1962
- }('reference');
1963
-
1964
- /******************************************************************************
1965
- * Module : js.array.statics *
1966
- ******************************************************************************/
1967
-
1968
- // JavaScript 1.6 / Strawman array statics shim
1969
- !function(arrayStatics){
1970
- function setArrayStatics(keys, length){
1971
- forEach.call(array(keys), function(key){
1972
- if(key in ArrayProto)arrayStatics[key] = ctx(call, ArrayProto[key], length);
1973
- });
2283
+ }, weak, true, true);
2284
+
2285
+ // IE11 WeakMap frozen keys fix
2286
+ if($.FW && new WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
2287
+ $.each.call(['delete', 'has', 'get', 'set'], function(key){
2288
+ var method = WeakMap.prototype[key];
2289
+ WeakMap.prototype[key] = function(a, b){
2290
+ // store frozen objects on leaky map
2291
+ if(isObject(a) && isFrozen(a)){
2292
+ var result = leakStore(this)[key](a, b);
2293
+ return key == 'set' ? this : result;
2294
+ // store all the rest on native weakmap
2295
+ } return method.call(this, a, b);
2296
+ };
2297
+ });
2298
+ }
2299
+ },{"./$":15,"./$.collection":9,"./$.collection-weak":8}],60:[function(require,module,exports){
2300
+ 'use strict';
2301
+ var weak = require('./$.collection-weak');
2302
+
2303
+ // 23.4 WeakSet Objects
2304
+ require('./$.collection')('WeakSet', {
2305
+ // 23.4.3.1 WeakSet.prototype.add(value)
2306
+ add: function(value){
2307
+ return weak.def(this, value, true);
1974
2308
  }
1975
- setArrayStatics('pop,reverse,shift,keys,values,entries', 1);
1976
- setArrayStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3);
1977
- setArrayStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' +
1978
- 'reduce,reduceRight,copyWithin,fill,turn');
1979
- $define(STATIC, ARRAY, arrayStatics);
1980
- }({});
1981
-
1982
- /******************************************************************************
1983
- * Module : web.dom.itarable *
1984
- ******************************************************************************/
1985
-
1986
- !function(NodeList){
1987
- if(framework && NodeList && !(SYMBOL_ITERATOR in NodeList[PROTOTYPE])){
1988
- hidden(NodeList[PROTOTYPE], SYMBOL_ITERATOR, Iterators[ARRAY]);
2309
+ }, weak, false, true);
2310
+ },{"./$.collection":9,"./$.collection-weak":8}],61:[function(require,module,exports){
2311
+ // https://github.com/domenic/Array.prototype.includes
2312
+ var $def = require('./$.def');
2313
+ $def($def.P, 'Array', {
2314
+ includes: require('./$.array-includes')(true)
2315
+ });
2316
+ require('./$.unscope')('includes');
2317
+ },{"./$.array-includes":2,"./$.def":11,"./$.unscope":25}],62:[function(require,module,exports){
2318
+ // https://gist.github.com/WebReflection/9353781
2319
+ var $ = require('./$')
2320
+ , $def = require('./$.def')
2321
+ , ownKeys = require('./$.own-keys');
2322
+
2323
+ $def($def.S, 'Object', {
2324
+ getOwnPropertyDescriptors: function(object){
2325
+ var O = $.toObject(object)
2326
+ , result = {};
2327
+ $.each.call(ownKeys(O), function(key){
2328
+ $.setDesc(result, key, $.desc(0, $.getDesc(O, key)));
2329
+ });
2330
+ return result;
1989
2331
  }
1990
- Iterators.NodeList = Iterators[ARRAY];
1991
- }(global.NodeList);
1992
- }(typeof self != 'undefined' && self.Math === Math ? self : Function('return this')(), true);
1993
- },{}],3:[function(require,module,exports){
2332
+ });
2333
+ },{"./$":15,"./$.def":11,"./$.own-keys":17}],63:[function(require,module,exports){
2334
+ // http://goo.gl/XkBrjD
2335
+ var $ = require('./$')
2336
+ , $def = require('./$.def');
2337
+ function createObjectToArray(isEntries){
2338
+ return function(object){
2339
+ var O = $.toObject(object)
2340
+ , keys = $.getKeys(object)
2341
+ , length = keys.length
2342
+ , i = 0
2343
+ , result = Array(length)
2344
+ , key;
2345
+ if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]];
2346
+ else while(length > i)result[i] = O[keys[i++]];
2347
+ return result;
2348
+ };
2349
+ }
2350
+ $def($def.S, 'Object', {
2351
+ values: createObjectToArray(false),
2352
+ entries: createObjectToArray(true)
2353
+ });
2354
+ },{"./$":15,"./$.def":11}],64:[function(require,module,exports){
2355
+ // https://gist.github.com/kangax/9698100
2356
+ var $def = require('./$.def');
2357
+ $def($def.S, 'RegExp', {
2358
+ escape: require('./$.replacer')(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true)
2359
+ });
2360
+ },{"./$.def":11,"./$.replacer":19}],65:[function(require,module,exports){
2361
+ // https://github.com/mathiasbynens/String.prototype.at
2362
+ var $def = require('./$.def');
2363
+ $def($def.P, 'String', {
2364
+ at: require('./$.string-at')(true)
2365
+ });
2366
+ },{"./$.def":11,"./$.string-at":22}],66:[function(require,module,exports){
2367
+ // JavaScript 1.6 / Strawman array statics shim
2368
+ var $ = require('./$')
2369
+ , $def = require('./$.def')
2370
+ , core = $.core
2371
+ , statics = {};
2372
+ function setStatics(keys, length){
2373
+ $.each.call(keys.split(','), function(key){
2374
+ if(length == undefined && key in core.Array)statics[key] = core.Array[key];
2375
+ else if(key in [])statics[key] = require('./$.ctx')(Function.call, [][key], length);
2376
+ });
2377
+ }
2378
+ setStatics('pop,reverse,shift,keys,values,entries', 1);
2379
+ setStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3);
2380
+ setStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' +
2381
+ 'reduce,reduceRight,copyWithin,fill,turn');
2382
+ $def($def.S, 'Array', statics);
2383
+ },{"./$":15,"./$.ctx":10,"./$.def":11}],67:[function(require,module,exports){
2384
+ require('./es6.array.iterator');
2385
+ var $ = require('./$')
2386
+ , Iterators = require('./$.iter').Iterators
2387
+ , ITERATOR = require('./$.wks')('iterator')
2388
+ , NodeList = $.g.NodeList;
2389
+ if($.FW && NodeList && !(ITERATOR in NodeList.prototype)){
2390
+ $.hide(NodeList.prototype, ITERATOR, Iterators.Array);
2391
+ }
2392
+ Iterators.NodeList = Iterators.Array;
2393
+ },{"./$":15,"./$.iter":14,"./$.wks":26,"./es6.array.iterator":33}],68:[function(require,module,exports){
2394
+ var $def = require('./$.def')
2395
+ , $task = require('./$.task');
2396
+ $def($def.G + $def.B, {
2397
+ setImmediate: $task.set,
2398
+ clearImmediate: $task.clear
2399
+ });
2400
+ },{"./$.def":11,"./$.task":23}],69:[function(require,module,exports){
2401
+ // ie9- setTimeout & setInterval additional parameters fix
2402
+ var $ = require('./$')
2403
+ , $def = require('./$.def')
2404
+ , invoke = require('./$.invoke')
2405
+ , partial = require('./$.partial')
2406
+ , MSIE = !!$.g.navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
2407
+ function wrap(set){
2408
+ return MSIE ? function(fn, time /*, ...args */){
2409
+ return set(invoke(
2410
+ partial,
2411
+ [].slice.call(arguments, 2),
2412
+ $.isFunction(fn) ? fn : Function(fn)
2413
+ ), time);
2414
+ } : set;
2415
+ }
2416
+ $def($def.G + $def.B + $def.F * MSIE, {
2417
+ setTimeout: wrap(setTimeout),
2418
+ setInterval: wrap(setInterval)
2419
+ });
2420
+ },{"./$":15,"./$.def":11,"./$.invoke":13,"./$.partial":18}],70:[function(require,module,exports){
2421
+ require('./modules/es5');
2422
+ require('./modules/es6.symbol');
2423
+ require('./modules/es6.object.assign');
2424
+ require('./modules/es6.object.is');
2425
+ require('./modules/es6.object.set-prototype-of');
2426
+ require('./modules/es6.object.to-string');
2427
+ require('./modules/es6.object.statics-accept-primitives');
2428
+ require('./modules/es6.function.name');
2429
+ require('./modules/es6.number.constructor');
2430
+ require('./modules/es6.number.statics');
2431
+ require('./modules/es6.math');
2432
+ require('./modules/es6.string.from-code-point');
2433
+ require('./modules/es6.string.raw');
2434
+ require('./modules/es6.string.iterator');
2435
+ require('./modules/es6.string.code-point-at');
2436
+ require('./modules/es6.string.ends-with');
2437
+ require('./modules/es6.string.includes');
2438
+ require('./modules/es6.string.repeat');
2439
+ require('./modules/es6.string.starts-with');
2440
+ require('./modules/es6.array.from');
2441
+ require('./modules/es6.array.of');
2442
+ require('./modules/es6.array.iterator');
2443
+ require('./modules/es6.array.species');
2444
+ require('./modules/es6.array.copy-within');
2445
+ require('./modules/es6.array.fill');
2446
+ require('./modules/es6.array.find');
2447
+ require('./modules/es6.array.find-index');
2448
+ require('./modules/es6.regexp');
2449
+ require('./modules/es6.promise');
2450
+ require('./modules/es6.map');
2451
+ require('./modules/es6.set');
2452
+ require('./modules/es6.weak-map');
2453
+ require('./modules/es6.weak-set');
2454
+ require('./modules/es6.reflect');
2455
+ require('./modules/es7.array.includes');
2456
+ require('./modules/es7.string.at');
2457
+ require('./modules/es7.regexp.escape');
2458
+ require('./modules/es7.object.get-own-property-descriptors');
2459
+ require('./modules/es7.object.to-array');
2460
+ require('./modules/js.array.statics');
2461
+ require('./modules/web.timers');
2462
+ require('./modules/web.immediate');
2463
+ require('./modules/web.dom.iterable');
2464
+ module.exports = require('./modules/$').core;
2465
+ },{"./modules/$":15,"./modules/es5":27,"./modules/es6.array.copy-within":28,"./modules/es6.array.fill":29,"./modules/es6.array.find":31,"./modules/es6.array.find-index":30,"./modules/es6.array.from":32,"./modules/es6.array.iterator":33,"./modules/es6.array.of":34,"./modules/es6.array.species":35,"./modules/es6.function.name":36,"./modules/es6.map":37,"./modules/es6.math":38,"./modules/es6.number.constructor":39,"./modules/es6.number.statics":40,"./modules/es6.object.assign":41,"./modules/es6.object.is":42,"./modules/es6.object.set-prototype-of":43,"./modules/es6.object.statics-accept-primitives":44,"./modules/es6.object.to-string":45,"./modules/es6.promise":46,"./modules/es6.reflect":47,"./modules/es6.regexp":48,"./modules/es6.set":49,"./modules/es6.string.code-point-at":50,"./modules/es6.string.ends-with":51,"./modules/es6.string.from-code-point":52,"./modules/es6.string.includes":53,"./modules/es6.string.iterator":54,"./modules/es6.string.raw":55,"./modules/es6.string.repeat":56,"./modules/es6.string.starts-with":57,"./modules/es6.symbol":58,"./modules/es6.weak-map":59,"./modules/es6.weak-set":60,"./modules/es7.array.includes":61,"./modules/es7.object.get-own-property-descriptors":62,"./modules/es7.object.to-array":63,"./modules/es7.regexp.escape":64,"./modules/es7.string.at":65,"./modules/js.array.statics":66,"./modules/web.dom.iterable":67,"./modules/web.immediate":68,"./modules/web.timers":69}],71:[function(require,module,exports){
1994
2466
  (function (global){
1995
2467
  /**
1996
2468
  * Copyright (c) 2014, Facebook, Inc.