Uri.parse result with dart2js throws runtime error on -O0, while other levels are OK #55058
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-dart2js
dart info
The following code throws with
-O0
when compiled withdart2js
(release mode), while it works properly with other optimization levels:Uri.parse
internally calls_computePathSegments
which returns either aconst <String>[]
orList<String>.unmodifiable(pathToSplit.split("/").map(Uri.decodeComponent))
.I went ahead and tested if any of these might be the source of the problem and NO. In
-O0
,_computePathSegments
is never actually called. In the compiled code, the execution stops here:The expression
A.isSentinel(value)
ALWAYS returnsfalse
- seem to be hard-coded:❗ NOTE: replacing
@
with eg._
in the URL seem to fix the problem in-O0
😕Update: found out why
_
works while@
doesn't. Uri.parse with_
instantiates_SimpleUri
while@
causes to instantiate_Uri
that in fact calls_computePathSegments
.Is there anything else I can show/give you to help track this down?
The text was updated successfully, but these errors were encountered: