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

Projects
None yet
3 participants
@andykant
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@bmomberger-reciprocity

bmomberger-reciprocity Jan 2, 2014

Contributor

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.

Contributor

bmomberger-reciprocity commented Jan 2, 2014

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 9, 2014

Contributor

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

Contributor

daffl commented Jan 9, 2014

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

@andykant

This comment has been minimized.

Show comment
Hide comment
@andykant

andykant Jan 9, 2014

Contributor

@daffl Updated

Contributor

andykant commented Jan 9, 2014

@daffl Updated

daffl added a commit that referenced this pull request Jan 13, 2014

Merge pull request #634 from bitovi/scope_static
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

1 check passed

default The Travis CI build passed
Details

@daffl daffl deleted the scope_static branch Jan 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment