fix incorrect code elimination
This commit is contained in:
4
parse.cm
4
parse.cm
@@ -364,6 +364,7 @@ var parse = function(tokens, src, filename, tokenizer) {
|
||||
advance()
|
||||
left = parse_assign_expr()
|
||||
pair.left = left
|
||||
pair.computed = true
|
||||
if (tok.kind == "]") advance()
|
||||
else parse_error(tok, "expected ']' after computed property")
|
||||
} else {
|
||||
@@ -1797,6 +1798,9 @@ var parse = function(tokens, src, filename, tokenizer) {
|
||||
prop = expr.list[i]
|
||||
val = prop.right
|
||||
sem_check_expr(scope, val)
|
||||
if (prop.computed) {
|
||||
sem_check_expr(scope, prop.left)
|
||||
}
|
||||
i = i + 1
|
||||
}
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user