Skip to content

Commit 484c0b8

Browse files
fishythefishCommit Queue
authored andcommitted
dart.library.js_util -> dart.library.js_interop for web detection
dart2wasm will no longer support `dart:js_util`, so `dart.library.js_util` will be insufficient for detecting web backends. `dart:js_interop` is intended to replace it for the foreseeable future, so until we have an environment variable that more directly reflects whether the code is compiled with a web backend, we can use `dart.library.js_interop`. Other mentions of `dart.library.js_util` in tests are benign and aren't designed to detect all web backends specifically. Bug: #61550 Change-Id: I6a6a69644c3614b3693ad72b546e111217575bfb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451547 Commit-Queue: Mayank Patke <fishythefish@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
1 parent 5f0fc5c commit 484c0b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ f<U>() => A<U>();
285285

286286
void test_true_argument_list_nonBool() async {
287287
await resolve('''
288-
const bool kIsWeb = bool.fromEnvironment('dart.library.js_util');
288+
const bool kIsWeb = bool.fromEnvironment('dart.library.js_interop');
289289
class A {
290290
const A(List<int> l);
291291
}

tests/language/library/env_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ main() {
3737
const bool.fromEnvironment("dart.library.web_gl"),
3838
);
3939

40-
// All web backends support `dart:js_util`
40+
// All web backends support `dart:js_interop`
4141
Expect.equals(
4242
isWebConfiguration,
43-
const bool.fromEnvironment("dart.library.js_util"),
43+
const bool.fromEnvironment("dart.library.js_interop"),
4444
);
4545

4646
// Web platforms override 'dart.library.io' to return "false".

0 commit comments

Comments
 (0)