1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibJS: Make assignment to CallExpression a syntax error in strict mode

This commit is contained in:
Linus Groh 2020-10-05 00:00:10 +01:00 committed by Andreas Kling
parent 283ee678f7
commit f4d0babd5d
2 changed files with 6 additions and 0 deletions

View file

@ -5,6 +5,10 @@ test("assignment to function call", () => {
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
});
test("assignment to function call in strict mode", () => {
expect("'use strict'; foo() = 'foo'").not.toEval();
});
test("assignment to inline function call", () => {
expect(() => {
(function () {})() = "foo";