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
commit 68ee193464
Notes: sideshowbarker 2024-07-17 16:32:50 +09:00
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");
});
});