1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 06:34:59 +00:00
serenity/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js
2020-04-20 11:38:01 +02:00

28 lines
588 B
JavaScript

load("test-common.js");
try {
assertThrowsError(() => {
512 = 256;
}, {
error: ReferenceError,
message: "Invalid left-hand side in assignment"
});
assertThrowsError(() => {
512 = 256;
}, {
error: ReferenceError,
message: "Invalid left-hand side in assignment"
});
assertThrowsError(() => {
"hello world" = "another thing?";
}, {
error: ReferenceError,
message: "Invalid left-hand side in assignment"
});
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}