Skip to content

[CP] Check dart:ffi imports and wasm:import/export pragmas in user code #55890

@osa1

Description

@osa1

Commit(s) to merge

dbcf23a
35bc17a

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/369040

Issue Description

dart2wasm currently allows importing dart:ffi (to use @Native) and using wasm:import and wasm:export pragmas.

However none of these were designed for end users. We have no documentation on how to properly use them, and they can cause compile time or runtime crashes.

What is the fix

Disallow importing dart:ffi and using wasm:import and wasm:export pragmas.

Why cherry-pick

These features were never intended for users. They will cause confusion.

Risk

None, however we should make sure the checks allow uses of these features in Flutter.

Issue link(s)

#55744

Extra Info

No response

Metadata

Metadata

Labels

area-dart2wasmIssues for the dart2wasm compiler.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-reviewIssue that need cherry pick triage to approve

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions