1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibJS: Fix variable scoping issues in two tests

This commit is contained in:
Hendi 2021-07-04 03:20:57 +02:00 committed by Linus Groh
parent 38fd980b0c
commit 793e1bf28a
2 changed files with 2 additions and 2 deletions

View file

@ -127,7 +127,7 @@ test("evaluation order", () => {
b.hasBeenCalled = false;
c.hasBeenCalled = false;
expect(() => {
new Function(`a[b()] ${op} c()`)();
new Function("a", "b", "c", "op", `a[b()] ${op} c()`)(a, b, c, op);
}).toThrow(Error);
expect(b.hasBeenCalled).toBeTrue();
expect(c.hasBeenCalled).toBeFalse();