Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can.Mustache / can.view.Scope: Can't access static properties from an object's constructor. #634

Merged
merged 3 commits into from Jan 13, 2014

Conversation

andykant
Copy link
Contributor

@andykant andykant commented Jan 2, 2014

http://jsfiddle.net/kQsG8/1/

When resoloving a property path from an object to a subproperty, CanJS's Scope is executing constructors/functions at every step, not just the last one. This means that static properties on a can.Map, e.g. the shortName of a Map subclass, are unavailable.

@ghost ghost assigned andykant Jan 2, 2014
@bmomberger-reciprocity
Copy link
Contributor Author

this seems to be specific to "constructor" because it's equal to its own prototype.constructor. A workaround is to give every can.Map a "class" property on init() that resolves to the constructor.

@daffl
Copy link
Contributor

daffl commented Jan 9, 2014

@andykant Can you merge this one with latest master, too? Thanks.

@andykant
Copy link
Contributor

andykant commented Jan 9, 2014

@daffl Updated

daffl added a commit that referenced this pull request Jan 13, 2014
can.Mustache / can.view.Scope: Can't access static properties from an object's constructor.
@daffl daffl merged commit 4f684b3 into master Jan 13, 2014
@daffl daffl deleted the scope_static branch January 13, 2014 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants