mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:07:44 +00:00
LibJS: Enable now working tests for duplicated variable declarations
This commit is contained in:
parent
a8930997f0
commit
10bf91a293
2 changed files with 24 additions and 6 deletions
|
@ -13,14 +13,14 @@ describe("duplicated variable declarations should throw", () => {
|
|||
expect("const b, a; var c, a;").not.toEval();
|
||||
});
|
||||
|
||||
test.skip("should fail to parse even if variable first declared with var", () => {
|
||||
expect.skip("var a; let a;").toEval();
|
||||
expect.skip("var a; let b, a;").toEval();
|
||||
expect.skip("var a; const a;").toEval();
|
||||
expect.skip("var a; const b, a;").toEval();
|
||||
test("should fail to parse even if variable first declared with var", () => {
|
||||
expect("var a; let a;").not.toEval();
|
||||
expect("var a; let b, a;").not.toEval();
|
||||
expect("var a; const a;").not.toEval();
|
||||
expect("var a; const b, a;").not.toEval();
|
||||
});
|
||||
|
||||
test.skip("special cases with for loops", () => {
|
||||
test("special cases with for loops", () => {
|
||||
expect("for (var a;;) { let a; }").toEval();
|
||||
expect("for (let a;;) { let a; }").toEval();
|
||||
expect("for (var a;;) { var a; }").toEval();
|
||||
|
|
|
@ -15,3 +15,21 @@ test("basic functionality", () => {
|
|||
}
|
||||
expect(caught_exception).not.toBeUndefined();
|
||||
});
|
||||
|
||||
test("Issue #8198 arrow function escapes function scope", () => {
|
||||
const b = 3;
|
||||
|
||||
function f() {
|
||||
expect(b).toBe(3);
|
||||
(() => {
|
||||
expect(b).toBe(3);
|
||||
var a = "wat";
|
||||
eval("var b=a;");
|
||||
expect(b).toBe("wat");
|
||||
})();
|
||||
expect(b).toBe(3);
|
||||
}
|
||||
|
||||
f();
|
||||
expect(b).toBe(3);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue