haikuwebkit/JSTests/es6/class_extends_null.js

14 lines
245 B
JavaScript

function test() {
class C extends null {
constructor() { return Object.create(null); }
}
return Function.prototype.isPrototypeOf(C)
&& Object.getPrototypeOf(C.prototype) === null;
}
if (!test())
throw new Error("Test failed");