Fix default class super inheritance (#7732)

Fixes #7683.
This commit is contained in:
Justin Ridgewell
2018-04-14 15:15:40 -04:00
committed by GitHub
parent 858a2c74e7
commit 0ee9a4e612
8 changed files with 118 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
class Test {
constructor() {
return super.constructor;
}
static test() {
return super.constructor;
}
}
// Instances
expect(Object.getPrototypeOf(Test.prototype)).toBe(Object.prototype);
expect(new Test()).toBe(Object);
// Static
expect(Object.getPrototypeOf(Test)).toBe(Function.prototype);
expect(Test.test()).toBe(Function);