Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 423 Bytes

early-module-declaration.md

File metadata and controls

21 lines (16 loc) · 423 Bytes

In case of cycles, modules may have export fields in deadzone which throw upon access. Because Aran hoists module declarations at the beginning of modules, these deadzones are no longer honored.

import * as self from "./self.mjs";
console.log({ foo: self.foo });
export const foo = 123;

Normal output:

ReferenceError: Cannot access 'foo' before initialization

Aran output:

{ foo: undefined }