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

add 'name includes .' ember_assert to get/set #685

Closed
grosser opened this issue Apr 13, 2012 · 3 comments
Closed

add 'name includes .' ember_assert to get/set #685

grosser opened this issue Apr 13, 2012 · 3 comments

Comments

@grosser
Copy link

grosser commented Apr 13, 2012

Ive been bitten by this so many times, that I really would like to be notified if I get or set something that has a '.', its such a subtle error to do and would make it so much easier to spot.

get('record.foo') -> Boom

Other solution:
always getPath when doing get + introduce getSimple for the edge-cases where you might not want it

@lukemelia
Copy link
Member

I like the idea. This would be a definite win for a debug build. Would need to be benchmarked to see how it impacted performance for the normal ember_assert dev build.

@wagenet
Copy link
Member

wagenet commented Apr 15, 2012

@grosser The reason why we don't do this is the same reason why we have get and getPath separate. get is a very hot code path and we don't want to do anything to slow it down, even checking for the presence of a period. If we used ember_assert it would only be in development mode, but even then, I think the slow down would likely be noticeable enough that we wouldn't even want it there.

@wagenet
Copy link
Member

wagenet commented Jul 13, 2012

We've finally benchmarked this and discovered that the difference isn't all that significant. It seems likely that we'll merge getPath into get.

@wagenet wagenet closed this as completed Jul 13, 2012
sandstrom pushed a commit to sandstrom/ember.js that referenced this issue Jun 17, 2021
…rn/ember-prism-0.9.0

Bump ember-prism from 0.8.2 to 0.9.0
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

No branches or pull requests

3 participants