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

../ looks up wrong property on maps #2244

Closed
dylanrtt opened this issue Feb 8, 2016 · 3 comments
Closed

../ looks up wrong property on maps #2244

dylanrtt opened this issue Feb 8, 2016 · 3 comments
Assignees
Milestone

Comments

@dylanrtt
Copy link
Contributor

dylanrtt commented Feb 8, 2016

Seen in 2.3.14 (working in 2.3.13), if I use ../ or something similar to read an ancestor scope, the result is undefined.

http://jsbin.com/rayolokeho/edit?html,js,console,output

{{#each people}}
  <foo-bar>
    <!-- logs undefined, should log the person -->
    {{log ../}}
  </foo-bar>
{{/each}}
@dylanrtt
Copy link
Contributor Author

This was caused by #2219.

The can.compute 'map' reader (compute/read.js#L155) previously would return the context with map.attr('') but that now looks for a property keyed with an empty string.

I also think that this should return the map rather than the object (always thought that was a bug).

@dylanrtt dylanrtt changed the title ../ not always working ../ returns the wrong value Feb 12, 2016
@dylanrtt dylanrtt changed the title ../ returns the wrong value ../ looks up wrong property on maps Feb 12, 2016
@daffl daffl added this to the 2.3.16 milestone Feb 12, 2016
@daffl daffl added the bug label Feb 12, 2016
@justinbmeyer
Copy link
Contributor

@dylanrtt

I also think that this should return the map rather than the object (always thought that was a bug).

What is that? I'm not sure what you mean.

@dylanrtt
Copy link
Contributor Author

What is that? I'm not sure what you mean.

I mean ../, not map.attr('').

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

No branches or pull requests

3 participants