Files
sdk/pkg/dev_compiler/bin
Olivier Chafik 07d3998cdc Before (for f(a, {b, c: c_default})):
function f(a, opts) {
    let b = opts && 'b' in opts ? opts.b : null;
    let c = opts && 'c' in opts ? opts.c : c_default;
    ...

After:
  function f(a, {b = null, c = c_default} = {}) {
    ...

Note:
- Still reverting to old code when any parameter clashes with reserved JS names (see discussion in https://github.com/dart-lang/dev_compiler/issues/392)
- When a parameter clashes with a Object.prototype property, using a clean default opts value (Object.create(null)).
- Passing opts through in aliased constructors, both for speed/concision and correctness (since default param value semantic is weird there)

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1484263002 .
2015-12-02 21:56:35 +00:00
..