-
Notifications
You must be signed in to change notification settings - Fork 58
lang.isObject
isn't reliable in ES6 environments
#62
Comments
Darnit. So you're saying #45's idea has a hole? Is there something we can do instead that doesn't go back to the previous problem of having to think of every thing we want to exclude? Also, does the fact that lang's |
Do we maybe have an ES6 has branch? Something that detects Symbols and
|
I ran into a similar curiosity when writing dojo/array. The spec suggested using a wrapper for In a similar manner, if we're targeting ES5+ we should be able to use:
If it's truly an object |
Apologies... I read the first part of the comment and not the second part:
It is getting a bit silly though that we can't sort patches like this in 5 months. We really need to try harder. |
If time were an unlimited resource... My opinion on the matter at the time was "I'm not really worried about the symbols case, and what's there already works otherwise, so I'd just as soon not land this unless we can come up with something better", and my and others' attention were focused on other things, so I didn't see that particular PR as pressing. |
Yup, five months is a really constrained resource. Gotcha. |
4869ea9 should be backed out. The following code is now producing strange results: a = { a: /asdf/ };
b = { a: /qwer/ };
lang.deepMixin(a, b);
a.a === b.a // false
a.a // {} Additionally, I don't think we should worry about the case of someone changing an object's |
In ES6 environments,
Symbol.toStringTag
allows modifying the return fromObject.prototype.toString.call(o)
:The text was updated successfully, but these errors were encountered: