ladybird/Libraries/LibJS/Tests/modules/accessing-lex-import-before-decl.mjs
Timothy Flynn 019c529c07 Meta: Increase the line length enforced by prettier to 120
This matches our coding style recommendation in CodingStyle.md, and
matches our python formatting.
2025-10-31 19:55:50 -04:00

22 lines
631 B
JavaScript

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) {
if (!(e instanceof TypeError)) throw new Error("Expected importedLexVariable = 0; to throw TypeError got " + e);
}
import { value as importedLexVariable } from "./accessing-lex-import-before-decl.mjs";
export let value = 123;
export { passed };