source-academy/js-slang

Incorrect Error for ExportNamedDeclarations with sources

leeyi45 opened this issue · 1 comments

In folder mode:

// /program.js
import { show, heart } from './other.js';
show(heart);

// /other.js
export { show, heart } from 'rune';

leads to the error: Line 5: ReferenceError: Cannot access 'show' before initialization. If this type of export is unsupported, then this error message is not indicative of that fact.

Code here

Yes, Source syntax should explicitly forbid the export syntax

export { show, heart } from 'rune';