mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
LibJS: Implement & use the {Ordinary,PrepareFor}WrappedFunctionCall AOs
This is a normative change in the ShadowRealm spec.
See: 5a3aae8
This commit is contained in:
parent
5a281336c5
commit
fed1498824
3 changed files with 102 additions and 13 deletions
|
@ -130,4 +130,20 @@ describe("errors", () => {
|
|||
shadowRealm.evaluate("(() => { throw 42; })()");
|
||||
}).toThrowWithMessage(TypeError, "The evaluated script did not complete normally");
|
||||
});
|
||||
|
||||
test("TypeError from revoked proxy is associated to caller realm", () => {
|
||||
const shadowRealm = new ShadowRealm();
|
||||
shadowRealm.evaluate("p = Proxy.revocable(() => {}, {}); undefined");
|
||||
const proxy = shadowRealm.evaluate("p.proxy");
|
||||
const revoke = shadowRealm.evaluate("p.revoke");
|
||||
const ShadowRealmTypeError = shadowRealm.evaluate("TypeError");
|
||||
revoke();
|
||||
try {
|
||||
proxy();
|
||||
expect.fail();
|
||||
} catch (e) {
|
||||
expect(e.constructor).toBe(TypeError);
|
||||
expect(e.constructor).not.toBe(ShadowRealmTypeError);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue