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
commit 7ebb421ee9
Notes: sideshowbarker 2024-07-17 17:53:48 +09:00
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"]);
});