elseif ($node instanceof Node\Property
) { $loc =
$node->location;
$retNode =
$this->
createNode( "AssignmentProperty",
$loc->start
);
// If it's a shorthand property convert the value to an assignment
// pattern if necessary
$value =
$node->
getValue();
$key =
$node->
getKey();
if ($value &&
$node->
getShorthand() &&
!
$value instanceof Node\AssignmentExpression
&& (!
$value instanceof Node\Identifier
|| ( $key instanceof Node\Identifier &&
$key->
getName() !==
$value->
getName() ))) { $loc =
$node->location;
$valNode =
$this->
createNode("AssignmentPattern",
$loc->start
);
$valNode->
setLeft($key);
$valNode->
setRight($value);
$this->
completeNode($valNode,
$loc->end
);
$value =
$valNode;
} else {