Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
dart2js errors have stack traces that don't remain identical over time. #15171
Consider the following code:
On the VM, this prints "true" and "true", but on dart2js it prints "false" and "false". This makes it difficult to compare stack traces for equality and impossible to use them in expandos, which is blocking my work on issue #7040 on dart2js.
Try this patch:
diff --git a/dart/sdk/lib/_internal/lib/js_helper.dart b/dart/sdk/lib/_internal/lib/js_helper.dart
I'm at home without VPN right now, but I'll try to get this submitted tomorrow.
The objection to CL 78343002 seems to be that this isn't a guarantee we want to offer, but this guarantee is crucial to making stack chain tracking work. I contend that breaking stack chains is an unacceptable usability regression, so we should commit to guaranteeing identity equality of stack traces.
I hope that we will agree on guaranteeing that the stacktraces are identical (I just pinged issue #18394 to follow up on that).
Regardless of that discussion, I'd like to push forward the change Peter proposed earlier. Doing so will make it easier for people to debug async stack traces, and it will make the dart2js consistent with the current VM behavior.
If and when we decide that we don't want those guarantees and the VM needs to change the behavior in the future, we can revisit this at that point.