-
Notifications
You must be signed in to change notification settings - Fork 947
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
Array.from
/Array.of
/Array#slice
without "class"
#453
Comments
Tests shoud be called on IE9.
Ok, which result shoud be on I think, possible change |
It definitely requires However, I agree - |
Why only for 3? :) Most |
Those are the only ones that exist in the compat table so far :-) |
@ljharb ok, how you propose test |
The way Hmm - with my shimmed |
@zloirock Please file an issue about this on |
It's not correct ES6 behavior, see link to spec :) Ok, will create issue. |
@ljharb it's a tricky question. On one hand, I can see how we would want to mark implementations that don't support I just looked at the spec and can't figure out how exactly (for example) Array-subclassed objects inherit "magic"/exotic [[DefineOwnProperty]] behavior. 22.1.1 says:
And I don't see anything relevant in 14.5.14 (RuntimeSemantics of ClassHeritage). It sets [[Prototype]] in 15 but which mechanism takes care of [[DefineOwnProperty]] "propagation"? ArraySpeciesCreate internal function sounds like something that could be taking care of it, but it's only used in few Array.prototype methods. Does anybody know more? |
I'm also confused by this part:
what's a super call to the Array constructor? Do they mean That latter doesn't make (common) sense and implementations already work without it. |
@kangax Technically the requirement for Array methods (from, of, slice, etc) to work on non-arrays is completely unrelated to the ability to subclass arrays - so I think the feature tests shouldn't require subclassing in order to ensure that the methods are generic, per spec. A super call to the Array constructor basically means |
@ljharb methods — yes, but I was talking about [[DefineOwnProperty]] behavior (something that we couldn't inherit in ES5 — http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/) |
Although
class
keyword semantics are required to actually subclass Array, these three methods can still be tested without it:I'm asking because the
es6-shim
does (or will at next publish) ensure that all of these tests pass. Inio.js
, which implementsclass
but notArray.from
, thees6-shim
also makes these tests pass with the "class" syntax.es6-shim
a "Yes" for these 3 tests, once they all pass?The text was updated successfully, but these errors were encountered: