mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-27 18:40:00 +00:00
LibJS: Remove files from .prettierignore
.prettierignore had files listed for an issue with 'using' declarations, this is no longer an issue for prettier (tested on 3.6.2).
This commit is contained in:
parent
52009170da
commit
0eac4cc6ad
Notes:
github-actions[bot]
2025-10-09 19:53:12 +00:00
Author: https://github.com/adamrt
Commit: 0eac4cc6ad
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6383
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 33 additions and 19 deletions
|
|
@ -63,16 +63,16 @@ describe("basic usage", () => {
|
|||
[Symbol.dispose]() {
|
||||
expect(this.value).toBe(value);
|
||||
disposable.push(value);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
for (using a of [createDisposable('a'), createDisposable('b'), createDisposable('c')]) {
|
||||
for (using a of [createDisposable("a"), createDisposable("b"), createDisposable("c")]) {
|
||||
expect(disposable).toEqual(values);
|
||||
values.push(a.value);
|
||||
}
|
||||
|
||||
expect(disposable).toEqual(['a', 'b', 'c']);
|
||||
expect(disposable).toEqual(["a", "b", "c"]);
|
||||
});
|
||||
|
||||
test.xfail("using in for of loop with expression body", () => {
|
||||
|
|
@ -82,11 +82,12 @@ describe("basic usage", () => {
|
|||
const obj = {
|
||||
[Symbol.dispose]() {
|
||||
disposableCalls++;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
for (using a of [obj, obj, obj])
|
||||
for (using a of [obj, obj, obj]) {
|
||||
expect(disposableCalls).toBe(i++);
|
||||
}
|
||||
|
||||
expect(disposableCalls).toBe(3);
|
||||
});
|
||||
|
|
@ -96,12 +97,13 @@ describe("basic usage", () => {
|
|||
const a = {
|
||||
[Symbol.dispose]() {
|
||||
disposed++;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
expect(disposed).toBe(0);
|
||||
for (using b = a, c = a; false;)
|
||||
for (using b = a, c = a; false; ) {
|
||||
expect().fail();
|
||||
}
|
||||
|
||||
expect(disposed).toBe(2);
|
||||
});
|
||||
|
|
@ -126,7 +128,7 @@ describe("basic usage", () => {
|
|||
test.xfail("can have using in block in for-in loop", () => {
|
||||
const disposed = [];
|
||||
const values = [];
|
||||
for (const i in ['a', 'b', 'c']) {
|
||||
for (const i in ["a", "b", "c"]) {
|
||||
using a = {
|
||||
val: i,
|
||||
[Symbol.dispose]() {
|
||||
|
|
@ -145,14 +147,15 @@ describe("basic usage", () => {
|
|||
|
||||
const obj = {
|
||||
[Symbol.dispose]() {
|
||||
expect()
|
||||
expect();
|
||||
disposableCalls++;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
for (using a of [obj])
|
||||
for (using a of [obj]) {
|
||||
throw new ExpectationError("Expected in for-of");
|
||||
}
|
||||
|
||||
expect().fail("Should have thrown");
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue