Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Issue 1677863002: Use default params when --destructure-named-params + fix renaming of reserved destructured params (Closed)

Created:
4 years, 10 months ago by ochafik
Modified:
4 years, 10 months ago
Reviewers:
vsm, Jennifer Messerly
CC:
dev-compiler+reviews_dartlang.org
Base URL:
git@github.com:dart-lang/dev_compiler.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Improve --destructure-named-params: - Destructure named params that clash with JS reserved names: `f({arguments = 1}) {}` becomes `function f({['arguments']: arguments$ = 1} = {}) {}` - Use ES6 default params for positional & optional parameters - Added simple tests BUG= R=jmesserly@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/ff88e54754e4a5c61cc93fe4d8eb2cee7b30319c

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -43 lines) Patch
M lib/src/codegen/js_codegen.dart View 1 7 chunks +31 lines, -18 lines 0 comments Download
M lib/src/js/nodes.dart View 1 4 chunks +15 lines, -1 line 0 comments Download
M lib/src/js/printer.dart View 1 3 chunks +32 lines, -9 lines 0 comments Download
M lib/src/js/template.dart View 1 chunk +4 lines, -0 lines 0 comments Download
A test/codegen/destructuring.dart View 1 chunk +20 lines, -0 lines 0 comments Download
M test/codegen/expect/closure.js View 1 chunk +2 lines, -8 lines 0 comments Download
A test/codegen/expect/destructuring.js View 1 chunk +39 lines, -0 lines 0 comments Download
A test/codegen/expect/destructuring.txt View 1 chunk +1 line, -0 lines 0 comments Download
M test/codegen_test.dart View 1 2 4 chunks +13 lines, -7 lines 0 comments Download

Messages

Total messages: 10 (5 generated)
ochafik
Hey guys, I found a way to destructure all named arguments (using computed properties for ...
4 years, 10 months ago (2016-02-06 16:57:16 UTC) #4
Jennifer Messerly
One comment about factoring, otherwise LGTM. https://codereview.chromium.org/1677863002/diff/1/lib/src/codegen/js_codegen.dart File lib/src/codegen/js_codegen.dart (right): https://codereview.chromium.org/1677863002/diff/1/lib/src/codegen/js_codegen.dart#newcode968 lib/src/codegen/js_codegen.dart:968: if (node.constKeyword != ...
4 years, 10 months ago (2016-02-09 00:33:07 UTC) #6
ochafik
Thanks John! https://codereview.chromium.org/1677863002/diff/1/lib/src/codegen/js_codegen.dart File lib/src/codegen/js_codegen.dart (right): https://codereview.chromium.org/1677863002/diff/1/lib/src/codegen/js_codegen.dart#newcode968 lib/src/codegen/js_codegen.dart:968: if (node.constKeyword != null) On 2016/02/09 00:33:07, ...
4 years, 10 months ago (2016-02-09 01:51:20 UTC) #7
Jennifer Messerly
Yeah makes sense. Thanks for the explanation. :)
4 years, 10 months ago (2016-02-09 16:16:26 UTC) #8
ochafik
4 years, 10 months ago (2016-02-09 16:46:40 UTC) #10
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
ff88e54754e4a5c61cc93fe4d8eb2cee7b30319c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698