-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Question for @gbracha and @stereotype441
The proposal says that the semantics of a ??= b are the same as:
a = a ?? bThis means, a will be assigned it's own value when it's not null. This can be observable if you do:
get v => 1
set v(value) { print('setter was called with $value');
main() {
v ??= 2; // prints "setter was called with 1"
v ??= 3; // prints "setter was called with 1"
}However, some tests are written with a different semantics that avoids the assignment if the value is not null. In other words:
((v) => v == null ? a = b : v)(a)I currently have the former implemented in dart2js and I'm inclined to change those tests to match, but I wanted to verify this was the intended behavior.
Metadata
Metadata
Assignees
Labels
No labels