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

Unified Diff: src/objects.cc

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move bits around to make STATIC_ASSERT happy Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ab3008fe65b95a599379cec3b87c9690fdcff44d..a3e868ab3c183257d4129913100c9ef99925ec1f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13423,7 +13423,7 @@ Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
}
if (shared_info->name_should_print_as_anonymous()) {
builder.AppendCString("anonymous");
- } else {
+ } else if (!shared_info->is_anonymous_expression()) {
builder.AppendString(handle(String::cast(shared_info->name()), isolate));
}
}
@@ -13858,8 +13858,9 @@ void SharedFunctionInfo::InitFromFunctionLiteral(
shared_info->set_function_token_position(lit->function_token_position());
shared_info->set_start_position(lit->start_position());
shared_info->set_end_position(lit->end_position());
- shared_info->set_is_expression(lit->is_expression());
- shared_info->set_is_anonymous(lit->is_anonymous());
+ shared_info->set_is_declaration(lit->is_declaration());
+ shared_info->set_is_named_expression(lit->is_named_expression());
+ shared_info->set_is_anonymous_expression(lit->is_anonymous_expression());
shared_info->set_inferred_name(*lit->inferred_name());
shared_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
shared_info->set_allows_lazy_compilation_without_context(
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698