compat-table / compat-table/compat-table

super bindings in object literals' concise methods

Open
#511 3 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

I don't claim to fully understand what's going on here, but:

``` js
var o = {
__proto__: Array.prototype,
foo() {
super.push(true);
},
}
o.foo();
o.foo();
o; // {0:true,1:true,length:2}
```

Without the browser-specific `__proto__`, `super` seems restricted to just Object.prototype methods:

``` js
var o = {
hasOwnProperty(a) {
return !super.hasOwnProperty(a);
},
foo: true,
};
o.hasOwnProperty('foo'); // false
o.hasOwnProperty('bar'); // true
```

If anyone has a more concrete explanation, do tell.

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.