2022-09-01 23:48:57 +02:00
|
|
|
let passed = true;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
importedLexVariable;
|
|
|
|
|
passed = false;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
if (!(e instanceof ReferenceError))
|
|
|
|
|
throw new Error("Expected importedLexVariable; to throw ReferenceError got " + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// Even though value is let, this should still throw TypeError because it is immutable!
|
|
|
|
|
importedLexVariable = 0;
|
|
|
|
|
passed = false;
|
|
|
|
|
} catch (e) {
|
2025-10-31 11:50:48 -04:00
|
|
|
if (!(e instanceof TypeError)) throw new Error("Expected importedLexVariable = 0; to throw TypeError got " + e);
|
2022-09-01 23:48:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
import { value as importedLexVariable } from "./accessing-lex-import-before-decl.mjs";
|
|
|
|
|
export let value = 123;
|
|
|
|
|
|
|
|
|
|
export { passed };
|