Files
sdk/pkg/compiler/lib
Nate Biggs a93219a4e1 [dart2js] Generate empty method bodies for external effect members.
The new @pragma('external-effect') causes the removal of invocations, including arguments, of any annotated member. This means the codegen builder shouldn't see any calls to these methods.

In a normal dart2js compilation this would mean we don't try to build bodies for the members. However, when running codegen in sharded mode, we have to be more conservative and assume another shard may need the member. Therefore one shard will still try to generate these methods.

We can just emit an empty member as the linker will exclude the unused method from the final JS code.

Change-Id: I28a82267f692f6a4921fe3b5207a7284f3fc8e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500001
Reviewed-by: Stephen Adams <sra@google.com>
2026-05-04 09:31:30 -07:00
..