Permalink
Browse files

support 'throw' and 'UNARY_MINUS' in jscexc

  • Loading branch information...
1 parent 012856b commit 4d7d2f638e68dcba1eebaec9d84ddda39e2f5d5d @JeffreyZhao committed Jun 4, 2012
Showing with 7 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +5 −1 src/jscexc.js
View
@@ -2,3 +2,5 @@ node_modules
tools/compiler.jar
*.swp
doc/out
+*~
+_*
View
@@ -80,6 +80,7 @@ var extract = function (ast) {
case "ARRAY_INIT":
case "PROPERTY_INIT":
case "NEW_WITH_ARGS":
+ case "UNARY_MINUS":
case ".":
case ">":
case "<":
@@ -135,6 +136,9 @@ var extract = function (ast) {
case "return":
visit(node.value);
break;
+ case "throw":
+ visit(node.exception);
+ break;
default:
throw new Error('"' + token + '" is not currently supported.');
}
@@ -196,4 +200,4 @@ if (module.parent) { // command
var code = fs.readFileSync(inputFile, "utf-8");
var newCode = compile(code);
fs.writeFileSync(outputFile, newCode, "utf-8");
-}
+}

0 comments on commit 4d7d2f6

Please sign in to comment.