Add t.cloneNode and deprecate t.clone and t.cloneDeep (#7149)

This commit is contained in:
Nicolò Ribaudo
2018-01-11 19:31:48 +01:00
parent dde9274986
commit 63ae923987
24 changed files with 170 additions and 123 deletions

View File

@@ -73,13 +73,13 @@ export default function(api, options) {
replacementPath.replaceWith(
t.conditionalExpression(
loose
? t.binaryExpression("==", t.clone(check), t.nullLiteral())
? t.binaryExpression("==", t.cloneNode(check), t.nullLiteral())
: t.logicalExpression(
"||",
t.binaryExpression("===", t.clone(check), t.nullLiteral()),
t.binaryExpression("===", t.cloneNode(check), t.nullLiteral()),
t.binaryExpression(
"===",
t.clone(ref),
t.cloneNode(ref),
scope.buildUndefinedNode(),
),
),