Skip to content

Commit

Permalink
[es-shims] Add Reflect.apply polyfill (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 24, 2021
1 parent a7e5c26 commit 4fe2e83
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/babel-plugin-polyfill-es-shims/README.md
Expand Up @@ -70,6 +70,7 @@ This plugin supports the following `es-shims` polyfills.
| `Object.assign` | [`object.assign`](https://github.com/ljharb/object.assign) | [@ljharb](https://github.com/ljharb) |
| `Object.getPrototypeOf` | [`object.getprototypeof`](https://github.com/es-shims/Object.getPrototypeOf) |
| `Object.is` | [`object-is`](https://github.com/es-shims/object-is) |
| `Reflect.apply` | [`reflect.apply`](https://github.com/es-shims/Reflect.apply) |
| `Reflect.getPrototypeOf` | [`reflect.getprototypeof`](https://github.com/es-shims/Reflect.getPrototypeOf) |
| `Reflect.ownKeys` | [`reflect.ownkeys`](https://github.com/es-shims/Reflect.ownKeys) |
| `RegExp.prototype.flags` | [`regexp.prototype.flags`](https://github.com/es-shims/RegExp.prototype.flags) |
Expand Down
11 changes: 11 additions & 0 deletions packages/babel-plugin-polyfill-es-shims/data/polyfills.json
Expand Up @@ -454,6 +454,17 @@
"samsung": "8",
"electron": "3"
},
"Reflect.apply": {
"chrome": "49",
"opera": "36",
"edge": "12",
"firefox": "42",
"safari": "10",
"node": "6",
"ios": "10",
"samsung": "5",
"electron": "0.37"
},
"Reflect.getPrototypeOf": {
"chrome": "49",
"opera": "36",
Expand Down
Expand Up @@ -29,7 +29,6 @@
- `Math.sinh()`
- `Math.tanh()`
- `Math.trunc()`
- `Reflect.apply()`
- `Reflect.construct()`
- `Reflect.defineProperty()`
- `Reflect.deleteProperty()`
Expand Down
1 change: 1 addition & 0 deletions packages/babel-plugin-polyfill-es-shims/src/mappings.js
Expand Up @@ -90,6 +90,7 @@ defineStatic("Promise", "any", "2.0.1");
defineStatic("Promise", "try", "1.0.0");
defineInstance("Promise", "finally", "1.2.1", instanceofCheck("Promise"));

defineStatic("Reflect", "apply", "1.0.0");
defineStatic("Reflect", "ownKeys", "1.0.1");
defineStatic("Reflect", "getPrototypeOf", "1.0.0");

Expand Down
Expand Up @@ -15,6 +15,7 @@ import _ObjectGetOwnPropertyDescriptors from "object.getownpropertydescriptors";
import _ObjectGetPrototypeOf from "object.getprototypeof";
import _ObjectIs from "object-is";
import _ObjectValues from "object.values";
import _ReflectApply from "reflect.apply";
import _ReflectGetPrototypeOf from "reflect.getprototypeof";
import _ReflectOwnKeys from "reflect.ownkeys";
import _StringFromCodePoint from "string.fromcodepoint";
Expand Down Expand Up @@ -85,7 +86,7 @@ Object.preventExtensions;
Object.seal;
Object.setPrototypeOf;
_ObjectValues;
Reflect.apply;
_ReflectApply;
Reflect.construct;
Reflect.defineMetadata;
Reflect.defineProperty;
Expand Down
@@ -1,4 +1,4 @@
Some polyfills have been added but are not present in your dependencies.
Please run one of the following commands:
npm install --save array.from@^1.1.0 array.of@^1.0.0 is-nan@^1.2.1 math.acosh@^1.0.0 math.atanh@^1.0.0 math.cbrt@^1.0.0 math.clz32@^1.0.0 math.fround@^1.0.0 math.log1p@^1.0.1 math.sign@^2.0.0 object-is@^1.1.2 object.assign@^4.1.0 object.entries@^1.1.1 object.fromentries@^2.0.2 object.getownpropertydescriptors@^2.1.0 object.getprototypeof@^1.0.1 object.values@^1.1.1 reflect.getprototypeof@^1.0.0 reflect.ownkeys@^1.0.1 string.fromcodepoint@^1.0.0 string.raw@^1.0.1
yarn add array.from@^1.1.0 array.of@^1.0.0 is-nan@^1.2.1 math.acosh@^1.0.0 math.atanh@^1.0.0 math.cbrt@^1.0.0 math.clz32@^1.0.0 math.fround@^1.0.0 math.log1p@^1.0.1 math.sign@^2.0.0 object-is@^1.1.2 object.assign@^4.1.0 object.entries@^1.1.1 object.fromentries@^2.0.2 object.getownpropertydescriptors@^2.1.0 object.getprototypeof@^1.0.1 object.values@^1.1.1 reflect.getprototypeof@^1.0.0 reflect.ownkeys@^1.0.1 string.fromcodepoint@^1.0.0 string.raw@^1.0.1
npm install --save array.from@^1.1.0 array.of@^1.0.0 is-nan@^1.2.1 math.acosh@^1.0.0 math.atanh@^1.0.0 math.cbrt@^1.0.0 math.clz32@^1.0.0 math.fround@^1.0.0 math.log1p@^1.0.1 math.sign@^2.0.0 object-is@^1.1.2 object.assign@^4.1.0 object.entries@^1.1.1 object.fromentries@^2.0.2 object.getownpropertydescriptors@^2.1.0 object.getprototypeof@^1.0.1 object.values@^1.1.1 reflect.apply@^1.0.0 reflect.getprototypeof@^1.0.0 reflect.ownkeys@^1.0.1 string.fromcodepoint@^1.0.0 string.raw@^1.0.1
yarn add array.from@^1.1.0 array.of@^1.0.0 is-nan@^1.2.1 math.acosh@^1.0.0 math.atanh@^1.0.0 math.cbrt@^1.0.0 math.clz32@^1.0.0 math.fround@^1.0.0 math.log1p@^1.0.1 math.sign@^2.0.0 object-is@^1.1.2 object.assign@^4.1.0 object.entries@^1.1.1 object.fromentries@^2.0.2 object.getownpropertydescriptors@^2.1.0 object.getprototypeof@^1.0.1 object.values@^1.1.1 reflect.apply@^1.0.0 reflect.getprototypeof@^1.0.0 reflect.ownkeys@^1.0.1 string.fromcodepoint@^1.0.0 string.raw@^1.0.1
1 change: 1 addition & 0 deletions scripts/build-es-shims-data/es-shims-features.js
Expand Up @@ -53,6 +53,7 @@ module.exports = {
"Promise.any": "Promise.any",
"Promise.try": [],
"Promise.prototype.finally": "Promise.prototype.finally",
"Reflect.apply": "Reflect / Reflect.apply",
"Reflect.getPrototypeOf": "Reflect / Reflect.getPrototypeOf",
"Reflect.ownKeys": "Reflect / Reflect.ownKeys",
"RegExp.prototype.flags":
Expand Down

0 comments on commit 4fe2e83

Please sign in to comment.