source: frontend/node_modules/babel-plugin-polyfill-corejs2/lib/built-in-definitions.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

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