`get` provides safe deep property access by handing nil appropriately, but `aget` has never done this to my knowledge. It just emits straight JS bracket notation:
`(aget a 4 1 2)` => `(cljs.user.a[(4)][(1)][(2)])` So `aget` cannot be safely used this way for arrays or objects. On Wednesday, August 5, 2015 at 4:41:37 AM UTC-5, Peter Taoussanis wrote: > Hi folks, > > Running ClojureScript 1.7.28 - just ran into some unexpected behaviour: > > (aget nil "foo") throws an error; was expecting it to return nil. > > This also leads to (aget obj "foo" "bar") throwing when obj doesn't have a > "foo" property. Was expecting that to return nil too. > > Is this behaviour intentional? > > Thanks! -- 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.
