core-js 2.1.5 → 2.3.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.
- package/CHANGELOG.md +27 -0
- package/README.md +93 -68
- package/bower.json +1 -1
- package/build/config.js +3 -6
- package/client/core.js +1382 -1102
- package/client/core.min.js +4 -4
- package/client/core.min.js.map +1 -1
- package/client/library.js +1314 -1049
- package/client/library.min.js +4 -4
- package/client/library.min.js.map +1 -1
- package/client/shim.js +1326 -1046
- package/client/shim.min.js +4 -4
- package/client/shim.min.js.map +1 -1
- package/es6/date.js +1 -0
- package/es6/index.js +3 -2
- package/es7/asap.js +2 -0
- package/es7/index.js +8 -0
- package/es7/object.js +4 -0
- package/es7/string.js +1 -0
- package/es7/symbol.js +3 -0
- package/fn/asap.js +2 -0
- package/fn/date/index.js +1 -0
- package/fn/date/to-primitive.js +5 -0
- package/fn/object/define-getter.js +2 -0
- package/fn/object/define-setter.js +2 -0
- package/fn/object/index.js +4 -0
- package/fn/object/lookup-getter.js +2 -0
- package/fn/object/lookup-setter.js +2 -0
- package/fn/string/index.js +1 -0
- package/fn/string/match-all.js +2 -0
- package/fn/string/virtual/index.js +1 -0
- package/fn/string/virtual/match-all.js +2 -0
- package/fn/symbol/async-iterator.js +2 -0
- package/fn/symbol/has-instance.js +2 -1
- package/fn/symbol/index.js +2 -0
- package/fn/symbol/is-concat-spreadable.js +1 -1
- package/fn/symbol/iterator.js +1 -1
- package/fn/symbol/match.js +1 -1
- package/fn/symbol/observable.js +2 -0
- package/fn/symbol/replace.js +1 -1
- package/fn/symbol/search.js +1 -1
- package/fn/symbol/species.js +1 -1
- package/fn/symbol/split.js +1 -1
- package/fn/symbol/to-primitive.js +1 -1
- package/fn/symbol/to-string-tag.js +1 -1
- package/fn/symbol/unscopables.js +1 -1
- package/library/es6/date.js +1 -0
- package/library/es6/index.js +3 -2
- package/library/es7/asap.js +2 -0
- package/library/es7/index.js +8 -0
- package/library/es7/object.js +4 -0
- package/library/es7/string.js +1 -0
- package/library/es7/symbol.js +3 -0
- package/library/fn/asap.js +2 -0
- package/library/fn/date/index.js +1 -0
- package/library/fn/date/to-primitive.js +5 -0
- package/library/fn/object/define-getter.js +2 -0
- package/library/fn/object/define-setter.js +2 -0
- package/library/fn/object/index.js +4 -0
- package/library/fn/object/lookup-getter.js +2 -0
- package/library/fn/object/lookup-setter.js +2 -0
- package/library/fn/string/index.js +1 -0
- package/library/fn/string/match-all.js +2 -0
- package/library/fn/string/virtual/index.js +1 -0
- package/library/fn/string/virtual/match-all.js +2 -0
- package/library/fn/symbol/async-iterator.js +2 -0
- package/library/fn/symbol/has-instance.js +2 -1
- package/library/fn/symbol/index.js +2 -0
- package/library/fn/symbol/is-concat-spreadable.js +1 -1
- package/library/fn/symbol/iterator.js +1 -1
- package/library/fn/symbol/match.js +1 -1
- package/library/fn/symbol/observable.js +2 -0
- package/library/fn/symbol/replace.js +1 -1
- package/library/fn/symbol/search.js +1 -1
- package/library/fn/symbol/species.js +1 -1
- package/library/fn/symbol/split.js +1 -1
- package/library/fn/symbol/to-primitive.js +1 -1
- package/library/fn/symbol/to-string-tag.js +1 -1
- package/library/fn/symbol/unscopables.js +1 -1
- package/library/modules/_array-includes.js +1 -1
- package/library/modules/_array-species-constructor.js +16 -0
- package/library/modules/_array-species-create.js +3 -13
- package/library/modules/_core.js +1 -1
- package/library/modules/_create-property.js +8 -0
- package/library/modules/_date-to-primitive.js +9 -0
- package/library/modules/_iter-detect.js +1 -1
- package/library/modules/_math-expm1.js +8 -2
- package/library/modules/_microtask.js +58 -48
- package/library/modules/{_object-ipam.js → _object-forced-pam.js} +2 -2
- package/library/modules/_object-gopn-ext.js +2 -2
- package/library/modules/_string-pad.js +1 -2
- package/library/modules/_typed-array.js +11 -5
- package/library/modules/_wks-define.js +9 -0
- package/library/modules/_wks-ext.js +1 -0
- package/library/modules/_wks.js +5 -2
- package/library/modules/es6.array.filter.js +9 -9
- package/library/modules/es6.array.from.js +11 -9
- package/library/modules/es6.array.index-of.js +9 -4
- package/library/modules/es6.array.last-index-of.js +10 -6
- package/library/modules/es6.array.of.js +3 -2
- package/library/modules/es6.math.acosh.js +6 -2
- package/library/modules/es6.math.asinh.js +4 -2
- package/library/modules/es6.math.atanh.js +4 -2
- package/library/modules/es6.math.expm1.js +3 -2
- package/library/modules/es6.promise.js +1 -1
- package/library/modules/es6.symbol.js +58 -63
- package/library/modules/es7.array.includes.js +1 -1
- package/library/modules/es7.asap.js +12 -0
- package/library/modules/es7.object.define-getter.js +1 -1
- package/library/modules/es7.object.define-setter.js +1 -1
- package/library/modules/es7.object.entries.js +1 -1
- package/library/modules/es7.object.get-own-property-descriptors.js +8 -12
- package/library/modules/es7.object.lookup-getter.js +1 -1
- package/library/modules/es7.object.lookup-setter.js +1 -1
- package/library/modules/es7.object.values.js +1 -1
- package/library/modules/es7.string.match-all.js +7 -8
- package/library/modules/es7.string.pad-end.js +1 -0
- package/library/modules/es7.string.pad-start.js +1 -0
- package/library/modules/es7.symbol.async-iterator.js +1 -0
- package/library/modules/es7.symbol.observable.js +1 -0
- package/library/shim.js +11 -2
- package/library/stage/0.js +1 -0
- package/library/stage/1.js +3 -2
- package/library/stage/2.js +3 -1
- package/library/stage/3.js +1 -3
- package/library/stage/4.js +7 -1
- package/modules/_array-includes.js +1 -1
- package/modules/_array-species-constructor.js +16 -0
- package/modules/_array-species-create.js +3 -13
- package/modules/_core.js +1 -1
- package/modules/_create-property.js +8 -0
- package/modules/_date-to-primitive.js +9 -0
- package/modules/_iter-detect.js +1 -1
- package/modules/_math-expm1.js +8 -2
- package/modules/_microtask.js +58 -48
- package/modules/{_object-ipam.js → _object-forced-pam.js} +2 -2
- package/modules/_object-gopn-ext.js +2 -2
- package/modules/_string-pad.js +1 -2
- package/modules/_typed-array.js +11 -5
- package/modules/_wks-define.js +9 -0
- package/modules/_wks-ext.js +1 -0
- package/modules/_wks.js +5 -2
- package/modules/es6.array.filter.js +9 -9
- package/modules/es6.array.from.js +11 -9
- package/modules/es6.array.index-of.js +9 -4
- package/modules/es6.array.last-index-of.js +10 -6
- package/modules/es6.array.of.js +3 -2
- package/modules/es6.date.to-primitive.js +3 -11
- package/modules/es6.function.name.js +13 -4
- package/modules/es6.math.acosh.js +6 -2
- package/modules/es6.math.asinh.js +4 -2
- package/modules/es6.math.atanh.js +4 -2
- package/modules/es6.math.expm1.js +3 -2
- package/modules/es6.promise.js +1 -1
- package/modules/es6.symbol.js +58 -63
- package/modules/es7.array.includes.js +1 -1
- package/modules/es7.asap.js +12 -0
- package/modules/es7.object.define-getter.js +1 -1
- package/modules/es7.object.define-setter.js +1 -1
- package/modules/es7.object.entries.js +1 -1
- package/modules/es7.object.get-own-property-descriptors.js +8 -12
- package/modules/es7.object.lookup-getter.js +1 -1
- package/modules/es7.object.lookup-setter.js +1 -1
- package/modules/es7.object.values.js +1 -1
- package/modules/es7.string.match-all.js +7 -8
- package/modules/es7.string.pad-end.js +1 -0
- package/modules/es7.string.pad-start.js +1 -0
- package/modules/es7.symbol.async-iterator.js +1 -0
- package/modules/es7.symbol.observable.js +1 -0
- package/package.json +7 -7
- package/shim.js +11 -2
- package/stage/0.js +1 -0
- package/stage/1.js +3 -2
- package/stage/2.js +3 -1
- package/stage/3.js +1 -3
- package/stage/4.js +7 -1
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var $export
|
|
3
|
-
, toIObject
|
|
4
|
-
, toInteger
|
|
5
|
-
, toLength
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, toIObject = require('./_to-iobject')
|
|
4
|
+
, toInteger = require('./_to-integer')
|
|
5
|
+
, toLength = require('./_to-length')
|
|
6
|
+
, $native = [].lastIndexOf
|
|
7
|
+
, NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
|
|
6
8
|
|
|
7
|
-
$export($export.P + $export.F * !require('./_strict-method')(
|
|
9
|
+
$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {
|
|
8
10
|
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
|
|
9
11
|
lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){
|
|
12
|
+
// convert -0 to +0
|
|
13
|
+
if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0;
|
|
10
14
|
var O = toIObject(this)
|
|
11
15
|
, length = toLength(O.length)
|
|
12
16
|
, index = length - 1;
|
|
13
17
|
if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1]));
|
|
14
18
|
if(index < 0)index = length + index;
|
|
15
|
-
for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index;
|
|
19
|
+
for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0;
|
|
16
20
|
return -1;
|
|
17
21
|
}
|
|
18
22
|
});
|
package/modules/es6.array.of.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var $export
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, createProperty = require('./_create-property');
|
|
3
4
|
|
|
4
5
|
// WebKit Array.of isn't generic
|
|
5
6
|
$export($export.S + $export.F * require('./_fails')(function(){
|
|
@@ -11,7 +12,7 @@ $export($export.S + $export.F * require('./_fails')(function(){
|
|
|
11
12
|
var index = 0
|
|
12
13
|
, aLen = arguments.length
|
|
13
14
|
, result = new (typeof this == 'function' ? this : Array)(aLen);
|
|
14
|
-
while(aLen > index)result
|
|
15
|
+
while(aLen > index)createProperty(result, index, arguments[index++]);
|
|
15
16
|
result.length = aLen;
|
|
16
17
|
return result;
|
|
17
18
|
}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
, anObject = require('./_an-object')
|
|
4
|
-
, toPrimitive = require('./_to-primitive')
|
|
5
|
-
, TO_PRIMITIVE = require('./_wks')('toPrimitive')
|
|
6
|
-
, proto = Date.prototype
|
|
7
|
-
, NUMBER = 'number';
|
|
1
|
+
var TO_PRIMITIVE = require('./_wks')('toPrimitive')
|
|
2
|
+
, proto = Date.prototype;
|
|
8
3
|
|
|
9
|
-
if(!(TO_PRIMITIVE in proto))
|
|
10
|
-
if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint');
|
|
11
|
-
return toPrimitive(anObject(this), hint != NUMBER);
|
|
12
|
-
});
|
|
4
|
+
if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));
|
|
@@ -4,13 +4,22 @@ var dP = require('./_object-dp').f
|
|
|
4
4
|
, FProto = Function.prototype
|
|
5
5
|
, nameRE = /^\s*function ([^ (]*)/
|
|
6
6
|
, NAME = 'name';
|
|
7
|
+
|
|
8
|
+
var isExtensible = Object.isExtensible || function(){
|
|
9
|
+
return true;
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
// 19.2.4.2 name
|
|
8
13
|
NAME in FProto || require('./_descriptors') && dP(FProto, NAME, {
|
|
9
14
|
configurable: true,
|
|
10
15
|
get: function(){
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
try {
|
|
17
|
+
var that = this
|
|
18
|
+
, name = ('' + that).match(nameRE)[1];
|
|
19
|
+
has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
|
|
20
|
+
return name;
|
|
21
|
+
} catch(e){
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
15
24
|
}
|
|
16
25
|
});
|
|
@@ -4,8 +4,12 @@ var $export = require('./_export')
|
|
|
4
4
|
, sqrt = Math.sqrt
|
|
5
5
|
, $acosh = Math.acosh;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
$export($export.S + $export.F * !($acosh
|
|
8
|
+
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
|
|
9
|
+
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
|
|
10
|
+
// Tor Browser bug: Math.acosh(Infinity) -> NaN
|
|
11
|
+
&& $acosh(Infinity) == Infinity
|
|
12
|
+
), 'Math', {
|
|
9
13
|
acosh: function acosh(x){
|
|
10
14
|
return (x = +x) < 1 ? NaN : x > 94906265.62425156
|
|
11
15
|
? Math.log(x) + Math.LN2
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// 20.2.2.5 Math.asinh(x)
|
|
2
|
-
var $export = require('./_export')
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, $asinh = Math.asinh;
|
|
3
4
|
|
|
4
5
|
function asinh(x){
|
|
5
6
|
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
// Tor Browser bug: Math.asinh(0) -> -0
|
|
10
|
+
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// 20.2.2.7 Math.atanh(x)
|
|
2
|
-
var $export = require('./_export')
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, $atanh = Math.atanh;
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
// Tor Browser bug: Math.atanh(-0) -> 0
|
|
6
|
+
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
|
|
5
7
|
atanh: function atanh(x){
|
|
6
8
|
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
|
|
7
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// 20.2.2.14 Math.expm1(x)
|
|
2
|
-
var $export = require('./_export')
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, $expm1 = require('./_math-expm1');
|
|
3
4
|
|
|
4
|
-
$export($export.S, 'Math', {expm1:
|
|
5
|
+
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1});
|
package/modules/es6.promise.js
CHANGED
|
@@ -12,7 +12,7 @@ var LIBRARY = require('./_library')
|
|
|
12
12
|
, setProto = require('./_set-proto').set
|
|
13
13
|
, speciesConstructor = require('./_species-constructor')
|
|
14
14
|
, task = require('./_task').set
|
|
15
|
-
, microtask = require('./_microtask')
|
|
15
|
+
, microtask = require('./_microtask')()
|
|
16
16
|
, PROMISE = 'Promise'
|
|
17
17
|
, TypeError = global.TypeError
|
|
18
18
|
, process = global.process
|
package/modules/es6.symbol.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// ECMAScript 6 symbols shim
|
|
3
3
|
var global = require('./_global')
|
|
4
|
-
, core = require('./_core')
|
|
5
4
|
, has = require('./_has')
|
|
6
5
|
, DESCRIPTORS = require('./_descriptors')
|
|
7
6
|
, $export = require('./_export')
|
|
@@ -12,6 +11,8 @@ var global = require('./_global')
|
|
|
12
11
|
, setToStringTag = require('./_set-to-string-tag')
|
|
13
12
|
, uid = require('./_uid')
|
|
14
13
|
, wks = require('./_wks')
|
|
14
|
+
, wksExt = require('./_wks-ext')
|
|
15
|
+
, wksDefine = require('./_wks-define')
|
|
15
16
|
, keyOf = require('./_keyof')
|
|
16
17
|
, enumKeys = require('./_enum-keys')
|
|
17
18
|
, isArray = require('./_is-array')
|
|
@@ -23,20 +24,24 @@ var global = require('./_global')
|
|
|
23
24
|
, gOPNExt = require('./_object-gopn-ext')
|
|
24
25
|
, $GOPD = require('./_object-gopd')
|
|
25
26
|
, $DP = require('./_object-dp')
|
|
27
|
+
, $keys = require('./_object-keys')
|
|
26
28
|
, gOPD = $GOPD.f
|
|
27
29
|
, dP = $DP.f
|
|
28
30
|
, gOPN = gOPNExt.f
|
|
29
31
|
, $Symbol = global.Symbol
|
|
30
32
|
, $JSON = global.JSON
|
|
31
33
|
, _stringify = $JSON && $JSON.stringify
|
|
32
|
-
,
|
|
34
|
+
, PROTOTYPE = 'prototype'
|
|
33
35
|
, HIDDEN = wks('_hidden')
|
|
36
|
+
, TO_PRIMITIVE = wks('toPrimitive')
|
|
34
37
|
, isEnum = {}.propertyIsEnumerable
|
|
35
38
|
, SymbolRegistry = shared('symbol-registry')
|
|
36
39
|
, AllSymbols = shared('symbols')
|
|
37
|
-
, ObjectProto = Object
|
|
40
|
+
, ObjectProto = Object[PROTOTYPE]
|
|
38
41
|
, USE_NATIVE = typeof $Symbol == 'function'
|
|
39
42
|
, QObject = global.QObject;
|
|
43
|
+
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
|
44
|
+
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
|
40
45
|
|
|
41
46
|
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
|
42
47
|
var setSymbolDesc = DESCRIPTORS && $fails(function(){
|
|
@@ -51,20 +56,15 @@ var setSymbolDesc = DESCRIPTORS && $fails(function(){
|
|
|
51
56
|
} : dP;
|
|
52
57
|
|
|
53
58
|
var wrap = function(tag){
|
|
54
|
-
var sym = AllSymbols[tag] = _create($Symbol
|
|
59
|
+
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
|
|
55
60
|
sym._k = tag;
|
|
56
|
-
DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, {
|
|
57
|
-
configurable: true,
|
|
58
|
-
set: function(value){
|
|
59
|
-
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
|
|
60
|
-
setSymbolDesc(this, tag, createDesc(1, value));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
61
|
return sym;
|
|
64
62
|
};
|
|
65
63
|
|
|
66
|
-
var isSymbol = function(it){
|
|
64
|
+
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
|
|
67
65
|
return typeof it == 'symbol';
|
|
66
|
+
} : function(it){
|
|
67
|
+
return it instanceof $Symbol;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
var $defineProperty = function defineProperty(it, key, D){
|
|
@@ -118,78 +118,48 @@ var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
|
|
|
118
118
|
while(names.length > i)if(has(AllSymbols, key = names[i++]))result.push(AllSymbols[key]);
|
|
119
119
|
return result;
|
|
120
120
|
};
|
|
121
|
-
var $stringify = function stringify(it){
|
|
122
|
-
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
|
|
123
|
-
var args = [it]
|
|
124
|
-
, i = 1
|
|
125
|
-
, replacer, $replacer;
|
|
126
|
-
while(arguments.length > i)args.push(arguments[i++]);
|
|
127
|
-
replacer = args[1];
|
|
128
|
-
if(typeof replacer == 'function')$replacer = replacer;
|
|
129
|
-
if($replacer || !isArray(replacer))replacer = function(key, value){
|
|
130
|
-
if($replacer)value = $replacer.call(this, key, value);
|
|
131
|
-
if(!isSymbol(value))return value;
|
|
132
|
-
};
|
|
133
|
-
args[1] = replacer;
|
|
134
|
-
return _stringify.apply($JSON, args);
|
|
135
|
-
};
|
|
136
|
-
var BUGGY_JSON = $fails(function(){
|
|
137
|
-
var S = $Symbol();
|
|
138
|
-
// MS Edge converts symbol values to JSON as {}
|
|
139
|
-
// WebKit converts symbol values to JSON as null
|
|
140
|
-
// V8 throws on boxed symbols
|
|
141
|
-
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
|
|
142
|
-
});
|
|
143
121
|
|
|
144
122
|
// 19.4.1.1 Symbol([description])
|
|
145
123
|
if(!USE_NATIVE){
|
|
146
124
|
$Symbol = function Symbol(){
|
|
147
|
-
if(
|
|
148
|
-
|
|
125
|
+
if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
|
|
126
|
+
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
|
|
127
|
+
DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, {
|
|
128
|
+
configurable: true,
|
|
129
|
+
set: function(value){
|
|
130
|
+
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
|
|
131
|
+
setSymbolDesc(this, tag, createDesc(1, value));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return wrap(tag);
|
|
149
135
|
};
|
|
150
|
-
redefine($Symbol
|
|
136
|
+
redefine($Symbol[PROTOTYPE], 'toString', function toString(){
|
|
151
137
|
return this._k;
|
|
152
138
|
});
|
|
153
139
|
|
|
154
|
-
isSymbol = function(it){
|
|
155
|
-
return it instanceof $Symbol;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
140
|
$GOPD.f = $getOwnPropertyDescriptor;
|
|
159
141
|
$DP.f = $defineProperty;
|
|
160
142
|
require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
|
|
161
|
-
require('./_object-pie').f = $propertyIsEnumerable
|
|
143
|
+
require('./_object-pie').f = $propertyIsEnumerable;
|
|
162
144
|
require('./_object-gops').f = $getOwnPropertySymbols;
|
|
163
145
|
|
|
164
146
|
if(DESCRIPTORS && !require('./_library')){
|
|
165
147
|
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
|
|
166
148
|
}
|
|
149
|
+
|
|
150
|
+
wksExt.f = function(name){
|
|
151
|
+
return wrap(wks(name));
|
|
152
|
+
}
|
|
167
153
|
}
|
|
168
154
|
|
|
169
155
|
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
|
|
170
156
|
|
|
171
|
-
// 19.4.2.2 Symbol.hasInstance
|
|
172
|
-
// 19.4.2.3 Symbol.isConcatSpreadable
|
|
173
|
-
// 19.4.2.4 Symbol.iterator
|
|
174
|
-
// 19.4.2.6 Symbol.match
|
|
175
|
-
// 19.4.2.8 Symbol.replace
|
|
176
|
-
// 19.4.2.9 Symbol.search
|
|
177
|
-
// 19.4.2.10 Symbol.species
|
|
178
|
-
// 19.4.2.11 Symbol.split
|
|
179
|
-
// 19.4.2.12 Symbol.toPrimitive
|
|
180
|
-
// 19.4.2.13 Symbol.toStringTag
|
|
181
|
-
// 19.4.2.14 Symbol.unscopables
|
|
182
157
|
for(var symbols = (
|
|
158
|
+
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
|
|
183
159
|
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
|
|
184
|
-
).split(','), i = 0; symbols.length > i; )
|
|
185
|
-
var key = symbols[i++]
|
|
186
|
-
, Wrapper = core.Symbol
|
|
187
|
-
, sym = wks(key);
|
|
188
|
-
if(!(key in Wrapper))dP(Wrapper, key, {value: USE_NATIVE ? sym : wrap(sym)});
|
|
189
|
-
};
|
|
160
|
+
).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
|
|
190
161
|
|
|
191
|
-
|
|
192
|
-
if(!QObject || !QObject.prototype || !QObject.prototype.findChild)setter = true;
|
|
162
|
+
for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
|
|
193
163
|
|
|
194
164
|
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
|
195
165
|
// 19.4.2.1 Symbol.for(key)
|
|
@@ -200,7 +170,8 @@ $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
|
|
|
200
170
|
},
|
|
201
171
|
// 19.4.2.5 Symbol.keyFor(sym)
|
|
202
172
|
keyFor: function keyFor(key){
|
|
203
|
-
return keyOf(SymbolRegistry, key);
|
|
173
|
+
if(isSymbol(key))return keyOf(SymbolRegistry, key);
|
|
174
|
+
throw TypeError(key + ' is not a symbol!');
|
|
204
175
|
},
|
|
205
176
|
useSetter: function(){ setter = true; },
|
|
206
177
|
useSimple: function(){ setter = false; }
|
|
@@ -222,8 +193,32 @@ $export($export.S + $export.F * !USE_NATIVE, 'Object', {
|
|
|
222
193
|
});
|
|
223
194
|
|
|
224
195
|
// 24.3.2 JSON.stringify(value [, replacer [, space]])
|
|
225
|
-
$JSON && $export($export.S + $export.F * (!USE_NATIVE ||
|
|
196
|
+
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
|
|
197
|
+
var S = $Symbol();
|
|
198
|
+
// MS Edge converts symbol values to JSON as {}
|
|
199
|
+
// WebKit converts symbol values to JSON as null
|
|
200
|
+
// V8 throws on boxed symbols
|
|
201
|
+
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
|
|
202
|
+
})), 'JSON', {
|
|
203
|
+
stringify: function stringify(it){
|
|
204
|
+
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
|
|
205
|
+
var args = [it]
|
|
206
|
+
, i = 1
|
|
207
|
+
, replacer, $replacer;
|
|
208
|
+
while(arguments.length > i)args.push(arguments[i++]);
|
|
209
|
+
replacer = args[1];
|
|
210
|
+
if(typeof replacer == 'function')$replacer = replacer;
|
|
211
|
+
if($replacer || !isArray(replacer))replacer = function(key, value){
|
|
212
|
+
if($replacer)value = $replacer.call(this, key, value);
|
|
213
|
+
if(!isSymbol(value))return value;
|
|
214
|
+
};
|
|
215
|
+
args[1] = replacer;
|
|
216
|
+
return _stringify.apply($JSON, args);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
226
219
|
|
|
220
|
+
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
|
|
221
|
+
$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
|
227
222
|
// 19.4.3.5 Symbol.prototype[@@toStringTag]
|
|
228
223
|
setToStringTag($Symbol, 'Symbol');
|
|
229
224
|
// 20.2.1.9 Math[@@toStringTag]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
// https://github.com/tc39/Array.prototype.includes
|
|
2
3
|
var $export = require('./_export')
|
|
3
4
|
, $includes = require('./_array-includes')(true);
|
|
4
5
|
|
|
5
6
|
$export($export.P, 'Array', {
|
|
6
|
-
// https://github.com/domenic/Array.prototype.includes
|
|
7
7
|
includes: function includes(el /*, fromIndex = 0 */){
|
|
8
8
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
9
9
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, microtask = require('./_microtask')()
|
|
4
|
+
, process = require('./_global').process
|
|
5
|
+
, isNode = require('./_cof')(process) == 'process';
|
|
6
|
+
|
|
7
|
+
$export($export.G, {
|
|
8
|
+
asap: function asap(fn){
|
|
9
|
+
var domain = isNode && process.domain;
|
|
10
|
+
microtask(domain ? domain.bind(fn) : fn);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -5,7 +5,7 @@ var $export = require('./_export')
|
|
|
5
5
|
, $defineProperty = require('./_object-dp');
|
|
6
6
|
|
|
7
7
|
// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
|
|
8
|
-
require('./_descriptors') && $export($export.P + require('./_object-
|
|
8
|
+
require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
|
|
9
9
|
__defineGetter__: function __defineGetter__(P, getter){
|
|
10
10
|
$defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true});
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ var $export = require('./_export')
|
|
|
5
5
|
, $defineProperty = require('./_object-dp');
|
|
6
6
|
|
|
7
7
|
// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
|
|
8
|
-
require('./_descriptors') && $export($export.P + require('./_object-
|
|
8
|
+
require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
|
|
9
9
|
__defineSetter__: function __defineSetter__(P, setter){
|
|
10
10
|
$defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true});
|
|
11
11
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
// https://
|
|
2
|
-
var $export
|
|
3
|
-
, ownKeys
|
|
4
|
-
, toIObject
|
|
5
|
-
,
|
|
6
|
-
,
|
|
7
|
-
, dP = require('./_object-dp');
|
|
1
|
+
// https://github.com/tc39/proposal-object-getownpropertydescriptors
|
|
2
|
+
var $export = require('./_export')
|
|
3
|
+
, ownKeys = require('./_own-keys')
|
|
4
|
+
, toIObject = require('./_to-iobject')
|
|
5
|
+
, gOPD = require('./_object-gopd')
|
|
6
|
+
, createProperty = require('./_create-property');
|
|
8
7
|
|
|
9
8
|
$export($export.S, 'Object', {
|
|
10
9
|
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
|
|
@@ -14,10 +13,7 @@ $export($export.S, 'Object', {
|
|
|
14
13
|
, result = {}
|
|
15
14
|
, i = 0
|
|
16
15
|
, key, D;
|
|
17
|
-
while(keys.length > i)
|
|
18
|
-
|
|
19
|
-
if(key in result)dP.f(result, key, createDesc(0, D));
|
|
20
|
-
else result[key] = D;
|
|
21
|
-
} return result;
|
|
16
|
+
while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
|
|
17
|
+
return result;
|
|
22
18
|
}
|
|
23
19
|
});
|
|
@@ -6,7 +6,7 @@ var $export = require('./_export')
|
|
|
6
6
|
, getOwnPropertyDescriptor = require('./_object-gopd').f;
|
|
7
7
|
|
|
8
8
|
// B.2.2.4 Object.prototype.__lookupGetter__(P)
|
|
9
|
-
require('./_descriptors') && $export($export.P + require('./_object-
|
|
9
|
+
require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
|
|
10
10
|
__lookupGetter__: function __lookupGetter__(P){
|
|
11
11
|
var O = toObject(this)
|
|
12
12
|
, K = toPrimitive(P, true)
|
|
@@ -6,7 +6,7 @@ var $export = require('./_export')
|
|
|
6
6
|
, getOwnPropertyDescriptor = require('./_object-gopd').f;
|
|
7
7
|
|
|
8
8
|
// B.2.2.5 Object.prototype.__lookupSetter__(P)
|
|
9
|
-
require('./_descriptors') && $export($export.P + require('./_object-
|
|
9
|
+
require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
|
|
10
10
|
__lookupSetter__: function __lookupSetter__(P){
|
|
11
11
|
var O = toObject(this)
|
|
12
12
|
, K = toPrimitive(P, true)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// https://tc39.github.io/String.prototype.matchAll/
|
|
3
|
-
require('./
|
|
4
|
-
|
|
5
|
-
,
|
|
6
|
-
,
|
|
7
|
-
,
|
|
8
|
-
,
|
|
9
|
-
, getFlags = require('./_flags');
|
|
3
|
+
var $export = require('./_export')
|
|
4
|
+
, defined = require('./_defined')
|
|
5
|
+
, toLength = require('./_to-length')
|
|
6
|
+
, isRegExp = require('./_is-regexp')
|
|
7
|
+
, getFlags = require('./_flags')
|
|
8
|
+
, RegExpProto = RegExp.prototype;
|
|
10
9
|
|
|
11
10
|
var $RegExpStringIterator = function(regexp, string){
|
|
12
11
|
this._r = regexp;
|
|
@@ -23,7 +22,7 @@ $export($export.P, 'String', {
|
|
|
23
22
|
defined(this);
|
|
24
23
|
if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!');
|
|
25
24
|
var S = String(this)
|
|
26
|
-
, flags =
|
|
25
|
+
, flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp)
|
|
27
26
|
, rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
|
|
28
27
|
rx.lastIndex = toLength(regexp.lastIndex);
|
|
29
28
|
return new $RegExpStringIterator(rx, S);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./_wks-define')('asyncIterator');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./_wks-define')('observable');
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-js",
|
|
3
3
|
"description": "Standard library",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/zloirock/core-js.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"webpack": "1.
|
|
11
|
+
"webpack": "1.13.x",
|
|
12
12
|
"LiveScript": "1.3.x",
|
|
13
|
-
"grunt": "0.
|
|
14
|
-
"grunt-cli": "
|
|
13
|
+
"grunt": "1.0.x",
|
|
14
|
+
"grunt-cli": "1.2.x",
|
|
15
15
|
"grunt-livescript": "0.6.x",
|
|
16
16
|
"grunt-contrib-uglify": "1.0.x",
|
|
17
|
-
"grunt-contrib-watch": "0.
|
|
17
|
+
"grunt-contrib-watch": "1.0.x",
|
|
18
18
|
"grunt-contrib-clean": "1.0.x",
|
|
19
19
|
"grunt-contrib-copy": "1.0.x",
|
|
20
20
|
"grunt-karma": "0.12.x",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"karma-ie-launcher": "0.2.x",
|
|
25
25
|
"karma-firefox-launcher": "0.1.x",
|
|
26
26
|
"karma-phantomjs-launcher": "1.0.x",
|
|
27
|
-
"qunitjs": "1.
|
|
27
|
+
"qunitjs": "1.23.x",
|
|
28
28
|
"phantomjs-prebuilt": "2.1.x",
|
|
29
29
|
"promises-aplus-tests": "2.1.x",
|
|
30
|
-
"eslint": "2.
|
|
30
|
+
"eslint": "2.8.x",
|
|
31
31
|
"temp": "0.8.x"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
package/shim.js
CHANGED
|
@@ -73,9 +73,10 @@ require('./modules/es6.string.strike');
|
|
|
73
73
|
require('./modules/es6.string.sub');
|
|
74
74
|
require('./modules/es6.string.sup');
|
|
75
75
|
require('./modules/es6.date.now');
|
|
76
|
-
require('./modules/es6.date.to-string');
|
|
77
|
-
require('./modules/es6.date.to-iso-string');
|
|
78
76
|
require('./modules/es6.date.to-json');
|
|
77
|
+
require('./modules/es6.date.to-iso-string');
|
|
78
|
+
require('./modules/es6.date.to-string');
|
|
79
|
+
require('./modules/es6.date.to-primitive');
|
|
79
80
|
require('./modules/es6.array.is-array');
|
|
80
81
|
require('./modules/es6.array.from');
|
|
81
82
|
require('./modules/es6.array.of');
|
|
@@ -140,9 +141,16 @@ require('./modules/es7.string.pad-start');
|
|
|
140
141
|
require('./modules/es7.string.pad-end');
|
|
141
142
|
require('./modules/es7.string.trim-left');
|
|
142
143
|
require('./modules/es7.string.trim-right');
|
|
144
|
+
require('./modules/es7.string.match-all');
|
|
145
|
+
require('./modules/es7.symbol.async-iterator');
|
|
146
|
+
require('./modules/es7.symbol.observable');
|
|
143
147
|
require('./modules/es7.object.get-own-property-descriptors');
|
|
144
148
|
require('./modules/es7.object.values');
|
|
145
149
|
require('./modules/es7.object.entries');
|
|
150
|
+
require('./modules/es7.object.define-getter');
|
|
151
|
+
require('./modules/es7.object.define-setter');
|
|
152
|
+
require('./modules/es7.object.lookup-getter');
|
|
153
|
+
require('./modules/es7.object.lookup-setter');
|
|
146
154
|
require('./modules/es7.map.to-json');
|
|
147
155
|
require('./modules/es7.set.to-json');
|
|
148
156
|
require('./modules/es7.system.global');
|
|
@@ -160,6 +168,7 @@ require('./modules/es7.reflect.get-own-metadata-keys');
|
|
|
160
168
|
require('./modules/es7.reflect.has-metadata');
|
|
161
169
|
require('./modules/es7.reflect.has-own-metadata');
|
|
162
170
|
require('./modules/es7.reflect.metadata');
|
|
171
|
+
require('./modules/es7.asap');
|
|
163
172
|
require('./modules/web.timers');
|
|
164
173
|
require('./modules/web.immediate');
|
|
165
174
|
require('./modules/web.dom.iterable');
|
package/stage/0.js
CHANGED
package/stage/1.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require('../modules/es7.string.trim-left');
|
|
2
2
|
require('../modules/es7.string.trim-right');
|
|
3
|
-
require('../modules/es7.
|
|
4
|
-
|
|
3
|
+
require('../modules/es7.string.match-all');
|
|
4
|
+
require('../modules/es7.symbol.observable');
|
|
5
|
+
module.exports = require('./2');
|
package/stage/2.js
CHANGED
package/stage/3.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
require('../modules/es7.object.get-own-property-descriptors');
|
|
2
|
-
require('../modules/es7.object.values');
|
|
3
|
-
require('../modules/es7.object.entries');
|
|
4
2
|
require('../modules/es7.string.pad-start');
|
|
5
3
|
require('../modules/es7.string.pad-end');
|
|
6
|
-
module.exports = require('./4');
|
|
4
|
+
module.exports = require('./4');
|