Skip to content

Update SpiderMonkey binaries #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/js
Binary file added bin/js-24.6.0-Linux-i686
Binary file not shown.
Binary file added bin/js-24.6.0-Linux-x86_64
Binary file not shown.
12 changes: 7 additions & 5 deletions src/js/spiderMonkey.ml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ let rec stmt (v : json_type) : stmt =
(* NOTE(jpolitz): We simply take the first handler --- multiple
handlers are Spidermonkey-specific. JS only specifies one
or zero catch blocks. *)
(match (list (get "handlers" v)) with
| [] -> None
| [handler] -> catch handler
| _ -> pos_error v "More than one catch handler provided"),
(match (try_get "handlers" v) with
| None -> catch (get "handler" v) (* New Spidermonkey *)
| Some(handlers) ->
(match (list handlers) with
| [] -> None
| [handler] -> catch handler (* Old Spidermonkey *)
| _ -> pos_error v "More than one catch handler provided")),
maybe block (get "finalizer" v))
| "While" -> While (p, expr (get "test" v), stmt (get "body" v))
| "DoWhile" -> DoWhile (p, stmt (get "body" v), expr (get "test" v))
Expand Down Expand Up @@ -282,4 +285,3 @@ let parse_spidermonkey (cin : in_channel) (name : string) : Js_syntax.program =
(lexbuf.Lexing.lex_curr_p, lexbuf.Lexing.lex_curr_p)))
(Lexing.lexeme lexbuf)))
| _ -> raise (Failure "Unexpected error in parse_spidermonkey")

6 changes: 3 additions & 3 deletions tests/json_print.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
if (arguments.length != 1) {
if (scriptArgs.length != 1) {
print("usage: js json_print.js <filename>");
} else {
var file = read(arguments[0]);
var result = Reflect.parse(file, {loc : true, source: arguments[0]});
var file = read(scriptArgs[0]);
var result = Reflect.parse(file, {loc : true, source: scriptArgs[0]});
print(JSON.stringify(
result,
function(key,value) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/unit-tests/regexp-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ var l = [];
l.push(a[0]);
foo();
})();
if (l[0] === "foo" &&
if (l[0] === "baz" &&
l[1] === "bar" &&
l[2] === "baz") {
l[2] === "foo") {
console.log("passed");
}