Skip to content

Commit

Permalink
[corejs3] fix some definitions (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Apr 17, 2024
1 parent a5db9c3 commit 8107ebc
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 105 deletions.
24 changes: 15 additions & 9 deletions packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts
Expand Up @@ -452,10 +452,10 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
},

Map: {
from: define(null, ["esnext.map.from", ...MapDependencies]),
from: define("map/from", ["esnext.map.from", ...MapDependencies]),
groupBy: define("map/group-by", ["es.map.group-by", ...MapDependencies]),
keyBy: define("map/key-by", ["esnext.map.key-by", ...MapDependencies]),
of: define(null, ["esnext.map.of", ...MapDependencies]),
of: define("map/of", ["esnext.map.of", ...MapDependencies]),
},

Number: {
Expand Down Expand Up @@ -608,8 +608,8 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
},

Set: {
from: define(null, ["esnext.set.from", ...SetDependencies]),
of: define(null, ["esnext.set.of", ...SetDependencies]),
from: define("set/from", ["esnext.set.from", ...SetDependencies]),
of: define("set/of", ["esnext.set.of", ...SetDependencies]),
},

String: {
Expand Down Expand Up @@ -707,13 +707,19 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
},

WeakMap: {
from: define(null, ["esnext.weak-map.from", ...WeakMapDependencies]),
of: define(null, ["esnext.weak-map.of", ...WeakMapDependencies]),
from: define("weak-map/from", [
"esnext.weak-map.from",
...WeakMapDependencies,
]),
of: define("weak-map/of", ["esnext.weak-map.of", ...WeakMapDependencies]),
},

WeakSet: {
from: define(null, ["esnext.weak-set.from", ...WeakSetDependencies]),
of: define(null, ["esnext.weak-set.of", ...WeakSetDependencies]),
from: define("weak-set/from", [
"esnext.weak-set.from",
...WeakSetDependencies,
]),
of: define("weak-set/of", ["esnext.weak-set.of", ...WeakSetDependencies]),
},

Int8Array: TypedArrayStaticMethods("es.typed-array.int8-array"),
Expand Down Expand Up @@ -746,7 +752,7 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
};

export const InstanceProperties = {
asIndexedPairs: define("instance/asIndexedPairs", [
asIndexedPairs: define(null, [
"esnext.async-iterator.as-indexed-pairs",
...AsyncIteratorDependencies,
"esnext.iterator.as-indexed-pairs",
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7;
var _context, _context2, _context3, _context4, _context5, _context6;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand All @@ -15,19 +14,19 @@ import _Symbol$matcher from "core-js-pure/features/symbol/matcher.js";
import _Symbol$metadata from "core-js-pure/features/symbol/metadata.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand All @@ -20,19 +19,19 @@ import _structuredClone from "core-js-pure/features/structured-clone.js";
import _withInstanceProperty from "core-js-pure/features/instance/with.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand All @@ -44,8 +43,8 @@ Symbol.matchAll;
_Symbol$metadata;
Symbol.replaceAll;
new URL(url);
const foo = _groupByToMapInstanceProperty(_context8 = [1, 2, 3]).call(_context8, bar);
const push = _unThisInstanceProperty(_context9 = [].push).call(_context9);
const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar);
const push = _unThisInstanceProperty(_context8 = [].push).call(_context8);
_Function$isConstructor;
throw new DOMException();
_structuredClone(72);
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand All @@ -21,19 +20,19 @@ import _structuredClone from "core-js-pure/features/structured-clone.js";
import _withInstanceProperty from "core-js-pure/features/instance/with.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand All @@ -45,8 +44,8 @@ Symbol.matchAll;
_Symbol$metadata;
Symbol.replaceAll;
new URL(url);
const foo = _groupByToMapInstanceProperty(_context8 = [1, 2, 3]).call(_context8, bar);
const push = _unThisInstanceProperty(_context9 = _pushInstanceProperty([])).call(_context9);
const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar);
const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8);
_Function$isConstructor;
throw new DOMException();
_structuredClone(72);
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand All @@ -28,19 +27,19 @@ import _AsyncDisposableStack from "core-js-pure/features/async-disposable-stack/
import _Iterator from "core-js-pure/features/iterator/index.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand All @@ -52,8 +51,8 @@ Symbol.matchAll;
_Symbol$metadata;
Symbol.replaceAll;
new URL(url);
const foo = _groupByToMapInstanceProperty(_context8 = [1, 2, 3]).call(_context8, bar);
const push = _unThisInstanceProperty(_context9 = _pushInstanceProperty([])).call(_context9);
const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar);
const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8);
_Function$isConstructor;
throw new DOMException();
_structuredClone(72);
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand Down Expand Up @@ -34,19 +33,19 @@ import _Symbol$isRegistered from "core-js-pure/features/symbol/is-registered.js"
import _demethodizeInstanceProperty from "core-js-pure/features/instance/demethodize.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand All @@ -58,8 +57,8 @@ Symbol.matchAll;
_Symbol$metadata;
Symbol.replaceAll;
new URL(url);
const foo = _groupByToMapInstanceProperty(_context8 = [1, 2, 3]).call(_context8, bar);
const push = _unThisInstanceProperty(_context9 = _pushInstanceProperty([])).call(_context9);
const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar);
const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8);
_Function$isConstructor;
throw new DOMException();
_structuredClone(72);
Expand Down
@@ -1,7 +1,6 @@
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9;
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8;
import _findLastInstanceProperty from "core-js-pure/features/instance/find-last.js";
import _findLastIndexInstanceProperty from "core-js-pure/features/instance/find-last-index.js";
import _asIndexedPairsInstanceProperty from "core-js-pure/features/instance/asIndexedPairs.js";
import _Iterator$from from "core-js-pure/features/iterator/from.js";
import _groupByInstanceProperty from "core-js-pure/features/instance/group-by.js";
import _AsyncIterator$from from "core-js-pure/features/async-iterator/from.js";
Expand Down Expand Up @@ -36,19 +35,19 @@ import _URL$canParse from "core-js-pure/features/url/can-parse.js";
import _Map$groupBy from "core-js-pure/features/map/group-by.js";
_findLastInstanceProperty(_context = []).call(_context, fn);
_findLastIndexInstanceProperty(_context2 = []).call(_context2, fn);
_asIndexedPairsInstanceProperty(_context3 = []).call(_context3);
[].asIndexedPairs();
_Iterator$from({
next: () => ({
done: Math.random() > .9,
value: Math.random() * 10 | 0
})
}).forEach(console.log).toArray();
_groupByInstanceProperty(_context4 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context4, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context5 = _uniqueByInstanceProperty(_context6 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context6, x => x)).call(_context5, x => x % 2);
_groupByInstanceProperty(_context3 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5).filter(it => it % 2)).call(_context3, it => id % 4).map(it => it ** 2).toArray().then(console.log);
_groupByInstanceProperty(_context4 = _uniqueByInstanceProperty(_context5 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context5, x => x)).call(_context4, x => x % 2);
_Number$range(1, 2);
_BigInt$range(1n, 2n);
_Array$isTemplateObject((x => x)`a${x}z`);
_emplaceInstanceProperty(_context7 = new Map([['x', 1]])).call(_context7, 'x', {
_emplaceInstanceProperty(_context6 = new Map([['x', 1]])).call(_context6, 'x', {
update: x => x + 1,
insert: () => 0
});
Expand All @@ -60,8 +59,8 @@ Symbol.matchAll;
_Symbol$metadata;
Symbol.replaceAll;
new URL(url);
const foo = _groupByToMapInstanceProperty(_context8 = [1, 2, 3]).call(_context8, bar);
const push = _unThisInstanceProperty(_context9 = _pushInstanceProperty([])).call(_context9);
const foo = _groupByToMapInstanceProperty(_context7 = [1, 2, 3]).call(_context7, bar);
const push = _unThisInstanceProperty(_context8 = _pushInstanceProperty([])).call(_context8);
_Function$isConstructor;
throw new DOMException();
_structuredClone(72);
Expand Down

0 comments on commit 8107ebc

Please sign in to comment.