.-default property access returns nil

Description

Types defined with deftype/defrecord which have a default field will incorrectly return nil with property access. The following example will return nil.

(deftype Foo [default]) (let [foo (Foo. "bar")] (.-default foo))

Environment

None

Attachments

2
  • 18 Mar 2015, 05:43 PM
  • 13 Oct 2014, 10:16 PM

Activity

Show:

David Nolen August 1, 2017 at 11:42 PM

Now that we have CLJS-1620, a warning seems like a good answer.

David Nolen March 18, 2015 at 5:46 PM

The warning is not desirable. Instead we should just munge and ensure property access always works.

Joel Holdbrooks March 18, 2015 at 5:43 PM

Updated to use new refactorings

David Nolen October 15, 2014 at 12:06 AM

I'm sure, I'd like to avoid this kind of code duping. Cleaner in the end and better moving forward.

Joel Holdbrooks October 14, 2014 at 11:03 PM

Are you sure, David? That might make this patch a bit more noisy. If it's not a problem I'm happy to do it.

Details

Assignee

Reporter

Patch

Code and Test

Fix versions

Affects versions

Priority

Created October 12, 2014 at 4:54 AM
Updated August 1, 2017 at 11:42 PM

Flag notifications