Improved the test case - test tokens against expected values.
This commit is contained in:
parent
84adda7c20
commit
4394fe7dcf
|
|
@ -14,8 +14,10 @@ describe("Accessor tokens", function() {
|
||||||
|
|
||||||
// test there are no nodes without tokens
|
// test there are no nodes without tokens
|
||||||
var checkWalker = new UglifyJS.TreeWalker(function(node, descend) {
|
var checkWalker = new UglifyJS.TreeWalker(function(node, descend) {
|
||||||
assert(node.start !== undefined);
|
if (node instanceof UglifyJS.AST_Accessor) {
|
||||||
assert(node.end !== undefined);
|
assert.equal(node.start.pos, 12);
|
||||||
|
assert.equal(node.end.endpos, 46);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
ast.walk(checkWalker);
|
ast.walk(checkWalker);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user