1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 17:44:56 +09:00
ladybird/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js

26 lines
617 B
JavaScript

try {
try {
Math.abs(-20) = 40;
} catch (e) {
assert(e.name === "ReferenceError");
assert(e.message === "Invalid left-hand side in assignment");
}
try {
512 = 256;
} catch (e) {
assert(e.name === "ReferenceError");
assert(e.message === "Invalid left-hand side in assignment");
}
try {
"hello world" = "another thing?";
} catch (e) {
assert(e.name === "ReferenceError");
assert(e.message === "Invalid left-hand side in assignment");
}
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}