commit
a1b8a765f7
@ -7,12 +7,14 @@ module.exports = {
|
|||||||
Set: "set",
|
Set: "set",
|
||||||
WeakSet: "weak-set",
|
WeakSet: "weak-set",
|
||||||
setImmediate: "set-immediate",
|
setImmediate: "set-immediate",
|
||||||
clearImmediate: "clear-immediate"
|
clearImmediate: "clear-immediate",
|
||||||
|
parseFloat: "parse-float",
|
||||||
|
parseInt: "parse-int"
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
Array: {
|
Array: {
|
||||||
concat: "array/concat",
|
concat: "array/concat", // deprecated
|
||||||
copyWithin: "array/copy-within",
|
copyWithin: "array/copy-within",
|
||||||
entries: "array/entries",
|
entries: "array/entries",
|
||||||
every: "array/every",
|
every: "array/every",
|
||||||
@ -24,22 +26,23 @@ module.exports = {
|
|||||||
from: "array/from",
|
from: "array/from",
|
||||||
includes: "array/includes",
|
includes: "array/includes",
|
||||||
indexOf: "array/index-of",
|
indexOf: "array/index-of",
|
||||||
|
isArray: "array/is-array",
|
||||||
join: "array/join",
|
join: "array/join",
|
||||||
keys: "array/keys",
|
keys: "array/keys",
|
||||||
lastIndexOf: "array/last-index-of",
|
lastIndexOf: "array/last-index-of",
|
||||||
map: "array/map",
|
map: "array/map",
|
||||||
of: "array/of",
|
of: "array/of",
|
||||||
pop: "array/pop",
|
pop: "array/pop", // deprecated
|
||||||
push: "array/push",
|
push: "array/push", // deprecated
|
||||||
reduceRight: "array/reduce-right",
|
reduceRight: "array/reduce-right",
|
||||||
reduce: "array/reduce",
|
reduce: "array/reduce",
|
||||||
reverse: "array/reverse",
|
reverse: "array/reverse", // deprecated
|
||||||
shift: "array/shift",
|
shift: "array/shift", // deprecated
|
||||||
slice: "array/slice",
|
slice: "array/slice", // deprecated
|
||||||
some: "array/some",
|
some: "array/some",
|
||||||
sort: "array/sort",
|
sort: "array/sort",
|
||||||
splice: "array/splice",
|
splice: "array/splice",
|
||||||
unshift: "array/unshift",
|
unshift: "array/unshift", // deprecated
|
||||||
values: "array/values"
|
values: "array/values"
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -71,7 +74,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
RegExp: {
|
RegExp: {
|
||||||
escape: "regexp/escape"
|
escape: "regexp/escape" // deprecated
|
||||||
},
|
},
|
||||||
|
|
||||||
Math: {
|
Math: {
|
||||||
@ -91,7 +94,11 @@ module.exports = {
|
|||||||
sign: "math/sign",
|
sign: "math/sign",
|
||||||
sinh: "math/sinh",
|
sinh: "math/sinh",
|
||||||
tanh: "math/tanh",
|
tanh: "math/tanh",
|
||||||
trunc: "math/trunc"
|
trunc: "math/trunc",
|
||||||
|
iaddh: "math/iaddh",
|
||||||
|
isubh: "math/isubh",
|
||||||
|
imulh: "math/imulh",
|
||||||
|
umulh: "math/umulh"
|
||||||
},
|
},
|
||||||
|
|
||||||
Symbol: {
|
Symbol: {
|
||||||
@ -116,14 +123,18 @@ module.exports = {
|
|||||||
endsWith: "string/ends-with",
|
endsWith: "string/ends-with",
|
||||||
fromCodePoint: "string/from-code-point",
|
fromCodePoint: "string/from-code-point",
|
||||||
includes: "string/includes",
|
includes: "string/includes",
|
||||||
padLeft: "string/pad-left",
|
padLeft: "string/pad-start", // deprecated
|
||||||
padRight: "string/pad-right",
|
padRight: "string/pad-end", // deprecated
|
||||||
|
padStart: "string/pad-start",
|
||||||
|
padEnd: "string/pad-end",
|
||||||
raw: "string/raw",
|
raw: "string/raw",
|
||||||
repeat: "string/repeat",
|
repeat: "string/repeat",
|
||||||
startsWith: "string/starts-with",
|
startsWith: "string/starts-with",
|
||||||
trim: "string/trim",
|
trim: "string/trim",
|
||||||
trimLeft: "string/trim-left",
|
trimLeft: "string/trim-left",
|
||||||
trimRight: "string/trim-right"
|
trimRight: "string/trim-right",
|
||||||
|
trimStart: "string/trim-start",
|
||||||
|
trimEnd: "string/trim-end"
|
||||||
},
|
},
|
||||||
|
|
||||||
Number: {
|
Number: {
|
||||||
@ -143,7 +154,7 @@ module.exports = {
|
|||||||
construct: "reflect/construct",
|
construct: "reflect/construct",
|
||||||
defineProperty: "reflect/define-property",
|
defineProperty: "reflect/define-property",
|
||||||
deleteProperty: "reflect/delete-property",
|
deleteProperty: "reflect/delete-property",
|
||||||
enumerate: "reflect/enumerate",
|
enumerate: "reflect/enumerate", // deprecated
|
||||||
getOwnPropertyDescriptor: "reflect/get-own-property-descriptor",
|
getOwnPropertyDescriptor: "reflect/get-own-property-descriptor",
|
||||||
getPrototypeOf: "reflect/get-prototype-of",
|
getPrototypeOf: "reflect/get-prototype-of",
|
||||||
get: "reflect/get",
|
get: "reflect/get",
|
||||||
@ -152,7 +163,33 @@ module.exports = {
|
|||||||
ownKeys: "reflect/own-keys",
|
ownKeys: "reflect/own-keys",
|
||||||
preventExtensions: "reflect/prevent-extensions",
|
preventExtensions: "reflect/prevent-extensions",
|
||||||
setPrototypeOf: "reflect/set-prototype-of",
|
setPrototypeOf: "reflect/set-prototype-of",
|
||||||
set: "reflect/set"
|
set: "reflect/set",
|
||||||
|
defineMetadata: "reflect/define-metadata",
|
||||||
|
deleteMetadata: "reflect/delete-metadata",
|
||||||
|
getMetadata: "reflect/get-metadata",
|
||||||
|
getMetadataKeys: "reflect/get-metadata-keys",
|
||||||
|
getOwnMetadata: "reflect/get-own-metadata",
|
||||||
|
getOwnMetadataKeys: "reflect/get-own-metadata-keys",
|
||||||
|
hasMetadata: "reflect/has-metadata",
|
||||||
|
hasOwnMetadata: "reflect/has-own-metadata",
|
||||||
|
metadata: "reflect/metadata"
|
||||||
|
},
|
||||||
|
|
||||||
|
System: {
|
||||||
|
global: "system/global"
|
||||||
|
},
|
||||||
|
|
||||||
|
Error: {
|
||||||
|
isError: "error/is-error"
|
||||||
|
},
|
||||||
|
|
||||||
|
Date: {
|
||||||
|
now: "date/now"
|
||||||
|
},
|
||||||
|
|
||||||
|
Function: {
|
||||||
|
// Warning: /virtual/ method - prototype, not static, version
|
||||||
|
bind: "function/virtual/bind"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-polyfill",
|
"repository": "https://github.com/babel/babel/tree/master/packages/babel-polyfill",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^1.0.1",
|
"core-js": "^2.1.0",
|
||||||
"babel-regenerator-runtime": "^6.3.13",
|
"babel-regenerator-runtime": "^6.3.13",
|
||||||
"babel-runtime": "^5.0.0"
|
"babel-runtime": "^5.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,3 +5,22 @@ global._babelPolyfill = true;
|
|||||||
|
|
||||||
import "core-js/shim";
|
import "core-js/shim";
|
||||||
import "babel-regenerator-runtime";
|
import "babel-regenerator-runtime";
|
||||||
|
|
||||||
|
// Should be removed in the next major release:
|
||||||
|
|
||||||
|
import "core-js/fn/regexp/escape";
|
||||||
|
|
||||||
|
function define(O, key, value){
|
||||||
|
O[key] || Object.defineProperty(O, key, {
|
||||||
|
writable: true,
|
||||||
|
configurable: true,
|
||||||
|
value: value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
define(String.prototype, "padLeft", "".padStart);
|
||||||
|
define(String.prototype, "padRight", "".padEnd);
|
||||||
|
|
||||||
|
"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(key){
|
||||||
|
[][key] && define(Array, key, Function.call.bind([][key]));
|
||||||
|
});
|
||||||
@ -10,7 +10,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-core": "^6.5.2",
|
"babel-core": "^6.5.2",
|
||||||
"babel-runtime": "^5.0.0",
|
"babel-runtime": "^5.0.0",
|
||||||
"core-js": "^1.0.0",
|
"core-js": "^2.1.0",
|
||||||
"home-or-tmp": "^1.0.0",
|
"home-or-tmp": "^1.0.0",
|
||||||
"lodash": "^3.10.0",
|
"lodash": "^3.10.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime",
|
"repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime",
|
||||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^1.2.0"
|
"core-js": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-helpers": "^6.3.13",
|
"babel-helpers": "^6.3.13",
|
||||||
|
|||||||
@ -21,6 +21,15 @@ each(paths, function (path) {
|
|||||||
writeFile("core-js/" + path + ".js", defaultify('require("core-js/library/fn/' + path + '")'));
|
writeFile("core-js/" + path + ".js", defaultify('require("core-js/library/fn/' + path + '")'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Should be removed in the next major release:
|
||||||
|
var legacy = {
|
||||||
|
"string/pad-left": "string/pad-start",
|
||||||
|
"string/pad-right": "string/pad-end"
|
||||||
|
};
|
||||||
|
|
||||||
|
each(legacy, function (value, key) {
|
||||||
|
writeFile("core-js/" + key + ".js", defaultify('require("core-js/library/fn/' + value + '")'));
|
||||||
|
});
|
||||||
|
|
||||||
var template = require("babel-template");
|
var template = require("babel-template");
|
||||||
var helpers = require("babel-helpers");
|
var helpers = require("babel-helpers");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user