1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:47:35 +00:00

LibJS: Check type of ShadowRealm.prototype.importValue() 2nd argument

This is a normative change in the ShadowRealm spec.

See: 2b45a15
This commit is contained in:
Linus Groh 2022-03-29 23:48:25 +01:00
parent f1d744e11a
commit 68ee193464
2 changed files with 11 additions and 3 deletions

View file

@ -70,4 +70,11 @@ describe("errors", () => {
ShadowRealm.prototype.importValue.call("foo");
}).toThrowWithMessage(TypeError, "Not an object of type ShadowRealm");
});
test("export name must be string", () => {
const shadowRealm = new ShadowRealm();
expect(() => {
shadowRealm.importValue("./whatever.mjs", 123);
}).toThrowWithMessage(TypeError, "123 is not a string");
});
});