-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart2js: Code does not run with -O0
#41484
Comments
Immediate issue above fixed by e025726. |
Just want to confirm I'm seeing the same thing. Depending on whether using Chrome or Edge, I'm seeing $add or the C.JsString_methods error. |
@edyu If you could include the stack trace I could tell if it is the same issue or something else. |
from Chrome: Uncaught TypeError: Cannot read property '$add' of undefined at Object._Universe__canonicalRecipeOfInterface (rti.dart:1746) at Object._Universe__lookupInterfaceRti (rti.dart:1755) at Object._Parser_handleTypeArguments (rti.dart:2258) at Object._Parser_parse (rti.dart:2140) at Object._Universe__parseRecipe (rti.dart:1509) at Object._Universe_eval (rti.dart:1442) at findType (rti.dart:405) at rtii (main.dart.js:69276) at dartProgram (main.dart.js:69741) at js_helper.dart:3221 _Universe__canonicalRecipeOfInterface @ rti.dart:1743 _Universe__lookupInterfaceRti @ rti.dart:1753 _Parser_handleTypeArguments @ rti.dart:2256 _Parser_parse @ rti.dart:2137 _Universe__parseRecipe @ rti.dart:1506 _Universe_eval @ rti.dart:1445 findType @ rti.dart:396 rtii @ main.dart.js:69276 dartProgram @ main.dart.js:69741 (anonymous) @ js_helper.dart:3221 |
From Firefox: TypeError: C.JSString_methods is undefined _Universe__canonicalRecipeOfInterface rti.dart:1744 _Universe__lookupInterfaceRti rti.dart:1755 _Parser_handleTypeArguments rti.dart:2258 _Parser_parse rti.dart:2140 _Universe__parseRecipe rti.dart:1509 _Universe_eval rti.dart:1442 findType rti.dart:405 rtii main.dart.js:69276 dartProgram main.dart.js:69741 main.dart.js:70694 |
@rakudrama targets: $default: builders: build_web_compilers|entrypoint: options: compiler: dart2js dart2js_args: - -O0 |
Thanks for the investigation. The bug fix e025726 is relatively recent and didn't make the cut for the most recent stable release (2.8.3) but will be in a future release (2.9 preview). In the meantime, use |
I just tried running the code in #41449 with
-O0
.The code fails with:
There is an indirect cycle.
C.JSString
is a constant interceptor (methods) in the constant pool.The types are created (
rtii
,findType
) for the type pool before the constant pool exists.Possible ways to fix this:
+
on Strings. Use a new_Utils.concatN(s1, s2, ..., sN)
methods inrti.dart
.+
(it lowers to HStringConcat and the staticS
helper)String.+
to be more like numbers - generate a check before the lowered+
operation.Pulling the interceptor constants earlier might be the best option since the others remedies don't apply if we find the same problem with a different interceptor.
The text was updated successfully, but these errors were encountered: