compat-table / compat-table/compat-table

`Array.from`/`Array.of`/`Array#slice` without "class"

Open
#453 12 comments 0 reactions 0 assignees View on GitHub
ES6 new test
Dominant language
JavaScript
Stars
4.5k
Forks
933
PR merge metrics
No merged PRs in 30d

Description

Although `class` keyword semantics are required to _actually_ subclass Array, these three methods can still be tested without it:

``` js
function Foo() {}
Object.setPrototypeOf(Foo, Array);
Foo.prototype = Array.prototype;

assert(Foo.from([1, 2]) instanceof Foo);
assert(Foo.of(1, 2) instanceof Foo);
assert(new Foo().slice() instanceof Foo);
```

I'm asking because the `es6-shim` does (or will at next publish) ensure that all of these tests pass. In `io.js`, which implements `class` but not `Array.from`, the `es6-shim` also makes these tests pass with the "class" syntax.
- Do you think we can change the test code for these three to not require "class" syntax?
- Is this sufficient for me to mark `es6-shim` a "Yes" for these 3 tests, once they all pass?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.