From 24e4eb09dae17e0a17eadb8b7dbf2cf363c7596e Mon Sep 17 00:00:00 2001 From: rwaldron Date: Mon, 11 Apr 2022 10:16:36 -0400 Subject: [PATCH] ShadowRealm: add more tests for globalThis ordinary object conformance --- ...bject.js => globalthis-ordinary-object.js} | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) rename test/built-ins/ShadowRealm/prototype/evaluate/{globalthis-orginary-object.js => globalthis-ordinary-object.js} (81%) diff --git a/test/built-ins/ShadowRealm/prototype/evaluate/globalthis-orginary-object.js b/test/built-ins/ShadowRealm/prototype/evaluate/globalthis-ordinary-object.js similarity index 81% rename from test/built-ins/ShadowRealm/prototype/evaluate/globalthis-orginary-object.js rename to test/built-ins/ShadowRealm/prototype/evaluate/globalthis-ordinary-object.js index fd71e910268..fef470ea005 100644 --- a/test/built-ins/ShadowRealm/prototype/evaluate/globalthis-orginary-object.js +++ b/test/built-ins/ShadowRealm/prototype/evaluate/globalthis-ordinary-object.js @@ -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__' +);