1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibJS: Implement the object literal __proto__ property key special case

This commit is contained in:
Idan Horowitz 2022-03-05 23:44:49 +02:00
parent 9fa78b1a05
commit 7ebb421ee9
4 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,6 @@
test("__proto__ property", () => {
expect(Object.getPrototypeOf({ __proto__: null })).toBeNull();
expect(Object.getPrototypeOf({ __proto__: Array.prototype })).toEqual(Array.prototype);
expect(Object.getPrototypeOf({ "__proto__": Array.prototype })).toEqual(Array.prototype); // prettier-ignore
expect(Object.getOwnPropertyNames({ __proto__: Array.prototype, test: 1 })).toEqual(["test"]);
});