mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 17:47:43 +00:00
LibJS: Fix variable scoping issues in two tests
This commit is contained in:
parent
38fd980b0c
commit
793e1bf28a
2 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ describe("normal behavior", () => {
|
||||||
var array = [1, 2, 3, 4, 5];
|
var array = [1, 2, 3, 4, 5];
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
arrayTwo.every((value, index, arr) => {
|
array.every((value, index, arr) => {
|
||||||
arr.push(6);
|
arr.push(6);
|
||||||
return value <= 5;
|
return value <= 5;
|
||||||
})
|
})
|
||||||
|
|
|
@ -127,7 +127,7 @@ test("evaluation order", () => {
|
||||||
b.hasBeenCalled = false;
|
b.hasBeenCalled = false;
|
||||||
c.hasBeenCalled = false;
|
c.hasBeenCalled = false;
|
||||||
expect(() => {
|
expect(() => {
|
||||||
new Function(`a[b()] ${op} c()`)();
|
new Function("a", "b", "c", "op", `a[b()] ${op} c()`)(a, b, c, op);
|
||||||
}).toThrow(Error);
|
}).toThrow(Error);
|
||||||
expect(b.hasBeenCalled).toBeTrue();
|
expect(b.hasBeenCalled).toBeTrue();
|
||||||
expect(c.hasBeenCalled).toBeFalse();
|
expect(c.hasBeenCalled).toBeFalse();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue