Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL adds a test of the evaluation order in the case where a function invocation `g(a)` or `r.g(a)` involves the invocation of a getter `g` that returns a function object, and that function object is invoked with an actual argument `a`. The expectation in the test is that evaluation occurs left-to-right in every case, with one exception: when `g` is a class instance getter (this does not apply to extension instance getters) the actual argument list is evaluated before the getter. This is the actually implemented behavior, and the specification is being updated to specify this behavior (cf. dart-lang/language#2182). ------- Old description: A piece of technical debt which has been around for several years is the fact that the specified left-to-right evaluation order isn't implemented everywhere. In particular, with an ordinary invocation like `r.m(a)` where `m` is a getter that returns a function, the argument is evaluated before the getter is called, which is not a left-to-right ordering. This CL adds a test (with 2 libraries) where the evaluation order is detected, such that we can decide how to proceed. Change-Id: Ia2619fe6b4c4cf4cec63bac9c9f834306bdefe52 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238903 Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Erik Ernst <[email protected]>
- Loading branch information