babel-plugin-prototype-prop-define
Advanced tools
Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "babel-plugin-prototype-prop-define", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Transform assignments to properties on built-in prototypes to Object.defineProperty calls", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
175
src/index.js
@@ -245,103 +245,100 @@ const primordialKeySet = new Set([ | ||
return { | ||
"type": "ExpressionStatement", | ||
"expression": { | ||
"type": "CallExpression", | ||
"callee": { | ||
"type": "FunctionExpression", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
"type": "CallExpression", | ||
"callee": { | ||
"type": "FunctionExpression", | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "Identifier", | ||
"name": "target" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "key" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "value" | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"body": [ | ||
{ | ||
"type": "Identifier", | ||
"name": "target" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "key" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "value" | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"expression": { | ||
"type": "ConditionalExpression", | ||
"test": { | ||
"type": "CallExpression", | ||
"callee": { | ||
"type": "MemberExpression", | ||
"object": createPrimordialKeyArray(), | ||
"property": { | ||
"type": "Identifier", | ||
"name": "includes" | ||
}, | ||
"computed": false | ||
"type": "ExpressionStatement", | ||
"expression": { | ||
"type": "ConditionalExpression", | ||
"test": { | ||
"type": "CallExpression", | ||
"callee": { | ||
"type": "MemberExpression", | ||
"object": createPrimordialKeyArray(), | ||
"property": { | ||
"type": "Identifier", | ||
"name": "includes" | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "Identifier", | ||
"name": "key" | ||
} | ||
] | ||
"computed": false | ||
}, | ||
"consequent": createDefinePropertyExpression( | ||
"arguments": [ | ||
{ | ||
"type": "Identifier", | ||
"name": "key" | ||
} | ||
] | ||
}, | ||
"consequent": createDefinePropertyExpression( | ||
{ | ||
"type": "Identifier", | ||
"name": "target" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "key" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "value" | ||
}, | ||
), | ||
"alternate": { | ||
"type": "AssignmentExpression", | ||
"operator": "=", | ||
"left": { | ||
"type": "MemberExpression", | ||
"object": { | ||
"type": "Identifier", | ||
"name": "target" | ||
}, | ||
{ | ||
"property": { | ||
"type": "Identifier", | ||
"name": "key" | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"name": "value" | ||
}, | ||
), | ||
"alternate": { | ||
"type": "AssignmentExpression", | ||
"operator": "=", | ||
"left": { | ||
"type": "MemberExpression", | ||
"object": { | ||
"type": "Identifier", | ||
"name": "target" | ||
}, | ||
"property": { | ||
"type": "Identifier", | ||
"name": "key" | ||
}, | ||
"computed": true | ||
}, | ||
"right": { | ||
"type": "Identifier", | ||
"name": "value" | ||
}, | ||
"prototypePropDefineSkip": true | ||
} | ||
"computed": true | ||
}, | ||
"right": { | ||
"type": "Identifier", | ||
"name": "value" | ||
}, | ||
"prototypePropDefineSkip": true | ||
} | ||
}, | ||
{ | ||
"type": "ReturnStatement", | ||
"argument": { | ||
"type": "Identifier", | ||
"name": "value" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
}, | ||
"arguments": [ | ||
parentStatement, | ||
propertyKeyStatement, | ||
valueStatement, | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "ReturnStatement", | ||
"argument": { | ||
"type": "Identifier", | ||
"name": "value" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
}, | ||
"arguments": [ | ||
parentStatement, | ||
propertyKeyStatement, | ||
valueStatement, | ||
] | ||
} | ||
@@ -348,0 +345,0 @@ |
32395
388