diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-09-03 12:05:10 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-09-03 12:05:10 +0300 |
commit | d7c1dc6c0578b55eefc3bc94556146dce6e1a8cb (patch) | |
tree | f5293d83b48fcd91e8924b4a3334f79ab4ba6163 /test | |
parent | d6efa8b28dc0a937bc154bf5f2e5d5450be5c1d5 (diff) | |
download | tracifyjs-d7c1dc6c0578b55eefc3bc94556146dce6e1a8cb.tar.gz tracifyjs-d7c1dc6c0578b55eefc3bc94556146dce6e1a8cb.zip |
a LabeledStatement should be in fact a StatementWithBody
This fixes output for:
if (foo) {
moo: if (bar) {
break moo;
}
} else {
baz();
}
(the labeled statement must be outputted inside brackets)
Diffstat (limited to 'test')
-rwxr-xr-x | test/run-tests.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/run-tests.js b/test/run-tests.js index 52018329..1f554e11 100755 --- a/test/run-tests.js +++ b/test/run-tests.js @@ -81,7 +81,7 @@ function parse_test(file) { if (node instanceof U.AST_LabeledStatement && tw.parent() instanceof U.AST_Toplevel) { var name = node.label.name; - tests[name] = get_one_test(name, node.statement); + tests[name] = get_one_test(name, node.body); return true; } if (!(node instanceof U.AST_Toplevel)) croak(node); @@ -118,7 +118,7 @@ function parse_test(file) { col: node.label.start.col }) ); - var stat = node.statement; + var stat = node.body; if (stat instanceof U.AST_BlockStatement) stat.required = 1; test[node.label.name] = stat; |