Reduce code duplication due to FunctionDeclaration and FunctionExpression (issue 7693051)

1 view
Skip to first unread message

a...@chromium.org

unread,
Mar 19, 2013, 4:26:13 PM3/19/13
to pete...@google.com, traceur-comp...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: peterhal,

Description:
Reduce code duplication due to FunctionDeclaration and
FunctionExpression

BUG=None


Please review this at https://codereview.appspot.com/7693051/

Affected files:
M bin/traceur.js
M src/codegeneration/DefaultParametersTransformer.js
M src/codegeneration/DestructuringTransformer.js
M src/codegeneration/GeneratorTransformPass.js
M src/codegeneration/SuperTransformer.js
M src/outputgeneration/ParseTreeWriter.js
M src/syntax/ParseTreeValidator.js


Erik Arvidsson

unread,
Mar 19, 2013, 5:43:27 PM3/19/13
to re...@codereview-hr.appspotmail.com, traceur-comp...@googlegroups.com

Unfortunately comments are not allowed in JSON.

On Mar 19, 2013 5:36 PM, <pete...@google.com> wrote:
LGTM

Thanks for taking care of this for me.

This looks great - I particularly like explicitly passing in the
constructor as a parameter rather than the tree.constructor method.

The one thing I'd add is a comment in trees.json detailing that there is
code which relies on FunctionExpression and FunctionDeclaration having
the same structure.

https://codereview.appspot.com/7693051/

a...@chromium.org

unread,
Mar 19, 2013, 6:42:40 PM3/19/13
to pete...@google.com, traceur-comp...@googlegroups.com, re...@codereview-hr.appspotmail.com
How about this? Is it too hacky?

https://codereview.appspot.com/7693051/

a...@chromium.org

unread,
Mar 20, 2013, 3:22:47 PM3/20/13
to pete...@google.com, traceur-comp...@googlegroups.com, re...@codereview-hr.appspotmail.com
Committed patchset #3 manually as r6040890 (presubmit successful).

https://codereview.appspot.com/7693051/
Reply all
Reply to author
Forward
0 new messages