Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 7097ea36d2615c11308c99699f8a4ccb5afb824d..7a0e87965225e1f61e0fdc05d31ba9adb28e6141 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -13317,6 +13317,22 @@ Handle<String> JSFunction::GetDebugName(Handle<JSFunction> function) { |
return JSFunction::GetName(function); |
} |
+void JSFunction::SetName(Handle<JSFunction> function, Handle<Name> name, |
+ Handle<String> prefix) { |
+ Isolate* isolate = function->GetIsolate(); |
+ Handle<String> function_name = Name::ToFunctionName(name).ToHandleChecked(); |
+ if (prefix->length() > 0) { |
+ IncrementalStringBuilder builder(isolate); |
+ builder.AppendString(prefix); |
+ builder.AppendCharacter(' '); |
+ builder.AppendString(function_name); |
+ function_name = builder.Finish().ToHandleChecked(); |
+ } |
+ JSObject::DefinePropertyOrElementIgnoreAttributes( |
+ function, isolate->factory()->name_string(), function_name, |
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)) |
+ .ToHandleChecked(); |
+} |
namespace { |