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

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed)

Created:
4 years, 10 months ago by adamk
Modified:
4 years, 10 months ago
Reviewers:
Dan Ehrenberg, rossberg
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Don't reflect ES2015 Function name inference in Function.prototype.toString Various syntactic forms now cause functions to have names where they didn't before. Per the upcoming changes to the toString spec, only a name that was literally part of a function's expression or declaration is meant to be reflected in toString. This also happens to be the same set of names that V8 currently outputs (without the --harmony-function-name flag). This required distinguishing anonymous FunctionExpressions from other sorts of function definitions (like methods and getters/setters) in the AST, parser, and at runtime. The patch also takes the opportunity to remove one more argument (and enum) from FunctionLiteral, as well as adding a special factory method for the case of a FunctionLiteral representing toplevel or eval'd code. BUG=v8:4760 LOG=n Committed: https://crrev.com/cc2ea257479167858e5c535f3054a06e797bf7bd Cr-Commit-Position: refs/heads/master@{#34132}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Add object printing #

Patch Set 3 : Fix all the things #

Patch Set 4 : Move bits around to make STATIC_ASSERT happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -140 lines) Patch
M src/ast/ast.h View 1 2 7 chunks +40 lines, -25 lines 0 comments Download
M src/ast/ast.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/globals.h View 1 2 3 2 chunks +17 lines, -6 lines 0 comments Download
M src/objects.h View 1 2 3 8 chunks +24 lines, -14 lines 0 comments Download
M src/objects.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M src/objects-inl.h View 1 2 4 chunks +10 lines, -6 lines 0 comments Download
M src/objects-printer.cc View 1 1 chunk +7 lines, -1 line 0 comments Download
M src/parsing/parser.h View 2 chunks +0 lines, -2 lines 0 comments Download
M src/parsing/parser.cc View 1 2 10 chunks +44 lines, -37 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 5 chunks +30 lines, -37 lines 0 comments Download
M src/parsing/preparser.h View 2 chunks +0 lines, -2 lines 0 comments Download
M src/parsing/preparser.cc View 1 2 4 chunks +3 lines, -7 lines 0 comments Download
M test/mjsunit/harmony/function-name.js View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
adamk
Didn't end up using FunctionKind after all, but I still think this provides some nice ...
4 years, 10 months ago (2016-02-18 21:53:10 UTC) #3
adamk
+littledan, who could probably review this just as well
4 years, 10 months ago (2016-02-18 21:53:41 UTC) #5
Dan Ehrenberg
This is a great cleanup together with the new tracking. I'm happy to not have ...
4 years, 10 months ago (2016-02-19 00:10:41 UTC) #6
adamk
https://codereview.chromium.org/1712833002/diff/1/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/1712833002/diff/1/src/ast/ast.h#newcode3421 src/ast/ast.h:3421: FunctionLiteral* NewGlobalOrEvalFunctionLiteral( On 2016/02/19 00:10:41, Dan Ehrenberg wrote: > ...
4 years, 10 months ago (2016-02-19 01:09:16 UTC) #7
adamk
https://codereview.chromium.org/1712833002/diff/1/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/1712833002/diff/1/src/ast/ast.h#newcode3421 src/ast/ast.h:3421: FunctionLiteral* NewGlobalOrEvalFunctionLiteral( On 2016/02/19 01:09:15, adamk wrote: > On ...
4 years, 10 months ago (2016-02-19 02:02:19 UTC) #8
Dan Ehrenberg
lgtm Great. Modulo your STATIC_ASSERT failure, lgtm!
4 years, 10 months ago (2016-02-19 02:10:55 UTC) #9
adamk
On 2016/02/19 02:10:55, Dan Ehrenberg wrote: > lgtm > > Great. Modulo your STATIC_ASSERT failure, ...
4 years, 10 months ago (2016-02-19 02:33:05 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1712833002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1712833002/60001
4 years, 10 months ago (2016-02-19 02:33:18 UTC) #13
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 10 months ago (2016-02-19 02:51:06 UTC) #15
commit-bot: I haz the power
4 years, 10 months ago (2016-02-19 02:51:22 UTC) #17
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/cc2ea257479167858e5c535f3054a06e797bf7bd
Cr-Commit-Position: refs/heads/master@{#34132}

Powered by Google App Engine
This is Rietveld 408576698