Просмотр исходного кода

LibJS: Fix variable scoping issues in two tests

Hendi 4 лет назад
Родитель
Сommit
793e1bf28a

+ 1 - 1
Userland/Libraries/LibJS/Tests/builtins/Array/Array.prototype.every.js

@@ -40,7 +40,7 @@ describe("normal behavior", () => {
         var array = [1, 2, 3, 4, 5];
 
         expect(
-            arrayTwo.every((value, index, arr) => {
+            array.every((value, index, arr) => {
                 arr.push(6);
                 return value <= 5;
             })

+ 1 - 1
Userland/Libraries/LibJS/Tests/operators/assignment-operators.js

@@ -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();