fix test and lint

pull/5728/head
tanhauhau 4 years ago
parent 08faaeb601
commit 06410b83cd

@ -1,28 +1,13 @@
import {
Node,
Identifier,
ArrayExpression,
ObjectExpression,
ThisExpression,
ObjectPattern,
ArrayPattern,
Literal,
} from "estree";
type ObjectType =
| Identifier
| ThisExpression
| ArrayExpression
| ObjectExpression
| ArrayPattern
| ObjectPattern
| Literal;
export default function get_object(node: Node): ObjectType {
export default function get_object(node: Node): Identifier {
while (true) {
if (node.type === "MemberExpression") node = node.object;
else if (node.type === "CallExpression") node = node.callee;
else break;
}
return node as ObjectType;
return node as Identifier;
}

@ -20,5 +20,9 @@ export default {
assert.equal(input.value, '42');
assert.equal(component.map.get(component.id).x, '42')
component.map.set(3, { x: 7, y: 8 });
component.id = 3;
assert.equal(input.value, '7');
}
};

Loading…
Cancel
Save