Skip to content

Commit

Permalink
support 'throw' and 'UNARY_MINUS' in jscexc
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyZhao committed Jun 4, 2012
1 parent 012856b commit 4d7d2f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
tools/compiler.jar tools/compiler.jar
*.swp *.swp
doc/out doc/out
*~
_*
6 changes: 5 additions & 1 deletion src/jscexc.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var extract = function (ast) {
case "ARRAY_INIT": case "ARRAY_INIT":
case "PROPERTY_INIT": case "PROPERTY_INIT":
case "NEW_WITH_ARGS": case "NEW_WITH_ARGS":
case "UNARY_MINUS":
case ".": case ".":
case ">": case ">":
case "<": case "<":
Expand Down Expand Up @@ -135,6 +136,9 @@ var extract = function (ast) {
case "return": case "return":
visit(node.value); visit(node.value);
break; break;
case "throw":
visit(node.exception);
break;
default: default:
throw new Error('"' + token + '" is not currently supported.'); throw new Error('"' + token + '" is not currently supported.');
} }
Expand Down Expand Up @@ -196,4 +200,4 @@ if (module.parent) { // command
var code = fs.readFileSync(inputFile, "utf-8"); var code = fs.readFileSync(inputFile, "utf-8");
var newCode = compile(code); var newCode = compile(code);
fs.writeFileSync(outputFile, newCode, "utf-8"); fs.writeFileSync(outputFile, newCode, "utf-8");
} }

0 comments on commit 4d7d2f6

Please sign in to comment.