improve code reuse (#2542)

This commit is contained in:
Alex Lam S.L
2017-12-01 03:40:46 +08:00
committed by GitHub
parent c58d3936a3
commit 172079a47f
4 changed files with 37 additions and 30 deletions

View File

@@ -84,7 +84,7 @@ function reserve_quoted_keys(ast, reserved) {
function addStrings(node, add) {
node.walk(new TreeWalker(function(node) {
if (node instanceof AST_Sequence) {
addStrings(node.expressions[node.expressions.length - 1], add);
addStrings(node.tail_node(), add);
} else if (node instanceof AST_String) {
add(node.value);
} else if (node instanceof AST_Conditional) {