Skip to content

Commit

Permalink
[js] support @:native method names that are invalid JS identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Oct 20, 2014
1 parent d0d5bac commit 13be162
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ let valid_js_ident s =
with Exit ->
false

let field s = if Hashtbl.mem kwds s then "[\"" ^ s ^ "\"]" else "." ^ s
let field s = if Hashtbl.mem kwds s || not (valid_js_ident s) then "[\"" ^ s ^ "\"]" else "." ^ s
let ident s = if Hashtbl.mem kwds s then "$" ^ s else s
let check_var_declaration v = if Hashtbl.mem kwds2 v.v_name then v.v_name <- "$" ^ v.v_name

Expand Down

0 comments on commit 13be162

Please sign in to comment.