[CLJS-478] ClojureScript js->clj not converting Created: 26/Feb/13 Updated: 29/Jul/13
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
This looks ok.
"Error evaluating:" token :as "esef.client.evidence.token"
> (type token)
gives a blank line. I think this is why js->clj isn't converting.
> (alength token)
gives a blank line.
Correctly gives ya29.AHES6ZSgnk3Ws5bB-2aDx41Bbr335hKugjZJfcNAs83d121S306fxy64
As a work-around I manually create the MAP by explicitly reading each property, I couldn't get a list of properties.
|Comment by David Nolen [ 26/Feb/13 11:00 AM ]|
type just returns the constructor property of an Object. For some reason this is returning undefined instead of value. It's likely that this has nothing to do with ClojureScript and more to do with Google Closure. Have you investigated whether the OAuth token constructor has changed in Closure itself?
|Comment by Mike Longworth [ 26/Feb/13 11:21 AM ]|
I don't think the token object or the apis have any significant relationship with closure, they are loaded dynamically from google (gapi.client.load):
|Comment by David Nolen [ 26/Feb/13 11:25 AM ]|
Did type return something for you instead of undefined in 1450?
|Comment by Mike Longworth [ 26/Feb/13 11:40 AM ]|
Sorry I can't answer that; js->clj just worked so I didn't probe too deeply but looking at the code in js->clj It looks like it must have. I tried the original implementation of js->clj before the recent changes but confirmed this still suffers from the same problem (type x) js/Object):
|Comment by David Nolen [ 29/Jul/13 10:39 PM ]|
There's currently not enough information on this ticket.