diff options
Diffstat (limited to 'Libraries/LibJS/Tests/invalid-lhs-in-assignment.js')
-rw-r--r-- | Libraries/LibJS/Tests/invalid-lhs-in-assignment.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js b/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js deleted file mode 100644 index ec5024f8ec..0000000000 --- a/Libraries/LibJS/Tests/invalid-lhs-in-assignment.js +++ /dev/null @@ -1,32 +0,0 @@ -test("assignment to function call", () => { - expect(() => { - function foo() {} - foo() = "foo"; - }).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"; - }).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment"); -}); - -test("assignment to invalid LHS is syntax error", () => { - expect("1 += 1").not.toEval(); - expect("1 -= 1").not.toEval(); - expect("1 *= 1").not.toEval(); - expect("1 /= 1").not.toEval(); - expect("1 %= 1").not.toEval(); - expect("1 **= 1").not.toEval(); - expect("1 &= 1").not.toEval(); - expect("1 |= 1").not.toEval(); - expect("1 ^= 1").not.toEval(); - expect("1 <<= 1").not.toEval(); - expect("1 >>= 1").not.toEval(); - expect("1 >>>= 1").not.toEval(); - expect("1 = 1").not.toEval(); -}); |