mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
LibJS: Remove using-declaration.js from .prettierignore
Some checks failed
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Nightly Lagom / Flatpak aarch64 (push) Has been cancelled
Nightly Lagom / Flatpak x86_64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Close stale PRs / stale (push) Has been cancelled
Some checks failed
Nightly Lagom / Linux, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Distribution, Clang (push) Has been cancelled
Nightly Lagom / Linux, arm64, Sanitizer, Clang (push) Has been cancelled
Nightly Lagom / macOS, arm64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Distribution, GNU (push) Has been cancelled
Nightly Lagom / Linux, x86_64, Sanitizer, Swift (push) Has been cancelled
Nightly Lagom / Windows, x86_64, Windows_Sanitizer_CI, ClangCL (push) Has been cancelled
Nightly Lagom / Flatpak aarch64 (push) Has been cancelled
Nightly Lagom / Flatpak x86_64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Close stale PRs / stale (push) Has been cancelled
This is the second and final commit to remove using-declaration from .prettierignore. While there is standard formatting changes here, there is also scoping changes for the 'using' declarations due to the following error: Libraries/LibJS/Tests/using-declaration.js: SyntaxError: Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.
This commit is contained in:
committed by
Tim Flynn
parent
052013f8e6
commit
120bba597d
Notes:
github-actions[bot]
2025-10-09 19:52:57 +00:00
Author: https://github.com/adamrt Commit: https://github.com/LadybirdBrowser/ladybird/commit/120bba597de Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6383 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/trflynn89 ✅
@@ -2,9 +2,6 @@ Libraries/LibJS/Tests/invalid-lhs-in-assignment.js
|
|||||||
Libraries/LibJS/Tests/unicode-identifier-escape.js
|
Libraries/LibJS/Tests/unicode-identifier-escape.js
|
||||||
Libraries/LibJS/Tests/modules/failing.mjs
|
Libraries/LibJS/Tests/modules/failing.mjs
|
||||||
|
|
||||||
# FIXME: Remove once prettier is updated to support using declarations.
|
|
||||||
Libraries/LibJS/Tests/using-declaration.js
|
|
||||||
|
|
||||||
Tests/LibWeb/Crash/wpt-import/
|
Tests/LibWeb/Crash/wpt-import/
|
||||||
Tests/LibWeb/Ref/input/wpt-import
|
Tests/LibWeb/Ref/input/wpt-import
|
||||||
Tests/LibWeb/Text/input/wpt-import
|
Tests/LibWeb/Text/input/wpt-import
|
||||||
|
|||||||
@@ -307,9 +307,14 @@ describe("works in a bunch of scopes", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (2) {
|
switch (2) {
|
||||||
case 3:
|
case 3: {
|
||||||
using notDisposed = { [Symbol.dispose]() { expect().fail("not-disposed 1"); } };
|
using notDisposed = {
|
||||||
case 2:
|
[Symbol.dispose]() {
|
||||||
|
expect().fail("not-disposed 1");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
expect(disposeFull).toEqual([]);
|
expect(disposeFull).toEqual([]);
|
||||||
using a = pusher("a");
|
using a = pusher("a");
|
||||||
expect(disposeFull).toEqual([]);
|
expect(disposeFull).toEqual([]);
|
||||||
@@ -318,22 +323,35 @@ describe("works in a bunch of scopes", () => {
|
|||||||
expect(disposeFull).toEqual([]);
|
expect(disposeFull).toEqual([]);
|
||||||
expect(b.val).toBe("b");
|
expect(b.val).toBe("b");
|
||||||
|
|
||||||
expect(disposeInner).toBeFalse();
|
|
||||||
// fallthrough
|
|
||||||
case 1: {
|
|
||||||
expect(disposeFull).toEqual([]);
|
|
||||||
expect(disposeInner).toBeFalse();
|
|
||||||
|
|
||||||
using inner = { [Symbol.dispose]() { disposeInner = true; } }
|
|
||||||
|
|
||||||
expect(disposeInner).toBeFalse();
|
expect(disposeInner).toBeFalse();
|
||||||
}
|
}
|
||||||
|
// fallthrough
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
expect(disposeFull).toEqual([]);
|
||||||
|
expect(disposeInner).toBeFalse();
|
||||||
|
|
||||||
|
using inner = {
|
||||||
|
[Symbol.dispose]() {
|
||||||
|
disposeInner = true;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(disposeInner).toBeFalse();
|
||||||
|
}
|
||||||
expect(disposeInner).toBeTrue();
|
expect(disposeInner).toBeTrue();
|
||||||
using c = pusher("c");
|
{
|
||||||
expect(c.val).toBe("c");
|
using c = pusher("c");
|
||||||
|
expect(c.val).toBe("c");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0: {
|
||||||
using notDisposed2 = { [Symbol.dispose]() { expect().fail("not-disposed 2"); } };
|
using notDisposed2 = {
|
||||||
|
[Symbol.dispose]() {
|
||||||
|
expect().fail("not-disposed 2");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(disposeInner).toBeTrue();
|
expect(disposeInner).toBeTrue();
|
||||||
|
|||||||
Reference in New Issue
Block a user