Skip to content

Commit

Permalink
CLJS-782: toString implementation for UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
swannodette committed Mar 12, 2014
1 parent c441a12 commit 2870101
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cljs/cljs/core.cljs
Expand Up @@ -7717,6 +7717,9 @@ Maps become Objects. Arbitrary keys are encoded to by key->js."
;; UUID

(deftype UUID [uuid]
Object
(toString [_] uuid)

IEquiv
(-equiv [_ other]
(and (instance? UUID other) (identical? uuid (.-uuid other))))
Expand Down
4 changes: 4 additions & 0 deletions test/cljs/cljs/core_test.cljs
Expand Up @@ -2162,5 +2162,9 @@
(assert (vector? x))
(assert (= x [1 2 3])))

;; CLJS-782
(assert (= (.toString #uuid "550e8400-e29b-41d4-a716-446655440000")
"550e8400-e29b-41d4-a716-446655440000"))

:ok
)

0 comments on commit 2870101

Please sign in to comment.