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

Ember.typeOf( Symbol ) returns "function", which will cause problems in this code #102

Closed
notmessenger opened this issue Jul 7, 2015 · 4 comments
Assignees
Milestone

Comments

@notmessenger
Copy link
Collaborator

'object' === Ember.typeOf( underTest )

'object' === Ember.typeOf( underTest ) ||

emberjs/ember.js#11673 has been opened regarding this issue in Ember.js so depending on the timing of when the issue is worked on it might already be resolved or we will need to accommodate it via a workaround in our code via using typeof. If we do the latter then we need to create an issue to remove our workaround once emberjs/ember.js#11673 is resolved and released.

@stefanpenner
Copy link

im curious why this library doesn't just use typeof ? It doesn't appear to care about anything Ember.typeOf adds

@notmessenger
Copy link
Collaborator Author

@stefanpenner We have been able to replace Array.isArray() checks such as in softlayer/sl-ember-translate@941cf03 when using Ember.typeOf(), as well as other standardization features Ember.typeOf() provides. As such, we elected to enforce its usage across the board (https://github.com/softlayer/ember-style-guide#type-checking) for our projects for consistency. And since any additional processing that might be incurred is only via the use of Ember.asserts() that get stripped out of production builds anyway we haven't encountered any issues.

If there is something missing in our approach or any recommendations you can make we're all ears!

@notmessenger
Copy link
Collaborator Author

emberjs/ember.js#11673 is not going to be resolved at this time so calls to Ember.typeOf() that are compared to 'object' must also contain logic similar to && 'symbol' != typeof

@notmessenger notmessenger added this to the v1.7.0 milestone Jul 21, 2015
@notmessenger
Copy link
Collaborator Author

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