aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/tokens.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-08 15:38:32 +0000
committerGitHub <noreply@github.com>2020-11-08 23:38:32 +0800
commit91fc1c82b56986df51ad1450c18718bc585deca9 (patch)
treea534652eea79949356bee8a877b71a49a5b18e82 /test/mocha/tokens.js
parent810cd40356f6fa1ddbc9c97a0df95bd1d94a2720 (diff)
downloadtracifyjs-91fc1c82b56986df51ad1450c18718bc585deca9.tar.gz
tracifyjs-91fc1c82b56986df51ad1450c18718bc585deca9.zip
support computed property name in object literal (#4268)
Diffstat (limited to 'test/mocha/tokens.js')
-rw-r--r--test/mocha/tokens.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/mocha/tokens.js b/test/mocha/tokens.js
index 6241f25d..4a495b5b 100644
--- a/test/mocha/tokens.js
+++ b/test/mocha/tokens.js
@@ -5,7 +5,7 @@ describe("tokens", function() {
it("Should give correct positions for accessors", function() {
// location 0 1 2 3 4
// 01234567890123456789012345678901234567890123456789
- var ast = UglifyJS.parse("var obj = { get latest() { return undefined; } }");
+ var ast = UglifyJS.parse("var obj = { get [prop]() { return undefined; } }");
// test all AST_ObjectProperty tokens are set as expected
var found = false;
ast.walk(new UglifyJS.TreeWalker(function(node) {
@@ -13,9 +13,9 @@ describe("tokens", function() {
found = true;
assert.equal(node.start.pos, 12);
assert.equal(node.end.endpos, 46);
- assert(node.key instanceof UglifyJS.AST_SymbolAccessor);
- assert.equal(node.key.start.pos, 16);
- assert.equal(node.key.end.endpos, 22);
+ assert(node.key instanceof UglifyJS.AST_SymbolRef);
+ assert.equal(node.key.start.pos, 17);
+ assert.equal(node.key.end.endpos, 21);
assert(node.value instanceof UglifyJS.AST_Accessor);
assert.equal(node.value.start.pos, 22);
assert.equal(node.value.end.endpos, 46);