LibJS: Remove bytecode condition from tests expected to fail

This commit is contained in:
Timothy Flynn 2023-08-09 15:14:05 -04:00 committed by Luke Wilde
parent 854330ec73
commit 375a6f5dd9
Notes: sideshowbarker 2024-07-17 05:02:35 +09:00
17 changed files with 143 additions and 186 deletions

View file

@ -7,7 +7,7 @@ test("is the same as dispose", () => {
}); });
describe("used in using functionality", () => { describe("used in using functionality", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "make the stack marked as disposed", () => { test.xfail("make the stack marked as disposed", () => {
let innerStack; let innerStack;
{ {
using stack = new DisposableStack(); using stack = new DisposableStack();

View file

@ -3,7 +3,7 @@ const stackGetter = stackDescriptor.get;
const stackSetter = stackDescriptor.set; const stackSetter = stackDescriptor.set;
describe("getter - normal behavior", () => { describe("getter - normal behavior", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "basic functionality", () => { test.xfail("basic functionality", () => {
const stackFrames = [ const stackFrames = [
/^ at .*Error \(.*\/Error\.prototype\.stack\.js:\d+:\d+\)$/, /^ at .*Error \(.*\/Error\.prototype\.stack\.js:\d+:\d+\)$/,
/^ at .+\/Error\/Error\.prototype\.stack\.js:\d+:\d+$/, /^ at .+\/Error\/Error\.prototype\.stack\.js:\d+:\d+$/,

View file

@ -8,7 +8,7 @@ function registerInDifferentScope(registry) {
return target; return target;
} }
test.xfailIf(isBytecodeInterpreterEnabled(), "basic functionality", () => { test.xfail("basic functionality", () => {
var registry = new FinalizationRegistry(() => {}); var registry = new FinalizationRegistry(() => {});
var count = 0; var count = 0;

View file

@ -40,7 +40,7 @@ describe("normal behavior", () => {
expect(passed).toBeTrue(); expect(passed).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "value from async module", () => { test.xfail("value from async module", () => {
const shadowRealm = new ShadowRealm(); const shadowRealm = new ShadowRealm();
const promise = shadowRealm.importValue("./async-module.mjs", "foo"); const promise = shadowRealm.importValue("./async-module.mjs", "foo");
expect(promise).toBeInstanceOf(Promise); expect(promise).toBeInstanceOf(Promise);

View file

@ -21,29 +21,25 @@ test("invalid values", () => {
}); });
}); });
test.xfailIf( test.xfail("automatic removal of garbage-collected values", () => {
isBytecodeInterpreterEnabled(), const weakMap = new WeakMap();
"automatic removal of garbage-collected values", const objectKey = { e: 3 };
() => {
const weakMap = new WeakMap();
const objectKey = { e: 3 };
expect(weakMap.set(objectKey, 1)).toBe(weakMap); expect(weakMap.set(objectKey, 1)).toBe(weakMap);
expect(getWeakMapSize(weakMap)).toBe(1); expect(getWeakMapSize(weakMap)).toBe(1);
markAsGarbage("objectKey"); markAsGarbage("objectKey");
gc(); gc();
expect(getWeakMapSize(weakMap)).toBe(0); expect(getWeakMapSize(weakMap)).toBe(0);
const symbolKey = Symbol("foo"); const symbolKey = Symbol("foo");
expect(weakMap.set(symbolKey, "bar")).toBe(weakMap); expect(weakMap.set(symbolKey, "bar")).toBe(weakMap);
expect(getWeakMapSize(weakMap)).toBe(1); expect(getWeakMapSize(weakMap)).toBe(1);
markAsGarbage("symbolKey"); markAsGarbage("symbolKey");
gc(); gc();
expect(getWeakMapSize(weakMap)).toBe(0); expect(getWeakMapSize(weakMap)).toBe(0);
} });
);

View file

@ -16,29 +16,25 @@ test("invalid values", () => {
}); });
}); });
test.xfailIf( test.xfail("automatic removal of garbage-collected values", () => {
isBytecodeInterpreterEnabled(), const weakSet = new WeakSet();
"automatic removal of garbage-collected values", const objectItem = { a: 1 };
() => {
const weakSet = new WeakSet();
const objectItem = { a: 1 };
expect(weakSet.add(objectItem)).toBe(weakSet); expect(weakSet.add(objectItem)).toBe(weakSet);
expect(getWeakSetSize(weakSet)).toBe(1); expect(getWeakSetSize(weakSet)).toBe(1);
markAsGarbage("objectItem"); markAsGarbage("objectItem");
gc(); gc();
expect(getWeakSetSize(weakSet)).toBe(0); expect(getWeakSetSize(weakSet)).toBe(0);
const symbolItem = Symbol("foo"); const symbolItem = Symbol("foo");
expect(weakSet.add(symbolItem)).toBe(weakSet); expect(weakSet.add(symbolItem)).toBe(weakSet);
expect(getWeakSetSize(weakSet)).toBe(1); expect(getWeakSetSize(weakSet)).toBe(1);
markAsGarbage("symbolItem"); markAsGarbage("symbolItem");
gc(); gc();
expect(getWeakSetSize(weakSet)).toBe(0); expect(getWeakSetSize(weakSet)).toBe(0);
} });
);

View file

@ -1,4 +1,4 @@
test.xfailIf(isBytecodeInterpreterEnabled(), "assignment to function call", () => { test.xfail("assignment to function call", () => {
expect(() => { expect(() => {
function foo() {} function foo() {}
foo() = "foo"; foo() = "foo";
@ -9,7 +9,7 @@ test("assignment to function call in strict mode", () => {
expect("'use strict'; foo() = 'foo'").toEval(); expect("'use strict'; foo() = 'foo'").toEval();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "assignment to inline function call", () => { test.xfail("assignment to inline function call", () => {
expect(() => { expect(() => {
(function () {})() = "foo"; (function () {})() = "foo";
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment"); }).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");

View file

@ -86,39 +86,28 @@ describe("special left hand sides", () => {
expect(b.a).toBe("2"); expect(b.a).toBe("2");
}); });
test.xfailIf( test.xfail("call function is allowed in parsing but fails in runtime", () => {
isBytecodeInterpreterEnabled(), function f() {
"call function is allowed in parsing but fails in runtime", expect().fail();
() => {
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.xfailIf( // Does not fail since it does not iterate
isBytecodeInterpreterEnabled(), expect("for (f() in []);").toEvalTo(undefined);
"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"]); 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", () => { test("remove properties while iterating", () => {

View file

@ -130,37 +130,26 @@ describe("special left hand sides", () => {
expect(f().a).toBe("c"); expect(f().a).toBe("c");
}); });
test.xfailIf( test.xfail("call function is allowed in parsing but fails in runtime", () => {
isBytecodeInterpreterEnabled(), function f() {
"call function is allowed in parsing but fails in runtime", expect().fail();
() => {
function f() {
expect().fail();
}
// Does not fail since it does not iterate but prettier does not like it so we use eval.
expect("for (f() of []);").toEvalTo(undefined);
expect(() => {
eval("for (f() of [0]) { expect().fail() }");
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
} }
);
test.xfailIf( // Does not fail since it does not iterate but prettier does not like it so we use eval.
isBytecodeInterpreterEnabled(), expect("for (f() of []);").toEvalTo(undefined);
"Cannot change constant declaration in body",
() => {
const vals = [];
for (const v of [1, 2]) {
expect(() => v++).toThrowWithMessage(
TypeError,
"Invalid assignment to const variable"
);
vals.push(v);
}
expect(vals).toEqual([1, 2]); expect(() => {
eval("for (f() of [0]) { expect().fail() }");
}).toThrowWithMessage(ReferenceError, "Invalid left-hand side in assignment");
});
test.xfail("Cannot change constant declaration in body", () => {
const vals = [];
for (const v of [1, 2]) {
expect(() => v++).toThrowWithMessage(TypeError, "Invalid assignment to const variable");
vals.push(v);
} }
);
expect(vals).toEqual([1, 2]);
});
}); });

View file

@ -207,8 +207,7 @@ describe("in- and exports", () => {
expectModulePassed("./anon-func-decl-default-export.mjs"); expectModulePassed("./anon-func-decl-default-export.mjs");
}); });
test.xfailIf( test.xfail(
isBytecodeInterpreterEnabled(),
"can have top level using declarations which trigger at the end of running a module", "can have top level using declarations which trigger at the end of running a module",
() => { () => {
expectModulePassed("./top-level-dispose.mjs"); expectModulePassed("./top-level-dispose.mjs");

View file

@ -221,13 +221,13 @@ describe("naming of anon functions", () => {
expect({ func() {} }.func.name).toBe("func"); expect({ func() {} }.func.name).toBe("func");
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "getter has name", () => { test.xfail("getter has name", () => {
expect(Object.getOwnPropertyDescriptor({ get func() {} }, "func").get.name).toBe( expect(Object.getOwnPropertyDescriptor({ get func() {} }, "func").get.name).toBe(
"get func" "get func"
); );
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "setter has name", () => { test.xfail("setter has name", () => {
expect(Object.getOwnPropertyDescriptor({ set func(v) {} }, "func").set.name).toBe( expect(Object.getOwnPropertyDescriptor({ set func(v) {} }, "func").set.name).toBe(
"set func" "set func"
); );

View file

@ -144,7 +144,7 @@ describe("modification of spreadable objects during spread", () => {
expect(Object.getOwnPropertyNames(result)).toContain("bar"); expect(Object.getOwnPropertyNames(result)).toContain("bar");
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "spreading array", () => { test.xfail("spreading array", () => {
const array = [0]; const array = [0];
array[2] = 2; array[2] = 2;
array[999] = 999; array[999] = 999;

View file

@ -1,6 +1,6 @@
"use strict"; "use strict";
test.xfailIf(isBytecodeInterpreterEnabled(), "basic functionality", () => { test.xfail("basic functionality", () => {
[true, false, "foo", 123].forEach(primitive => { [true, false, "foo", 123].forEach(primitive => {
expect(() => { expect(() => {
primitive.foo = "bar"; primitive.foo = "bar";

View file

@ -64,7 +64,7 @@ test("async function cannot use await in default parameters", () => {
// Even as a reference to some variable it is not allowed // Even as a reference to some variable it is not allowed
expect(` expect(`
var await = 4; var await = 4;
async function foo(x = await) {} async function foo(x = await) {}
`).not.toEval(); `).not.toEval();
}); });
@ -216,55 +216,43 @@ describe("await thenables", () => {
expect(isCalled).toBe(true); expect(isCalled).toBe(true);
}); });
test.xfailIf( test.xfail("async returning a thanable variable that fulfills", () => {
isBytecodeInterpreterEnabled(), let isCalled = false;
"async returning a thanable variable that fulfills", const obj = {
() => { then(fulfill) {
let isCalled = false; isCalled = true;
const obj = { fulfill(isCalled);
then(fulfill) { },
isCalled = true; };
fulfill(isCalled);
},
};
const f = async () => await obj; const f = async () => await obj;
f(); f();
runQueuedPromiseJobs(); runQueuedPromiseJobs();
expect(isCalled).toBe(true); expect(isCalled).toBe(true);
} });
);
test.xfailIf( test.xfail("async returning a thenable directly without fulfilling", () => {
isBytecodeInterpreterEnabled(), let isCalled = false;
"async returning a thenable directly without fulfilling", const f = async () => ({
() => { then() {
let isCalled = false; isCalled = true;
const f = async () => ({ },
then() { });
isCalled = true; f();
}, runQueuedPromiseJobs();
}); expect(isCalled).toBe(true);
f(); });
runQueuedPromiseJobs();
expect(isCalled).toBe(true);
}
);
test.xfailIf( test.xfail("async returning a thenable directly that fulfills", () => {
isBytecodeInterpreterEnabled(), let isCalled = false;
"async returning a thenable directly that fulfills", const f = async () => ({
() => { then(fulfill) {
let isCalled = false; isCalled = true;
const f = async () => ({ fulfill(isCalled);
then(fulfill) { },
isCalled = true; });
fulfill(isCalled); f();
}, runQueuedPromiseJobs();
}); expect(isCalled).toBe(true);
f(); });
runQueuedPromiseJobs();
expect(isCalled).toBe(true);
}
);
}); });

View file

@ -154,7 +154,7 @@ describe("tagged template literal functionality", () => {
expect(stringsValue.raw[1]).toBe("invalid\\u"); expect(stringsValue.raw[1]).toBe("invalid\\u");
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "string value gets cached per AST node", () => { test.xfail("string value gets cached per AST node", () => {
function call(func, val) { function call(func, val) {
return func`template${val}second`; return func`template${val}second`;
} }
@ -164,7 +164,7 @@ describe("tagged template literal functionality", () => {
expect(firstResult).toBe(secondResult); expect(firstResult).toBe(secondResult);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "this value of call comes from reference", () => { test.xfail("this value of call comes from reference", () => {
let thisValue = null; let thisValue = null;
const obj = { const obj = {
func() { func() {

View file

@ -1,5 +1,5 @@
describe("basic usage", () => { describe("basic usage", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "disposes after block exit", () => { test.xfail("disposes after block exit", () => {
let disposed = false; let disposed = false;
let inBlock = false; let inBlock = false;
{ {
@ -13,7 +13,7 @@ describe("basic usage", () => {
expect(disposed).toBeTrue(); expect(disposed).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "disposes in reverse order after block exit", () => { test.xfail("disposes in reverse order after block exit", () => {
const disposed = []; const disposed = [];
{ {
expect(disposed).toHaveLength(0); expect(disposed).toHaveLength(0);
@ -25,7 +25,7 @@ describe("basic usage", () => {
expect(disposed).toEqual(['b', 'a']); expect(disposed).toEqual(['b', 'a']);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "disposes in reverse order after block exit even in same declaration", () => { test.xfail("disposes in reverse order after block exit even in same declaration", () => {
const disposed = []; const disposed = [];
{ {
expect(disposed).toHaveLength(0); expect(disposed).toHaveLength(0);
@ -41,7 +41,7 @@ describe("basic usage", () => {
describe("behavior with exceptions", () => { describe("behavior with exceptions", () => {
function ExpectedError(name) { this.name = name; } function ExpectedError(name) { this.name = name; }
test.xfailIf(isBytecodeInterpreterEnabled(), "is run even after throw", () => { test.xfail("is run even after throw", () => {
let disposed = false; let disposed = false;
let inBlock = false; let inBlock = false;
let inCatch = false; let inCatch = false;
@ -62,7 +62,7 @@ describe("behavior with exceptions", () => {
expect(inCatch).toBeTrue(); expect(inCatch).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "throws error if dispose method does", () => { test.xfail("throws error if dispose method does", () => {
let disposed = false; let disposed = false;
let endOfTry = false; let endOfTry = false;
let inCatch = false; let inCatch = false;
@ -84,7 +84,7 @@ describe("behavior with exceptions", () => {
expect(inCatch).toBeTrue(); expect(inCatch).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "if block and using throw get suppressed error", () => { test.xfail("if block and using throw get suppressed error", () => {
let disposed = false; let disposed = false;
let inCatch = false; let inCatch = false;
try { try {
@ -108,7 +108,7 @@ describe("behavior with exceptions", () => {
expect(inCatch).toBeTrue(); expect(inCatch).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "multiple throwing disposes give suppressed error", () => { test.xfail("multiple throwing disposes give suppressed error", () => {
let inCatch = false; let inCatch = false;
try { try {
{ {
@ -133,7 +133,7 @@ describe("behavior with exceptions", () => {
expect(inCatch).toBeTrue(); expect(inCatch).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "3 throwing disposes give chaining suppressed error", () => { test.xfail("3 throwing disposes give chaining suppressed error", () => {
let inCatch = false; let inCatch = false;
try { try {
{ {
@ -168,7 +168,7 @@ describe("behavior with exceptions", () => {
expect(inCatch).toBeTrue(); expect(inCatch).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "normal error and multiple disposing erorrs give chaining suppressed errors", () => { test.xfail("normal error and multiple disposing erorrs give chaining suppressed errors", () => {
let inCatch = false; let inCatch = false;
try { try {
using a = { [Symbol.dispose]() { using a = { [Symbol.dispose]() {
@ -199,7 +199,7 @@ describe("behavior with exceptions", () => {
}); });
describe("works in a bunch of scopes", () => { describe("works in a bunch of scopes", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "works in block", () => { test.xfail("works in block", () => {
let dispose = false; let dispose = false;
expect(dispose).toBeFalse(); expect(dispose).toBeFalse();
{ {
@ -210,7 +210,7 @@ describe("works in a bunch of scopes", () => {
expect(dispose).toBeTrue(); expect(dispose).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "works in static class block", () => { test.xfail("works in static class block", () => {
let dispose = false; let dispose = false;
expect(dispose).toBeFalse(); expect(dispose).toBeFalse();
class A { class A {
@ -223,7 +223,7 @@ describe("works in a bunch of scopes", () => {
expect(dispose).toBeTrue(); expect(dispose).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "works in function", () => { test.xfail("works in function", () => {
let dispose = []; let dispose = [];
function f(val) { function f(val) {
const disposeLength = dispose.length; const disposeLength = dispose.length;
@ -237,7 +237,7 @@ describe("works in a bunch of scopes", () => {
expect(dispose).toEqual([0, 1]); expect(dispose).toEqual([0, 1]);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "switch block is treated as full block in function", () => { test.xfail("switch block is treated as full block in function", () => {
let disposeFull = []; let disposeFull = [];
let disposeInner = false; let disposeInner = false;
@ -284,13 +284,13 @@ describe("works in a bunch of scopes", () => {
}); });
describe("invalid using bindings", () => { describe("invalid using bindings", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "nullish values do not throw", () => { test.xfail("nullish values do not throw", () => {
using a = null, b = undefined; using a = null, b = undefined;
expect(a).toBeNull(); expect(a).toBeNull();
expect(b).toBeUndefined(); expect(b).toBeUndefined();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "non-object throws", () => { test.xfail("non-object throws", () => {
[0, "a", true, NaN, 4n, Symbol.dispose].forEach(value => { [0, "a", true, NaN, 4n, Symbol.dispose].forEach(value => {
expect(() => { expect(() => {
using v = value; using v = value;
@ -298,13 +298,13 @@ describe("invalid using bindings", () => {
}); });
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "object without dispose throws", () => { test.xfail("object without dispose throws", () => {
expect(() => { expect(() => {
using a = {}; using a = {};
}).toThrowWithMessage(TypeError, "does not have dispose method"); }).toThrowWithMessage(TypeError, "does not have dispose method");
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "object with non callable dispose throws", () => { test.xfail("object with non callable dispose throws", () => {
[0, "a", true, NaN, 4n, Symbol.dispose, [], {}].forEach(value => { [0, "a", true, NaN, 4n, Symbol.dispose, [], {}].forEach(value => {
expect(() => { expect(() => {
using a = { [Symbol.dispose]: value }; using a = { [Symbol.dispose]: value };
@ -332,7 +332,7 @@ describe("using is still a valid variable name", () => {
expect(using).toBe(1); expect(using).toBe(1);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "using", () => { test.xfail("using", () => {
"use strict"; "use strict";
using using = null; using using = null;
expect(using).toBeNull(); expect(using).toBeNull();

View file

@ -1,5 +1,5 @@
describe("basic usage", () => { describe("basic usage", () => {
test.xfailIf(isBytecodeInterpreterEnabled(), "using in normal for loop", () => { test.xfail("using in normal for loop", () => {
let isDisposed = false; let isDisposed = false;
let lastI = -1; let lastI = -1;
for ( for (
@ -27,7 +27,7 @@ describe("basic usage", () => {
expect(lastI).toBe(2); expect(lastI).toBe(2);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "using in normal for loop with expression body", () => { test.xfail("using in normal for loop with expression body", () => {
let isDisposed = false; let isDisposed = false;
let outerI = 0; let outerI = 0;
for ( for (
@ -53,7 +53,7 @@ describe("basic usage", () => {
expect(outerI).toBe(3); expect(outerI).toBe(3);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "using in for of loop", () => { test.xfail("using in for of loop", () => {
const disposable = []; const disposable = [];
const values = []; const values = [];
@ -75,7 +75,7 @@ describe("basic usage", () => {
expect(disposable).toEqual(['a', 'b', 'c']); expect(disposable).toEqual(['a', 'b', 'c']);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "using in for of loop with expression body", () => { test.xfail("using in for of loop with expression body", () => {
let disposableCalls = 0; let disposableCalls = 0;
let i = 0; let i = 0;
@ -91,7 +91,7 @@ describe("basic usage", () => {
expect(disposableCalls).toBe(3); expect(disposableCalls).toBe(3);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "can have multiple declaration in normal for loop", () => { test.xfail("can have multiple declaration in normal for loop", () => {
let disposed = 0; let disposed = 0;
const a = { const a = {
[Symbol.dispose]() { [Symbol.dispose]() {
@ -106,7 +106,7 @@ describe("basic usage", () => {
expect(disposed).toBe(2); expect(disposed).toBe(2);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "can have using in block in for loop", () => { test.xfail("can have using in block in for loop", () => {
const disposed = []; const disposed = [];
const values = []; const values = [];
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
@ -123,7 +123,7 @@ describe("basic usage", () => {
expect(disposed).toEqual([0, 1, 2]); expect(disposed).toEqual([0, 1, 2]);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "can have using in block in for-in loop", () => { test.xfail("can have using in block in for-in loop", () => {
const disposed = []; const disposed = [];
const values = []; const values = [];
for (const i in ['a', 'b', 'c']) { for (const i in ['a', 'b', 'c']) {
@ -140,7 +140,7 @@ describe("basic usage", () => {
expect(disposed).toEqual(["0", "1", "2"]); expect(disposed).toEqual(["0", "1", "2"]);
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "dispose is called even if throw in for of loop", () => { test.xfail("dispose is called even if throw in for of loop", () => {
let disposableCalls = 0; let disposableCalls = 0;
const obj = { const obj = {
@ -209,7 +209,7 @@ describe("using is still a valid variable in loops", () => {
expect(enteredLoop).toBeTrue(); expect(enteredLoop).toBeTrue();
}); });
test.xfailIf(isBytecodeInterpreterEnabled(), "using using of", () => { test.xfail("using using of", () => {
let enteredLoop = false; let enteredLoop = false;
for (using using of [null]) { for (using using of [null]) {
enteredLoop = true; enteredLoop = true;