1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibJS: Constructor function's "prototype" property should be writable

This matches other engines.
This commit is contained in:
Andreas Kling 2020-11-29 18:01:59 +01:00
parent 01c8765519
commit 2e4832c3da
3 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,10 @@
test("a function's prototype property should be writable", () => {
function x() {}
var desc = Object.getOwnPropertyDescriptor(x, "prototype");
expect(desc.writable).toBe(true);
expect(desc.enumerable).toBe(false);
expect(desc.configurable).toBe(false);
x.prototype = 1;
expect(x.prototype).toBe(1);
});