ShadowRealm: add more tests for globalThis ordinary object conformance

This commit is contained in:
rwaldron 2022-04-11 10:16:36 -04:00 committed by Rick Waldron
parent d7c0a2076c
commit 24e4eb09da
1 changed files with 24 additions and 0 deletions

View File

@ -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__'
);