-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement assert() messages behind a flag on VM #24215
Comments
Thanks @lrhn ! |
Now that dart2js has landed (https://codereview.chromium.org/1342213003/) I think we can land the VM patch? |
I'm concerned because the spec change (https://codereview.chromium.org/1324933002) hasn't landed yet, and there is an open question about the spec that doesn't seem to have been agreed upon, namely the question of whether assertion messages are required to be strings or can be any object. (I've been holding off on landing the analyzer changes waiting for this question to be resolved). IIRC, the draft spec text currently says that they need to be strings, but the draft VM implementation allows them to be any object. I haven't looked at the dart2js code to see what it does. Can we get this question answered ASAP so that we don't start landing implementations that disagree with each other? cc @gbracha |
Thanks @stereotype441 we're not in a rush to land this in the VM so yes, let's ensure we're implementing the right thing. I believe Gilad's spec proposal is indeed what we should be implementing. |
On Thu, Sep 17, 2015 at 9:28 AM, Paul Berry notifications@github.com
|
The DEP met today, and decided that the type annotation on the optional param should be String. Does the CL reflect that? |
There is no added runtime type-check on the second operand. |
Whoops, no. If we are talking type annotation, the rewrite should only be |
However, the behavior in checked mode is the only behavior that matters because assertion failures only happen in checked mode. Quoting from the proposed spec text in https://codereview.chromium.org/1324933002:
|
Good point, checked mode only. That also makes it even more clear that checking the operand as by a type assertion is the wrong thing to do. It risks throwing again in the middle of an assertion, dropping the original assertion error. I can't see any case where a user wants that. If the real goal is just to have a static type check of the operand (as the draft CL actually writes), then the VM implementation should not be affected at all, and in practice all values must be accepted. |
Bumping to 1.14, not a critical 1.13 thing. |
Clearing out 1.15 milestone as the last full push to dev has happened. If any changes are required before 1.15 is shipped, please file a merge request |
Bumping to 1.17 |
@a-siva any updates on this? |
Add flag --assert-message to control the feature. Fixes issue #24215 BUG= http://dartbug.com/24215 This replaces Lasse’s CL 1307363005 patch from issue 1307363005 at patchset 140001 (http://crrev.com/1307363005#ps140001) R=lrn@google.com Review-Url: https://codereview.chromium.org/2564623003 .
Hey, @mhausner, does that commit mean this is done? Can I close the bug? |
This is done. |
🤘 |
After writing that comment, I noticed the CL was reverted. Did it get re-reverted? "Deverted"? |
I had to revert it because the corner case where both assert parameters are await expressions did not do the right thing. Still working on a fix. |
Moving to 1.22, we need to get this completed. |
Add flag --assert-message to control the feature. BUG=#24215 R=regis@google.com Review-Url: https://codereview.chromium.org/2574003003 .
Should be done now. |
\o/ |
This is the VM-specific issue for #24213. That issue has the details.
The text was updated successfully, but these errors were encountered: