mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibJS: Remove bytecode condition from tests expected to fail
This commit is contained in:
parent
854330ec73
commit
375a6f5dd9
17 changed files with 143 additions and 186 deletions
|
@ -86,39 +86,28 @@ describe("special left hand sides", () => {
|
|||
expect(b.a).toBe("2");
|
||||
});
|
||||
|
||||
test.xfailIf(
|
||||
isBytecodeInterpreterEnabled(),
|
||||
"call function is allowed in parsing but fails in runtime",
|
||||
() => {
|
||||
function f() {
|
||||
expect().fail();
|
||||
}
|
||||
|
||||
// Does not fail since it does not iterate
|
||||
expect("for (f() in []);").toEvalTo(undefined);
|
||||
|
||||
expect(() => {
|
||||
eval("for (f() in [0]) { expect().fail() }");
|
||||
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
|
||||
test.xfail("call function is allowed in parsing but fails in runtime", () => {
|
||||
function f() {
|
||||
expect().fail();
|
||||
}
|
||||
);
|
||||
|
||||
test.xfailIf(
|
||||
isBytecodeInterpreterEnabled(),
|
||||
"Cannot change constant declaration in body",
|
||||
() => {
|
||||
const vals = [];
|
||||
for (const v in [1, 2]) {
|
||||
expect(() => v++).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Invalid assignment to const variable"
|
||||
);
|
||||
vals.push(v);
|
||||
}
|
||||
// Does not fail since it does not iterate
|
||||
expect("for (f() in []);").toEvalTo(undefined);
|
||||
|
||||
expect(vals).toEqual(["0", "1"]);
|
||||
expect(() => {
|
||||
eval("for (f() in [0]) { expect().fail() }");
|
||||
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
|
||||
});
|
||||
|
||||
test.xfail("Cannot change constant declaration in body", () => {
|
||||
const vals = [];
|
||||
for (const v in [1, 2]) {
|
||||
expect(() => v++).toThrowWithMessage(TypeError, "Invalid assignment to const variable");
|
||||
vals.push(v);
|
||||
}
|
||||
);
|
||||
|
||||
expect(vals).toEqual(["0", "1"]);
|
||||
});
|
||||
});
|
||||
|
||||
test("remove properties while iterating", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue