-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Kernel should have an AssertInitializer node #30914
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
Comments
I disagree. |
So do you want an |
We need to omit the assert initializer when compile options dictate, so need to clearly match the entire thing, embedded side-effects and all. We would like to avoid having to pattern-match inside some other initializer to attempt to identify the assert initializer. Perhaps an AssertInitializer contains an AssertExpression. Whatever we do, we need something properly defined and described in kernel/lib/ast.dart in order to work on #30038 without having to go back for re-work as ideas change. |
I'd use LocalInitializer. That's more flexible. |
@kmillikin As a first step, can we define in kernel/lib/ast.dart how an assert initializer will look? Then the parser(s) can generate that tree, and the compilers can generate code for it. The current form where dart2js sees a LocalInitializer containing a closure application is not suitable since it leaves residual code when assertions are not enabled. |
As a first step:
Do you have any concerns with it? |
It clearly marks the initializer so I'm ok with it. |
Kernel should have an
AssertInitializer
node. The current encoding misuses theLocalInitializer
and makes the feature unnecessarily convoluted.The text was updated successfully, but these errors were encountered: