Branch: refs/heads/lkgr
Commit: 672877606d657a8217bf2c6d4ed6cb8e14da699c
https://github.com/dart-lang/sdk/commit/672877606d657a8217bf2c6d4ed6cb8e14da699c
Author: Srujan Gaddam <
sru...@google.com>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
M pkg/linter/lib/src/rules/invalid_runtime_check_with_js_interop_types.dart
M pkg/linter/test/rules/invalid_runtime_check_with_js_interop_types_test.dart
Log Message:
-----------
[linter] Erase types to non-nullable and type bounds correctly
We used thisType in invalid_runtime_check_with_js_interop_types
to ignore nullability and generics when comparing two types for
checks and casts. This is erroneous when doing a subtype check
because the distinct instantiated type arguments in each type
will lead to the two types not being subtypes of each other.
When JSExportedDartFunction and JSFunction became generic, this
became an issue because now JSFunction<T> is not a supertype of
JSExportedDartFunction<T>.
So, instead, we should always initialize the params to their
bounds when comparing types if we want to ignore generics.
Change-Id: I8418d3b87123a658fbe8a0a9379f43cba738f063
Reviewed-on:
https://dart-review.googlesource.com/c/sdk/+/498241
Reviewed-by: Samuel Rawlins <
sraw...@google.com>
Reviewed-by: Konstantin Shcheglov <
sche...@google.com>
Commit: 94e12177746cb45954ff331c9684e8abdb1adeef
https://github.com/dart-lang/sdk/commit/94e12177746cb45954ff331c9684e8abdb1adeef
Author: Srujan Gaddam <
sru...@google.com>
Date: 2026-04-27 (Mon, 27 Apr 2026)
Changed paths:
M CHANGELOG.md
M pkg/_js_interop_checks/lib/src/transformations/js_util_optimizer.dart
M pkg/_js_interop_checks/lib/src/transformations/shared_interop_transformer.dart
M pkg/front_end/testcases/dart2js/js_interop_transforms/functiontojs.dart.strong.expect
M pkg/front_end/testcases/dart2js/js_interop_transforms/functiontojs.dart.strong.modular.expect
M pkg/front_end/testcases/dart2js/js_interop_transforms/functiontojs.dart.strong.transformed.expect
M pkg/front_end/testcases/dart2js/js_interop_transforms/isa.dart
M pkg/front_end/testcases/dart2js/js_interop_transforms/isa.dart.strong.expect
M pkg/front_end/testcases/dart2js/js_interop_transforms/isa.dart.strong.modular.expect
M pkg/front_end/testcases/dart2js/js_interop_transforms/isa.dart.strong.transformed.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/functiontojs.dart.strong.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/functiontojs.dart.strong.modular.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/functiontojs.dart.strong.transformed.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/isa.dart
M pkg/front_end/testcases/dartdevc/js_interop_transforms/isa.dart.strong.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/isa.dart.strong.modular.expect
M pkg/front_end/testcases/dartdevc/js_interop_transforms/isa.dart.strong.transformed.expect
M sdk/lib/_internal/js_dev_runtime/patch/js_allow_interop_patch.dart
M sdk/lib/_internal/js_dev_runtime/private/interceptors.dart
M sdk/lib/_internal/js_runtime/lib/interceptors.dart
M sdk/lib/_internal/js_runtime/lib/js_allow_interop_patch.dart
M sdk/lib/_internal/js_shared/lib/js_interop_patch.dart
M sdk/lib/_internal/wasm/lib/js_interop_patch.dart
M sdk/lib/js_interop/js_interop.dart
M tests/lib/js/static_interop_test/external_dart_reference_test.dart
M tests/lib/js/static_interop_test/isa/isa_test.dart
M tests/lib/js/static_interop_test/js_types_static_errors_test.dart
M tests/lib/js/static_interop_test/js_types_test.dart
Log Message:
-----------
Reland "[dart:js_interop] Make JSFunction and JSExportedDartFunction generic"
This is a reland of commit e7dbd6ba4866af42b917da42433cc651afd650b8
Original change's description:
> [dart:js_interop] Make JSFunction and JSExportedDartFunction generic
>
> Fixes
https://github.com/dart-lang/sdk/issues/54557
>
> The generic type in JSExportedDartFunction corresponds to the
> static type of the function it wrapped, whereas for JSFunction,
> it's purely a descriptor of the JS function.
>
> When calling JSExportedDartFunction, a cast is now introduced
> to cast it to T.
>
> When calling isA, the type in JSExportedDartFunction is passed
> along to check that the value that is wrapped is that function
> type. Because the T in JSFunction is descriptive, e.g.
> isA<JSFunction<int Function()>>() does no such check.
>
> ____
>
> Also cleans up:
>
> - isA<JSTypedArray>() logic to use intrinsic functions
> - some expectation files to be consistent for both dart2js and ddc.
>
> CoreLibraryReviewExempt: Backend-specific library with needed reviews.
> Change-Id: I1a55c4386e416fa4ccabe06ac5051f41c2e2e95a
> Reviewed-on:
https://dart-review.googlesource.com/c/sdk/+/496820
> Reviewed-by: Lasse Nielsen <
l...@google.com>
> Commit-Queue: Srujan Gaddam <
sru...@google.com>
> Reviewed-by: Martin Kustermann <
kuste...@google.com>
CoreLibraryReviewExempt: Reland.
Change-Id: I29d706aa4967fd80390e8cb37f8144603ec007f5
Reviewed-on:
https://dart-review.googlesource.com/c/sdk/+/498100
Commit-Queue: Srujan Gaddam <
sru...@google.com>
Reviewed-by: Martin Kustermann <
kuste...@google.com>
Compare:
https://github.com/dart-lang/sdk/compare/13909c16eb8f...94e12177746c