1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 01:14:58 +00:00
serenity/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js
2020-07-06 23:40:35 +02:00

12 lines
393 B
JavaScript

test("assignment to function call", () => {
expect(() => {
function foo() {}
foo() = "foo";
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
});
test("assignment to inline function call", () => {
expect(() => {
(function () {})() = "foo";
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
});