Skip to content

Commit

Permalink
emit cljs.core.ObjMap.EMPTY when map is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronsa authored and David Nolen committed Jun 7, 2012
1 parent 08a4a21 commit 2630b49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/clj/cljs/compiler.clj
Expand Up @@ -349,6 +349,9 @@
[{:keys [env simple-keys? keys vals]}]
(emit-wrap env
(cond
(zero? (count keys))
(emits "cljs.core.ObjMap.EMPTY")

(and simple-keys? (<= (count keys) obj-map-threshold))
(emits "cljs.core.ObjMap.fromObject(["
(comma-sep keys) ; keys
Expand Down

0 comments on commit 2630b49

Please sign in to comment.