Skip to content

Commit

Permalink
[js] generate array literal for "new Array<T>()" expressions as it st…
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Nov 6, 2014
1 parent 800b8f8 commit 964c344
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ and gen_expr ctx e =
spr ctx " = ";
gen_value ctx e
end
| TNew ({ cl_path = [],"Array" },_,[]) ->
print ctx "[]"
| TNew (c,_,el) ->
print ctx "new %s(" (ctx.type_accessor (TClassDecl c));
concat ctx "," (gen_value ctx) el;
Expand Down

0 comments on commit 964c344

Please sign in to comment.