ClojureScript js->clj not converting


  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not Reproducible
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    ClojureScript 0.0-1586 build #22, Chrome, OSX


I've updated to 0.0-1586 build #22 from a much older release: 0.0-1450

I'm now geting a problem with (js->clj token) not converting token to a map; this worked before I upgraded.

token is generated by the google OAuth 2 process: "gapi.auth.authorize"

I don't think the problem is with js->clj rather something about token so it isn't recognised as a js/Object.

(println (expose token true)) gives:

access_token = ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64
token_type = Bearer
expires_in = 3600
client_id =
scope =,,
g_user_cookie_policy = undefined
cookie_policy = undefined
issued_at = 1361807171
expires_at = 1361810771

This looks ok.

> token


"Error evaluating:" token :as "esef.client.evidence.token"
#<TypeError: Object [object Object] has no method 'toString'>
TypeError: Object [object Object] has no method 'toString'

> (type token)

gives a blank line. I think this is why js->clj isn't converting.

> (alength token)

gives a blank line.

(.-token_type token)

Correctly gives ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64

I haven't managed to recreate 'token' with a minimal test case but I'm fairly new to javascript. It's impractical to to include my OAuth 2 code because its tied into all my google security.
If you can suggest anything that will provide you with more info on 'token' I'll try and help.

As a work-around I manually create the MAP by explicitly reading each property, I couldn't get a list of properties.


Mike Longworth made changes -
Field Original Value New Value
Comment [ oops "wl :type" is my debug; read (type x) js/Object): ]
David Nolen made changes -
Priority Major [ 3 ] Minor [ 4 ]
David Nolen made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Not Reproducible [ 4 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]


Vote (0)
Watch (3)


  • Created: