fix: skip transform delete something.includes (#11530)
This commit is contained in:
parent
8aa5e574a0
commit
b8a6145e50
@ -358,6 +358,8 @@ export default declare((api, options, dirname) => {
|
||||
enter(path) {
|
||||
if (!injectCoreJS) return;
|
||||
if (!path.isReferenced()) return;
|
||||
// skip transforming `delete something.includes`
|
||||
if (path.parentPath.isUnaryExpression({ operator: "delete" })) return;
|
||||
|
||||
const { node } = path;
|
||||
const { object } = node;
|
||||
|
||||
@ -86,3 +86,4 @@ object.values(arg);
|
||||
Function.bind
|
||||
|
||||
object.something(arg);
|
||||
delete object.bind;
|
||||
|
||||
@ -240,3 +240,4 @@ _valuesInstanceProperty(object).call(object, arg);
|
||||
_bindInstanceProperty(Function);
|
||||
|
||||
object.something(arg);
|
||||
delete object.bind;
|
||||
|
||||
@ -121,3 +121,4 @@ JSON.parse
|
||||
Math.pow
|
||||
|
||||
Symbol.something
|
||||
delete Array.from
|
||||
|
||||
@ -275,3 +275,4 @@ Date.something;
|
||||
JSON.parse;
|
||||
Math.pow;
|
||||
_Symbol.something;
|
||||
delete Array.from;
|
||||
|
||||
@ -5,3 +5,5 @@ keys(bar).includes;
|
||||
foo.includes.apply(bar, [1, 2]);
|
||||
|
||||
foo.includes = 42;
|
||||
|
||||
delete foo.includes;
|
||||
|
||||
@ -7,3 +7,4 @@ _includesInstanceProperty(keys(bar));
|
||||
_includesInstanceProperty(foo).apply(bar, [1, 2]);
|
||||
|
||||
foo.includes = 42;
|
||||
delete foo.includes;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user