-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feature detects for ES6 Array, Math, Number, Object, String; for #1170 #1269
Conversation
} | ||
!*/ | ||
/* DOC | ||
Check if browser implements ECMAScript 5 Array per specification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean ECMAScript 6 Array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this in a second. :)
I noticed that there's a separate feature-detect for I have left it in place. However, it's possible that it makes sense to remove it, as the |
I squashed and force pushed. The typo and the unwrapping of unnecessary functions has been done. |
bravo, sir. very well done. I am a bit confused as to the utility of this, though. Why would someone want to know that all properties exist (rather than a specific one?) |
@patrickkettner I'm just following the pattern of a previous pull request I got through for the ES5 tests: #901 It seemed okay back then to test for them in type-specific batches. |
@jokeyrhyme - totally get that, it was more of a topic-of-discussion for @stucox, @ryanseddon, @paulirish, yourself, and anyone else who would like to pitch in an opinion. |
Separate detects for every feature would result in LOADS of new detects — and you'd have to include loads to know whether or not to load a shim (which you may well not want to download if it isn't needed). There's both a performance & maintenance overhead in having many separate detects instead of a few broader ones. I haven't really looked into the available ES6 shims, but for ES5 it was evident that grouping them like this was a good compromise, meaning only a couple of detects were needed to decide which shim/sham may be needed — while not tying Modernizr to a specific set of shims. |
@jokeyrhyme How do we expect these to evolve as the drafts change? As you highlighted on the other thread, a few things are still in flux. While we want to keep current, it might be odd if we release a detect which changes what it considers to be a “compliant” implementation too frequently. We could attach a |
We could always hold off merging this until ES6 goes gold. Also, this won't be in the wild until Modernizr v3 at the earliest if you do merge. What's that timeframe versus ES6 timeframe looking like?
Anyone trying to detect ES6 right now should know that ES6 itself isn't finished, so our feature detects can't be considered final. If we have an "experimental" flag, that would be great. Is it worth raising that as a separate issue? An experimental flag might even allow us to avoid future issues like the "flexbox" and "flexwrap" detects, which really should have been merged but couldn't be because of downstream compatibility concerns. |
I'm 1 free weekend away from being ready to release a v3 beta. I don't think we need an "experimental" flag, that's kind of what |
@stucox my bad. I didn't realise there actually already was a |
I just updated the Let me know if there is anything else found wanting. :) |
Excellent stuff. This looks good to me then. What say you, @patrickkettner? Happy with this approach? |
+1 only nit is I think |
@patrickkettner done! |
I'm +1 |
Just one last question: do you think I ought to included sub-class tests for the built-ins in this set of detects? |
sounds useful |
Maybe that should be a separate detect (or at least a separate PR). Is it reasonable to assume a browser would make all of these built-ins subclassable at the same time? |
Perhaps. As I discuss over in the ticket, detecting subclassable would possibly rely on either the It's probably best to tackle these in a separate detect. |
I think we’re looking good here then. Unless we want to change all of the clauses to use Any properties here for which we can imagine some implementation might throw an error for when accessed, rather than just being |
@stucox We have the |
Yep, sounds like a plan. Thanks dude 👍 |
feature detects for ES6 Array, Math, Number, Object, String; for #1170
feature detects for ES6 Array, Math, Number, Object, String; for Modernizr#1170
for #1170