test262/implementation-contributed/javascriptcore/modules/cyclic-may-produce-tdz/1.js

13 lines
395 B
JavaScript

import { Cappuccino, Matcha } from "./2.js"
import { shouldThrow, shouldBe } from "../resources/assert.js";
export let Cocoa = "Cocoa";
// module "2" is not loaded yet, TDZ.
shouldThrow(() => {
Cappuccino;
}, `ReferenceError: Cannot access uninitialized variable.`);
// But "Matcha" is variable (not lexical variable). It is already initialized as undefined.
shouldBe(Matcha, undefined);