-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
@JSExport relies on taking instance tear-offs and of "exportable" members and then calling Function.toJS on them. For Wasm compatibility, we should ensure that such functions respect the constraints of Function.toJS. Currently, the JS interop checks are done before this transform, so we should call out to those checks when we create the function in the transform.
Ideally, we'd be able to do this check on the class itself instead of when we invoke createJSInteropWrapper, but @JSExport is available both through dart:js_interop and through package:js, so this would be a breaking change for users using it through the old interop. We should also make sure to only emit these errors when createJSInteropWrapper is called and not createDartExport or createStaticInteropMock (available through js_util).
We could maybe make these errors surface better instead of all at the invocation site. Maybe emit the errors on the class when processing the invocation? We'd need to make sure we only do this once, however, so that multiple calls don't lead to a bunch of errors on the class.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status