Jacob Pratt (2018-07-04T23:12:12.000Z)
I've been having this thought recently, after running across a potential
use case in practice. There will likely be conditional accessors at some
point in the future (with optional chaining), but there will not be
conditional assignment.

My thought was to have the following:
    this.foo ?= params?.foo;
which can be desugared to
    if (($ref = params?.foo) !== undefined) { this.foo = $ref; }

I would strictly check for undefined, rather than nullish, as anything
other than undefined would indicate that a value is present that can be
set. If no value is present (such as a missing key on an object), nothing
would be set. A reference must be used for the general case, as the object
being assigned (the RHS) could be a function or getter with side-effects.

Not sure if it should be ?= or =?, as it would look somewhat odd (IMO) for
things like ?+= or +=?.

Initial thoughts?
Jacob Pratt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180704/5b19d8df/attachment.html>
the.z.cuber at gmail.com (2018-07-06T19:05:42.039Z)
I've been having this thought recently, after running across a potential
use case in practice. There will likely be conditional accessors at some
point in the future (with optional chaining), but there will not be
conditional assignment.

My thought was to have the following:
    `this.foo ?= params?.foo;`
which can be desugared to
    `if (($ref = params?.foo) !== undefined) { this.foo = $ref; }`

I would strictly check for undefined, rather than nullish, as anything
other than undefined would indicate that a value is present that can be
set. If no value is present (such as a missing key on an object), nothing
would be set. A reference must be used for the general case, as the object
being assigned (the RHS) could be a function or getter with side-effects.

Not sure if it should be `?=` or `=?`, as it would look somewhat odd (IMO) for
things like `?+=` or `+=?`.

Initial thoughts?
Jacob Pratt