Add supports for polyfill computed methods (#10398)

This commit is contained in:
Bin Xin
2019-09-06 07:35:03 +08:00
committed by Nicolò Ribaudo
parent 5c859b1117
commit 8769903284
12 changed files with 107 additions and 19 deletions

View File

@@ -0,0 +1,9 @@
var _map = "map";
object["filter"]; // polyfill
object[_map]; // polyfill
object[find]; // don't polyfill
object["filter"](); // polyfill
object[_map](); // polyfill
object[find](); // don't polyfill

View File

@@ -0,0 +1,5 @@
{
"plugins": [
["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]
]
}

View File

@@ -0,0 +1,21 @@
var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map");
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter");
var _map = "map";
_filterInstanceProperty(object); // polyfill
_mapInstanceProperty(object); // polyfill
object[find]; // don't polyfill
_filterInstanceProperty(object).call(object); // polyfill
_mapInstanceProperty(object).call(object); // polyfill
object[find](); // don't polyfill

View File

@@ -0,0 +1,5 @@
var _isArray = "isArray";
Array["from"]; // polyfill
Array[_isArray]; // polyfill
Array[of]; // don't polyfill

View File

@@ -0,0 +1,5 @@
{
"plugins": [
["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]
]
}

View File

@@ -0,0 +1,10 @@
var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array");
var _Array$from = require("@babel/runtime-corejs3/core-js/array/from");
var _isArray = "isArray";
_Array$from; // polyfill
_Array$isArray; // polyfill
Array[of]; // don't polyfill

View File

@@ -1 +1 @@
bar[filter]()
bar['filter']()