-
Notifications
You must be signed in to change notification settings - Fork 213
update spec on evaluation order of deferred checks #3764
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
Makes sense to me. I believe we've discussed making deferred loading an web only feature: whether we do so or not, I think it is largely driven by the needs of the web. |
Yes, I think it makes sense to specify the evaluation order more precisely also in this case, and I agree that it should follow the left-to-right rule you mention consistently. @lrhn? |
The |
OK, decided: The language specification should specify the left-to-right evaluation order (in the example: the arguments should not be evaluated before failing). This issue serves to get that done. It would also serve as a justification for implementing it that way now. |
Fantastic! Thanks for the quick turn around on this! |
I couldn't find in the spec a lot of details explaining deferred checks. The program below:
We will be injecting a check that "a" is loaded before we allow the call to "foo". This check can be injected before or after arguments are evaluated to a value. This is implemented differently in dart2js and the VM: the example above prints 1 in dart2js and 2 in the vm.
In Dart 1 I'd have said we should implement the VM semantics. However, In Dart2 I believe we want the dart2js semantics instead: this matches the left-to-right consistency rule that we are adopting for Dart 2. I'm about to implement that in the FE at this moment.
@leafpetersen @lrhn @floitschG - can you clarify? would it be possible to explicitly call this out in the spec?
Related issue dart-lang/sdk#27577
The text was updated successfully, but these errors were encountered: