Chromium Code Reviews
DescriptionDon'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 #
Messages
Total messages: 17 (7 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||