You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We seem to have a bug in CPS IR related to passing closures through js-interop. It might be that we don't mark a closure as escaped when we pass it to a js-interop API, or that we don't recognize that all closures could be invoked via JsObject.callMethod.
This only happens if the closure signature is not seen anywhere else in the Dart code. For example, the closure in the repro below is the only closure with 11 arguments. If we change it to take 4 or less arguments, then the closure is available and the program runs correctly.
Here is simplified repro, derived from the test in tests/html/js_test/Dart_functions:
We seem to have a bug in CPS IR related to passing closures through js-interop. It might be that we don't mark a closure as escaped when we pass it to a js-interop API, or that we don't recognize that all closures could be invoked via
JsObject.callMethod
.This only happens if the closure signature is not seen anywhere else in the Dart code. For example, the closure in the repro below is the only closure with 11 arguments. If we change it to take 4 or less arguments, then the closure is available and the program runs correctly.
Here is simplified repro, derived from the test in
tests/html/js_test/Dart_functions
:This prints
A B C D E F G H I J
when compiled with SSA, but throws the following error with CPS IR:Inspecting the output shows that the CPS IR has tree-shaken the call method of the closure.
The text was updated successfully, but these errors were encountered: