../ looks up wrong property on maps #2244

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

Comments

Projects
None yet
3 participants
@dylanrtt
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

This comment has been minimized.

Show comment
Hide comment
@dylanrtt

dylanrtt Feb 12, 2016

Contributor

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).

Contributor

dylanrtt commented Feb 12, 2016

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 from ../ not always working to ../ returns the wrong value Feb 12, 2016

@dylanrtt dylanrtt changed the title from ../ returns the wrong value to ../ 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

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Feb 13, 2016

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.

Contributor

justinbmeyer commented Feb 13, 2016

@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.

@justinbmeyer justinbmeyer self-assigned this Feb 13, 2016

justinbmeyer added a commit that referenced this issue Feb 13, 2016

@dylanrtt

This comment has been minimized.

Show comment
Hide comment
@dylanrtt

dylanrtt Feb 13, 2016

Contributor

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

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

Contributor

dylanrtt commented Feb 13, 2016

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

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

daffl added a commit that referenced this issue Feb 16, 2016

@daffl daffl closed this in #2264 Feb 17, 2016

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