blob: b8e0792a05d34a7937e5bd9fccf5d71435c2d2f4 [file] [log] [blame]
(async function () {
const { shouldBe, shouldThrow } = await import("./import-tests/should.js");
{
let cocoa = await eval(`import("./import-tests/cocoa.js")`);
shouldBe(cocoa.hello(), 42);
}
{
let cocoa = await (0, eval)(`import("./import-tests/cocoa.js")`);
shouldBe(cocoa.hello(), 42);
}
{
let cocoa = await eval(`eval('import("./import-tests/cocoa.js")')`);
shouldBe(cocoa.hello(), 42);
}
{
let cocoa = await ((new Function(`return eval('import("./import-tests/cocoa.js")')`))());
shouldBe(cocoa.hello(), 42);
}
{
let cocoa = await eval(`(new Function('return import("./import-tests/cocoa.js")'))()`);
shouldBe(cocoa.hello(), 42);
}
{
let cocoa = await [`import("./import-tests/cocoa.js")`].map(eval)[0];
shouldBe(cocoa.hello(), 42);
}
}()).catch((error) => {
print(String(error));
abort();
});