diff --git a/javascript/sexp/module-test.ss b/javascript/sexp/module-test.ss index 38ec9e6..57d9da2 100644 --- a/javascript/sexp/module-test.ss +++ b/javascript/sexp/module-test.ss @@ -40,5 +40,4 @@ (registry->string)) [(list (cons start end)) (check > start 0)] - [_ (fail "Registry does not contain test1.ss script")])) - ) \ No newline at end of file + [_ (fail "Registry does not contain test1.ss script")]))) \ No newline at end of file diff --git a/javascript/sexp/module.ss b/javascript/sexp/module.ss index 10ba073..af9ca0b 100644 --- a/javascript/sexp/module.ss +++ b/javascript/sexp/module.ss @@ -30,7 +30,7 @@ #'(#%plain-module-begin require ... (define script (js stmt ...)) - (display (javascript->pretty-string script)) + #;(display (javascript->pretty-string script)) (registry-add! script) (provide script)))])) diff --git a/javascript/syntax-internal.ss b/javascript/syntax-internal.ss index 235508a..306f26a 100644 --- a/javascript/syntax-internal.ss +++ b/javascript/syntax-internal.ss @@ -115,7 +115,7 @@ #,(expand-identifier #'label) #,(expand-statement #'stmt))] [(!label arg ...) (raise-syntax-error #f "bad JS syntax" stx)] - [(throw expr) #`(make-ThrowStatment #f #,(expand-expression #'expr))] + [(throw expr) #`(make-ThrowStatement #f #,(expand-expression #'expr))] [(throw arg ...) (raise-syntax-error #f "bad JS syntax" stx)] [(try stmt+clause ...) #`(make-TryStatement #f #,@(expand-try-clauses #'(stmt+clause ...)))] [(unquote stmt) #`(quote-statement stmt)] diff --git a/javascript/syntax-test.ss b/javascript/syntax-test.ss index 15c7fa1..a766b05 100644 --- a/javascript/syntax-test.ss +++ b/javascript/syntax-test.ss @@ -112,7 +112,7 @@ (test-js "stmt: if version 1" (if x (return y)) - "if (x) return y; ") + "if (x) return y;") (test-js "stmt: if version 2" (if x (return y) (return z)) @@ -139,6 +139,10 @@ (js (for-in ((var key val) (!object [a 1] [b 2] [c 3])) (alert (+ key ": " val)))))) + (test-js "stmt: throw" + (throw "x") + "throw \"x\";") + (test-js "stmt: try version 1" (try (+ 1 2) (+ 2 3) (catch e (+ 3 4)) (finally (+ 4 5))) "try { 1 + 2; 2 + 3; } catch (e) { 3 + 4; } finally { 4 + 5; }")