From 8ba3abd2842b60527de804c30ee9f9d0e099f68e Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Thu, 4 Apr 2024 01:26:59 +0700 Subject: [PATCH] fix some definitions --- .../src/built-in-definitions.ts | 24 ++++++++++++------- .../output.mjs | 11 ++++----- .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../output.mjs | 15 ++++++------ .../all-proposals-corejs-3.20/output.mjs | 19 +++++++-------- 13 files changed, 99 insertions(+), 105 deletions(-) diff --git a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts index 00535560..7287ae73 100644 --- a/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts +++ b/packages/babel-plugin-polyfill-corejs3/src/built-in-definitions.ts @@ -452,10 +452,10 @@ export const StaticProperties: ObjectMap2 = { }, 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: { @@ -608,8 +608,8 @@ export const StaticProperties: ObjectMap2 = { }, 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: { @@ -707,13 +707,19 @@ export const StaticProperties: ObjectMap2 = { }, 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"), @@ -746,7 +752,7 @@ export const StaticProperties: ObjectMap2 = { }; export const InstanceProperties = { - asIndexedPairs: define("instance/asIndexedPairs", [ + asIndexedPairs: define(null, [ "esnext.async-iterator.as-indexed-pairs", ...AsyncIteratorDependencies, "esnext.iterator.as-indexed-pairs", diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs index 82cc7041..3a2fce1e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.16/output.mjs @@ -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"; @@ -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 }); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs index 69d91709..81e20a04 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.20/output.mjs @@ -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"; @@ -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 }); @@ -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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs index 79f7c021..21b1b323 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.24/output.mjs @@ -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"; @@ -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 }); @@ -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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs index 01fb16d5..a1413b2f 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.27/output.mjs @@ -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"; @@ -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 }); @@ -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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs index d93aa1b2..37fd821b 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.28/output.mjs @@ -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"; @@ -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 }); @@ -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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs index 2b245dfa..ca9da6be 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.30/output.mjs @@ -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"; @@ -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 }); @@ -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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs index b90a08cd..aa805e0e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.31/output.mjs @@ -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"; @@ -40,19 +39,19 @@ import _Map$groupBy from "core-js-pure/features/map/group-by.js"; import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers.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 }); @@ -64,8 +63,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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs index f6f92858..c12ba42e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.32/output.mjs @@ -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"; @@ -41,19 +40,19 @@ import _Promise$withResolvers from "core-js-pure/features/promise/with-resolvers import _Math$f16round from "core-js-pure/features/math/f16round.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 }); @@ -65,8 +64,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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs index 63f2158c..fb4baf88 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.33/output.mjs @@ -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"; @@ -42,19 +41,19 @@ import _Math$f16round from "core-js-pure/features/math/f16round.js"; import _RegExp$escape from "core-js-pure/features/regexp/escape.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 }); @@ -66,8 +65,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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs index 63f2158c..fb4baf88 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.34/output.mjs @@ -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"; @@ -42,19 +41,19 @@ import _Math$f16round from "core-js-pure/features/math/f16round.js"; import _RegExp$escape from "core-js-pure/features/regexp/escape.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 }); @@ -66,8 +65,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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs index 63f2158c..fb4baf88 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-chrome-90-corejs-3.36/output.mjs @@ -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"; @@ -42,19 +41,19 @@ import _Math$f16round from "core-js-pure/features/math/f16round.js"; import _RegExp$escape from "core-js-pure/features/regexp/escape.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 }); @@ -66,8 +65,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); diff --git a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs index 2708d86a..a171c16e 100644 --- a/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs +++ b/packages/babel-plugin-polyfill-corejs3/test/fixtures/usage-pure/all-proposals-corejs-3.20/output.mjs @@ -1,7 +1,6 @@ -var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12; +var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11; 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 _forEachInstanceProperty from "core-js-pure/features/instance/for-each.js"; import _Iterator$from from "core-js-pure/features/iterator/from.js"; import _mapInstanceProperty from "core-js-pure/features/instance/map.js"; @@ -29,19 +28,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); -_forEachInstanceProperty(_context4 = _Iterator$from({ +[].asIndexedPairs(); +_forEachInstanceProperty(_context3 = _Iterator$from({ next: () => ({ done: Math.random() > .9, value: Math.random() * 10 | 0 }) -})).call(_context4, console.log).toArray(); -_mapInstanceProperty(_context5 = _groupByInstanceProperty(_context6 = _filterInstanceProperty(_context7 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5)).call(_context7, it => it % 2)).call(_context6, it => id % 4)).call(_context5, it => it ** 2).toArray().then(console.log); -_groupByInstanceProperty(_context8 = _uniqueByInstanceProperty(_context9 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context9, x => x)).call(_context8, x => x % 2); +})).call(_context3, console.log).toArray(); +_mapInstanceProperty(_context4 = _groupByInstanceProperty(_context5 = _filterInstanceProperty(_context6 = _AsyncIterator$from([1, 2, 3, 4, 5, 6, 7]).drop(1).take(5)).call(_context6, it => it % 2)).call(_context5, it => id % 4)).call(_context4, it => it ** 2).toArray().then(console.log); +_groupByInstanceProperty(_context7 = _uniqueByInstanceProperty(_context8 = [1, 2, 3, 4, 5, 6, 7, 7]).call(_context8, x => x)).call(_context7, x => x % 2); _Number$range(1, 2); _BigInt$range(1n, 2n); _Array$isTemplateObject((x => x)`a${x}z`); -_emplaceInstanceProperty(_context10 = new _Map([['x', 1]])).call(_context10, 'x', { +_emplaceInstanceProperty(_context9 = new _Map([['x', 1]])).call(_context9, 'x', { update: x => x + 1, insert: () => 0 }); @@ -53,8 +52,8 @@ _Symbol$matchAll; _Symbol$metadata; _replaceAllInstanceProperty(_Symbol); new _URL(url); -const foo = _groupByToMapInstanceProperty(_context11 = [1, 2, 3]).call(_context11, bar); -const push = _unThisInstanceProperty(_context12 = [].push).call(_context12); +const foo = _groupByToMapInstanceProperty(_context10 = [1, 2, 3]).call(_context10, bar); +const push = _unThisInstanceProperty(_context11 = [].push).call(_context11); _Function$isConstructor; throw new _DOMException(); _structuredClone(72);