compat-table / compat-table/compat-table
super bindings in object literals' concise methods
Open
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.