[79a0317] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | exports.__esModule = true;
|
---|
| 4 | exports.StaticProperties = exports.InstanceProperties = exports.CommonIterators = exports.BuiltIns = void 0;
|
---|
| 5 | var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins"));
|
---|
| 6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
| 7 | const define = (name, pure, global = [], meta) => {
|
---|
| 8 | return {
|
---|
| 9 | name,
|
---|
| 10 | pure,
|
---|
| 11 | global,
|
---|
| 12 | meta
|
---|
| 13 | };
|
---|
| 14 | };
|
---|
| 15 | const pureAndGlobal = (pure, global, minRuntimeVersion = null) => define(global[0], pure, global, {
|
---|
| 16 | minRuntimeVersion
|
---|
| 17 | });
|
---|
| 18 | const globalOnly = global => define(global[0], null, global);
|
---|
| 19 | const pureOnly = (pure, name) => define(name, pure, []);
|
---|
| 20 | const ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"];
|
---|
| 21 | const CommonIterators = ["es6.string.iterator", ...ArrayNatureIterators];
|
---|
| 22 | exports.CommonIterators = CommonIterators;
|
---|
| 23 | const PromiseDependencies = ["es6.object.to-string", "es6.promise"];
|
---|
| 24 | const BuiltIns = {
|
---|
| 25 | DataView: globalOnly(["es6.typed.data-view"]),
|
---|
| 26 | Float32Array: globalOnly(["es6.typed.float32-array"]),
|
---|
| 27 | Float64Array: globalOnly(["es6.typed.float64-array"]),
|
---|
| 28 | Int8Array: globalOnly(["es6.typed.int8-array"]),
|
---|
| 29 | Int16Array: globalOnly(["es6.typed.int16-array"]),
|
---|
| 30 | Int32Array: globalOnly(["es6.typed.int32-array"]),
|
---|
| 31 | Map: pureAndGlobal("map", ["es6.map", ...CommonIterators]),
|
---|
| 32 | Number: globalOnly(["es6.number.constructor"]),
|
---|
| 33 | Promise: pureAndGlobal("promise", PromiseDependencies),
|
---|
| 34 | RegExp: globalOnly(["es6.regexp.constructor"]),
|
---|
| 35 | Set: pureAndGlobal("set", ["es6.set", ...CommonIterators]),
|
---|
| 36 | Symbol: pureAndGlobal("symbol/index", ["es6.symbol"]),
|
---|
| 37 | Uint8Array: globalOnly(["es6.typed.uint8-array"]),
|
---|
| 38 | Uint8ClampedArray: globalOnly(["es6.typed.uint8-clamped-array"]),
|
---|
| 39 | Uint16Array: globalOnly(["es6.typed.uint16-array"]),
|
---|
| 40 | Uint32Array: globalOnly(["es6.typed.uint32-array"]),
|
---|
| 41 | WeakMap: pureAndGlobal("weak-map", ["es6.weak-map", ...CommonIterators]),
|
---|
| 42 | WeakSet: pureAndGlobal("weak-set", ["es6.weak-set", ...CommonIterators]),
|
---|
| 43 | setImmediate: pureOnly("set-immediate", "web.immediate"),
|
---|
| 44 | clearImmediate: pureOnly("clear-immediate", "web.immediate"),
|
---|
| 45 | parseFloat: pureOnly("parse-float", "es6.parse-float"),
|
---|
| 46 | parseInt: pureOnly("parse-int", "es6.parse-int")
|
---|
| 47 | };
|
---|
| 48 | exports.BuiltIns = BuiltIns;
|
---|
| 49 | const InstanceProperties = {
|
---|
| 50 | __defineGetter__: globalOnly(["es7.object.define-getter"]),
|
---|
| 51 | __defineSetter__: globalOnly(["es7.object.define-setter"]),
|
---|
| 52 | __lookupGetter__: globalOnly(["es7.object.lookup-getter"]),
|
---|
| 53 | __lookupSetter__: globalOnly(["es7.object.lookup-setter"]),
|
---|
| 54 | anchor: globalOnly(["es6.string.anchor"]),
|
---|
| 55 | big: globalOnly(["es6.string.big"]),
|
---|
| 56 | bind: globalOnly(["es6.function.bind"]),
|
---|
| 57 | blink: globalOnly(["es6.string.blink"]),
|
---|
| 58 | bold: globalOnly(["es6.string.bold"]),
|
---|
| 59 | codePointAt: globalOnly(["es6.string.code-point-at"]),
|
---|
| 60 | copyWithin: globalOnly(["es6.array.copy-within"]),
|
---|
| 61 | endsWith: globalOnly(["es6.string.ends-with"]),
|
---|
| 62 | entries: globalOnly(ArrayNatureIterators),
|
---|
| 63 | every: globalOnly(["es6.array.every"]),
|
---|
| 64 | fill: globalOnly(["es6.array.fill"]),
|
---|
| 65 | filter: globalOnly(["es6.array.filter"]),
|
---|
| 66 | finally: globalOnly(["es7.promise.finally", ...PromiseDependencies]),
|
---|
| 67 | find: globalOnly(["es6.array.find"]),
|
---|
| 68 | findIndex: globalOnly(["es6.array.find-index"]),
|
---|
| 69 | fixed: globalOnly(["es6.string.fixed"]),
|
---|
| 70 | flags: globalOnly(["es6.regexp.flags"]),
|
---|
| 71 | flatMap: globalOnly(["es7.array.flat-map"]),
|
---|
| 72 | fontcolor: globalOnly(["es6.string.fontcolor"]),
|
---|
| 73 | fontsize: globalOnly(["es6.string.fontsize"]),
|
---|
| 74 | forEach: globalOnly(["es6.array.for-each"]),
|
---|
| 75 | includes: globalOnly(["es6.string.includes", "es7.array.includes"]),
|
---|
| 76 | indexOf: globalOnly(["es6.array.index-of"]),
|
---|
| 77 | italics: globalOnly(["es6.string.italics"]),
|
---|
| 78 | keys: globalOnly(ArrayNatureIterators),
|
---|
| 79 | lastIndexOf: globalOnly(["es6.array.last-index-of"]),
|
---|
| 80 | link: globalOnly(["es6.string.link"]),
|
---|
| 81 | map: globalOnly(["es6.array.map"]),
|
---|
| 82 | match: globalOnly(["es6.regexp.match"]),
|
---|
| 83 | name: globalOnly(["es6.function.name"]),
|
---|
| 84 | padStart: globalOnly(["es7.string.pad-start"]),
|
---|
| 85 | padEnd: globalOnly(["es7.string.pad-end"]),
|
---|
| 86 | reduce: globalOnly(["es6.array.reduce"]),
|
---|
| 87 | reduceRight: globalOnly(["es6.array.reduce-right"]),
|
---|
| 88 | repeat: globalOnly(["es6.string.repeat"]),
|
---|
| 89 | replace: globalOnly(["es6.regexp.replace"]),
|
---|
| 90 | search: globalOnly(["es6.regexp.search"]),
|
---|
| 91 | small: globalOnly(["es6.string.small"]),
|
---|
| 92 | some: globalOnly(["es6.array.some"]),
|
---|
| 93 | sort: globalOnly(["es6.array.sort"]),
|
---|
| 94 | split: globalOnly(["es6.regexp.split"]),
|
---|
| 95 | startsWith: globalOnly(["es6.string.starts-with"]),
|
---|
| 96 | strike: globalOnly(["es6.string.strike"]),
|
---|
| 97 | sub: globalOnly(["es6.string.sub"]),
|
---|
| 98 | sup: globalOnly(["es6.string.sup"]),
|
---|
| 99 | toISOString: globalOnly(["es6.date.to-iso-string"]),
|
---|
| 100 | toJSON: globalOnly(["es6.date.to-json"]),
|
---|
| 101 | toString: globalOnly(["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"]),
|
---|
| 102 | trim: globalOnly(["es6.string.trim"]),
|
---|
| 103 | trimEnd: globalOnly(["es7.string.trim-right"]),
|
---|
| 104 | trimLeft: globalOnly(["es7.string.trim-left"]),
|
---|
| 105 | trimRight: globalOnly(["es7.string.trim-right"]),
|
---|
| 106 | trimStart: globalOnly(["es7.string.trim-left"]),
|
---|
| 107 | values: globalOnly(ArrayNatureIterators)
|
---|
| 108 | };
|
---|
| 109 |
|
---|
| 110 | // This isn't present in older @babel/compat-data versions
|
---|
| 111 | exports.InstanceProperties = InstanceProperties;
|
---|
| 112 | if ("es6.array.slice" in _corejs2BuiltIns.default) {
|
---|
| 113 | InstanceProperties.slice = globalOnly(["es6.array.slice"]);
|
---|
| 114 | }
|
---|
| 115 | const StaticProperties = {
|
---|
| 116 | Array: {
|
---|
| 117 | from: pureAndGlobal("array/from", ["es6.symbol", "es6.array.from", ...CommonIterators]),
|
---|
| 118 | isArray: pureAndGlobal("array/is-array", ["es6.array.is-array"]),
|
---|
| 119 | of: pureAndGlobal("array/of", ["es6.array.of"])
|
---|
| 120 | },
|
---|
| 121 | Date: {
|
---|
| 122 | now: pureAndGlobal("date/now", ["es6.date.now"])
|
---|
| 123 | },
|
---|
| 124 | JSON: {
|
---|
| 125 | stringify: pureOnly("json/stringify", "es6.symbol")
|
---|
| 126 | },
|
---|
| 127 | Math: {
|
---|
| 128 | // 'Math' was not included in the 7.0.0
|
---|
| 129 | // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616.
|
---|
| 130 | acosh: pureAndGlobal("math/acosh", ["es6.math.acosh"], "7.0.1"),
|
---|
| 131 | asinh: pureAndGlobal("math/asinh", ["es6.math.asinh"], "7.0.1"),
|
---|
| 132 | atanh: pureAndGlobal("math/atanh", ["es6.math.atanh"], "7.0.1"),
|
---|
| 133 | cbrt: pureAndGlobal("math/cbrt", ["es6.math.cbrt"], "7.0.1"),
|
---|
| 134 | clz32: pureAndGlobal("math/clz32", ["es6.math.clz32"], "7.0.1"),
|
---|
| 135 | cosh: pureAndGlobal("math/cosh", ["es6.math.cosh"], "7.0.1"),
|
---|
| 136 | expm1: pureAndGlobal("math/expm1", ["es6.math.expm1"], "7.0.1"),
|
---|
| 137 | fround: pureAndGlobal("math/fround", ["es6.math.fround"], "7.0.1"),
|
---|
| 138 | hypot: pureAndGlobal("math/hypot", ["es6.math.hypot"], "7.0.1"),
|
---|
| 139 | imul: pureAndGlobal("math/imul", ["es6.math.imul"], "7.0.1"),
|
---|
| 140 | log1p: pureAndGlobal("math/log1p", ["es6.math.log1p"], "7.0.1"),
|
---|
| 141 | log10: pureAndGlobal("math/log10", ["es6.math.log10"], "7.0.1"),
|
---|
| 142 | log2: pureAndGlobal("math/log2", ["es6.math.log2"], "7.0.1"),
|
---|
| 143 | sign: pureAndGlobal("math/sign", ["es6.math.sign"], "7.0.1"),
|
---|
| 144 | sinh: pureAndGlobal("math/sinh", ["es6.math.sinh"], "7.0.1"),
|
---|
| 145 | tanh: pureAndGlobal("math/tanh", ["es6.math.tanh"], "7.0.1"),
|
---|
| 146 | trunc: pureAndGlobal("math/trunc", ["es6.math.trunc"], "7.0.1")
|
---|
| 147 | },
|
---|
| 148 | Number: {
|
---|
| 149 | EPSILON: pureAndGlobal("number/epsilon", ["es6.number.epsilon"]),
|
---|
| 150 | MIN_SAFE_INTEGER: pureAndGlobal("number/min-safe-integer", ["es6.number.min-safe-integer"]),
|
---|
| 151 | MAX_SAFE_INTEGER: pureAndGlobal("number/max-safe-integer", ["es6.number.max-safe-integer"]),
|
---|
| 152 | isFinite: pureAndGlobal("number/is-finite", ["es6.number.is-finite"]),
|
---|
| 153 | isInteger: pureAndGlobal("number/is-integer", ["es6.number.is-integer"]),
|
---|
| 154 | isSafeInteger: pureAndGlobal("number/is-safe-integer", ["es6.number.is-safe-integer"]),
|
---|
| 155 | isNaN: pureAndGlobal("number/is-nan", ["es6.number.is-nan"]),
|
---|
| 156 | parseFloat: pureAndGlobal("number/parse-float", ["es6.number.parse-float"]),
|
---|
| 157 | parseInt: pureAndGlobal("number/parse-int", ["es6.number.parse-int"])
|
---|
| 158 | },
|
---|
| 159 | Object: {
|
---|
| 160 | assign: pureAndGlobal("object/assign", ["es6.object.assign"]),
|
---|
| 161 | create: pureAndGlobal("object/create", ["es6.object.create"]),
|
---|
| 162 | defineProperties: pureAndGlobal("object/define-properties", ["es6.object.define-properties"]),
|
---|
| 163 | defineProperty: pureAndGlobal("object/define-property", ["es6.object.define-property"]),
|
---|
| 164 | entries: pureAndGlobal("object/entries", ["es7.object.entries"]),
|
---|
| 165 | freeze: pureAndGlobal("object/freeze", ["es6.object.freeze"]),
|
---|
| 166 | getOwnPropertyDescriptor: pureAndGlobal("object/get-own-property-descriptor", ["es6.object.get-own-property-descriptor"]),
|
---|
| 167 | getOwnPropertyDescriptors: pureAndGlobal("object/get-own-property-descriptors", ["es7.object.get-own-property-descriptors"]),
|
---|
| 168 | getOwnPropertyNames: pureAndGlobal("object/get-own-property-names", ["es6.object.get-own-property-names"]),
|
---|
| 169 | getOwnPropertySymbols: pureAndGlobal("object/get-own-property-symbols", ["es6.symbol"]),
|
---|
| 170 | getPrototypeOf: pureAndGlobal("object/get-prototype-of", ["es6.object.get-prototype-of"]),
|
---|
| 171 | is: pureAndGlobal("object/is", ["es6.object.is"]),
|
---|
| 172 | isExtensible: pureAndGlobal("object/is-extensible", ["es6.object.is-extensible"]),
|
---|
| 173 | isFrozen: pureAndGlobal("object/is-frozen", ["es6.object.is-frozen"]),
|
---|
| 174 | isSealed: pureAndGlobal("object/is-sealed", ["es6.object.is-sealed"]),
|
---|
| 175 | keys: pureAndGlobal("object/keys", ["es6.object.keys"]),
|
---|
| 176 | preventExtensions: pureAndGlobal("object/prevent-extensions", ["es6.object.prevent-extensions"]),
|
---|
| 177 | seal: pureAndGlobal("object/seal", ["es6.object.seal"]),
|
---|
| 178 | setPrototypeOf: pureAndGlobal("object/set-prototype-of", ["es6.object.set-prototype-of"]),
|
---|
| 179 | values: pureAndGlobal("object/values", ["es7.object.values"])
|
---|
| 180 | },
|
---|
| 181 | Promise: {
|
---|
| 182 | all: globalOnly(CommonIterators),
|
---|
| 183 | race: globalOnly(CommonIterators)
|
---|
| 184 | },
|
---|
| 185 | Reflect: {
|
---|
| 186 | apply: pureAndGlobal("reflect/apply", ["es6.reflect.apply"]),
|
---|
| 187 | construct: pureAndGlobal("reflect/construct", ["es6.reflect.construct"]),
|
---|
| 188 | defineProperty: pureAndGlobal("reflect/define-property", ["es6.reflect.define-property"]),
|
---|
| 189 | deleteProperty: pureAndGlobal("reflect/delete-property", ["es6.reflect.delete-property"]),
|
---|
| 190 | get: pureAndGlobal("reflect/get", ["es6.reflect.get"]),
|
---|
| 191 | getOwnPropertyDescriptor: pureAndGlobal("reflect/get-own-property-descriptor", ["es6.reflect.get-own-property-descriptor"]),
|
---|
| 192 | getPrototypeOf: pureAndGlobal("reflect/get-prototype-of", ["es6.reflect.get-prototype-of"]),
|
---|
| 193 | has: pureAndGlobal("reflect/has", ["es6.reflect.has"]),
|
---|
| 194 | isExtensible: pureAndGlobal("reflect/is-extensible", ["es6.reflect.is-extensible"]),
|
---|
| 195 | ownKeys: pureAndGlobal("reflect/own-keys", ["es6.reflect.own-keys"]),
|
---|
| 196 | preventExtensions: pureAndGlobal("reflect/prevent-extensions", ["es6.reflect.prevent-extensions"]),
|
---|
| 197 | set: pureAndGlobal("reflect/set", ["es6.reflect.set"]),
|
---|
| 198 | setPrototypeOf: pureAndGlobal("reflect/set-prototype-of", ["es6.reflect.set-prototype-of"])
|
---|
| 199 | },
|
---|
| 200 | String: {
|
---|
| 201 | at: pureOnly("string/at", "es7.string.at"),
|
---|
| 202 | fromCodePoint: pureAndGlobal("string/from-code-point", ["es6.string.from-code-point"]),
|
---|
| 203 | raw: pureAndGlobal("string/raw", ["es6.string.raw"])
|
---|
| 204 | },
|
---|
| 205 | Symbol: {
|
---|
| 206 | // FIXME: Pure disabled to work around zloirock/core-js#262.
|
---|
| 207 | asyncIterator: globalOnly(["es6.symbol", "es7.symbol.async-iterator"]),
|
---|
| 208 | for: pureOnly("symbol/for", "es6.symbol"),
|
---|
| 209 | hasInstance: pureOnly("symbol/has-instance", "es6.symbol"),
|
---|
| 210 | isConcatSpreadable: pureOnly("symbol/is-concat-spreadable", "es6.symbol"),
|
---|
| 211 | iterator: define("es6.symbol", "symbol/iterator", CommonIterators),
|
---|
| 212 | keyFor: pureOnly("symbol/key-for", "es6.symbol"),
|
---|
| 213 | match: pureAndGlobal("symbol/match", ["es6.regexp.match"]),
|
---|
| 214 | replace: pureOnly("symbol/replace", "es6.symbol"),
|
---|
| 215 | search: pureOnly("symbol/search", "es6.symbol"),
|
---|
| 216 | species: pureOnly("symbol/species", "es6.symbol"),
|
---|
| 217 | split: pureOnly("symbol/split", "es6.symbol"),
|
---|
| 218 | toPrimitive: pureOnly("symbol/to-primitive", "es6.symbol"),
|
---|
| 219 | toStringTag: pureOnly("symbol/to-string-tag", "es6.symbol"),
|
---|
| 220 | unscopables: pureOnly("symbol/unscopables", "es6.symbol")
|
---|
| 221 | }
|
---|
| 222 | };
|
---|
| 223 | exports.StaticProperties = StaticProperties; |
---|