mirror of https://github.com/tc39/test262.git
ShadowRealm: add more tests for globalThis ordinary object conformance
This commit is contained in:
parent
d7c0a2076c
commit
24e4eb09da
|
@ -64,3 +64,27 @@ assert.sameValue(
|
||||||
true,
|
true,
|
||||||
'globalThis.constructor is Object'
|
'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__'
|
||||||
|
);
|
Loading…
Reference in New Issue