Skip to content

Commit

Permalink
ShadowRealm: add more tests for globalThis ordinary object conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Apr 11, 2022
1 parent d7c0a20 commit 24e4eb0
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,27 @@ assert.sameValue(
true,
'globalThis.constructor is Object'
);

assert.sameValue(
r.evaluate(`
let result;
try {
globalThis.__proto__ = {x: 2};
result = true;
} catch (e) {
result = false;
}
result;
`),
true,
'Can assign to globalThis.__proto__ directly'
);

assert.sameValue(
r.evaluate(`
Reflect.set(globalThis.__proto__, {x: 1}) &&
Reflect.setPrototypeOf(globalThis.__proto__, {x: 2});
`),
true,
'Can set an ordinary globalThis.__proto__'
);

0 comments on commit 24e4eb0

Please sign in to comment.