Semantics of dart:js_interop
s Function.toJS
extension
#55515
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
web-js-interop
Issues that impact all js interop
The
toJS
extension method onFunction
fromdart:js_interop
seems to behave differently across backends:=> See here & here
allowInterop()
and therefore maintain identity (allowInterop
usesExpando
s in ddc)=> See here & here
allowInterop()
and therefore maintain identity (allowInterop
uses different mechanism, notExpando
s here)=> See here and here
From the discussion at flutter/flutter#143396 I infer that
allowInterop
shouldn't be needed in the new static interop world. Meaning we don't want to maintain identities when things flow back into dart.For performance reasons it's also much better not to use
Expando
s etc when making a callback.So
dart:js_interop
sFunction.toJS
extension method implementation/cc @srujzs @sigmundch
The text was updated successfully, but these errors were encountered: