I'm trying to convert a javascript object (parsed JSON from a web service) into 
a clojure data structure.  It works fine if I use :simple optimization with the 
closure compiler, however when I switch to :advanced optimization, I get the 
following error:

(let [my-data #js {}] ; see below for JSON
  (.info js/console "converted to clojure" (str (js->clj my-data))))

Uncaught Error: No protocol method IEmptyableCollection.-empty defined for type 
object: [object Object]

Note that this also only seems to happen with this junk of JSON (though 
according to all the JSON linters I've tried, it is valid).  I've passed other 
input through without issue.

Here is the JSON (also posted here http://pastebin.com/PLffFrFf )

[{"address_components":[{"long_name":"11810","short_name":"11810","types":["postal_code"]},{"long_name":"16
 de Septiembre","short_name":"16 de 
Septiembre","types":["neighborhood","political"]},{"long_name":"Miguel 
Hidalgo","short_name":"Miguel 
Hidalgo","types":["sublocality_level_1","sublocality","political"]},{"long_name":"Ciudad
 de México","short_name":"México 
D.F.","types":["locality","political"]},{"long_name":"Distrito 
Federal","short_name":"D.F.","types":["administrative_area_level_1","political"]},{"long_name":"Mexico","short_name":"MX","types":["country","political"]}],"formatted_address":"16
 de Septiembre, Miguel Hidalgo, 11810 Ciudad de México, D.F., 
Mexico","geometry":{"bounds":{"Ea":{"j":19.4043293,"k":19.3997335},"wa":{"j":-99.21262619999999,"k":-99.2045263}},"location":{"D":-99.20755880000002,"k":19.402037},"location_type":"APPROXIMATE","viewport":{"Ea":{"j":19.4043293,"k":19.3997335},"wa":{"j":-99.21262619999999,"k":-99.2045263}}},"types":["postal_code"]},{"address_components":[{"long_name":"11810","short_name":"11810","types":["postal_code"]},{"long_name":"West
 Jakarta","short_name":"West 
Jakarta","types":["locality","political"]},{"long_name":"Kamal","short_name":"Kamal","types":["administrative_area_level_4","political"]},{"long_name":"Kalideres","short_name":"Kalideres","types":["administrative_area_level_3","political"]},{"long_name":"West
 Jakarta City","short_name":"West Jakarta 
City","types":["administrative_area_level_2","political"]},{"long_name":"Jakarta","short_name":"Jakarta","types":["administrative_area_level_1","political"]},{"long_name":"Indonesia","short_name":"ID","types":["country","political"]}],"formatted_address":"Kamal,
 Kalideres, West Jakarta City, Jakarta 11810, 
Indonesia","geometry":{"bounds":{"Ea":{"j":-6.095065399999999,"k":-6.110835},"wa":{"j":106.68747699999994,"k":106.71448510000005}},"location":{"D":106.70282500000008,"k":-6.101219},"location_type":"APPROXIMATE","viewport":{"Ea":{"j":-6.095065399999999,"k":-6.110835},"wa":{"j":106.68747699999994,"k":106.71448510000005}}},"types":["postal_code"]},{"address_components":[{"long_name":"11810","short_name":"11810","types":["route"]},{"long_name":"Příbram
 District","short_name":"Příbram 
District","types":["administrative_area_level_2","political"]},{"long_name":"Central
 Bohemian Region","short_name":"Central Bohemian 
Region","types":["administrative_area_level_1","political"]},{"long_name":"Czech
 Republic","short_name":"CZ","types":["country","political"]},{"long_name":"261 
01","short_name":"261 01","types":["postal_code"]}],"formatted_address":"11810, 
261 01, Czech 
Republic","geometry":{"bounds":{"Ea":{"j":49.7328257,"k":49.7102303},"wa":{"j":13.979755599999976,"k":13.986990699999978}},"location":{"D":13.982032200000049,"k":49.7225575},"location_type":"GEOMETRIC_CENTER","viewport":{"Ea":{"j":49.7328257,"k":49.7102303},"wa":{"j":13.979755599999976,"k":13.986990699999978}}},"types":["route"]}]

Is this a bug or am I missing something?

I'm running ClojureScript 0.0-2496

Thanks!
Erik

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to