Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 8282ed526b96608aaf603eaf34d873308727050b..181130ba81a20ddef3607628806f94eb46039cf3 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -7159,27 +7159,33 @@ RawString* Function::QualifiedName(NameVisibility name_visibility) const { |
} |
// A function's scrubbed name and its user visible name are identical. |
String& result = String::Handle(fun.UserVisibleName()); |
- if (IsClosureFunction()) { |
- while (fun.IsLocalFunction() && !fun.IsImplicitClosureFunction()) { |
+ if (IsClosureFunction() && fun.IsLocalFunction() && |
+ !fun.IsImplicitClosureFunction()) { |
+ fun = fun.parent_function(); |
+ if (fun.IsAsyncClosure() || fun.IsSyncGenClosure() || |
+ fun.IsAsyncGenClosure()) { |
+ // Skip the closure and use the real function name found in |
+ // the parent. |
fun = fun.parent_function(); |
- if (fun.IsAsyncClosure() || fun.IsSyncGenClosure() || |
- fun.IsAsyncGenClosure()) { |
- // Skip the closure and use the real function name found in |
- // the parent. |
- fun = fun.parent_function(); |
- } |
- result = String::Concat(Symbols::Dot(), result, Heap::kOld); |
- result = String::Concat(String::Handle(fun.UserVisibleName()), result, |
- Heap::kOld); |
} |
+ result = String::Concat(Symbols::Dot(), result, Heap::kOld); |
+ result = String::Concat(String::Handle(fun.QualifiedName(name_visibility)), |
siva
2017/04/20 00:14:59
Is it necessary to convert the iteration into a re
|
+ result, Heap::kOld); |
+ |
+ return result.raw(); |
} |
const Class& cls = Class::Handle(Owner()); |
if (!cls.IsTopLevel()) { |
- result = String::Concat(Symbols::Dot(), result, Heap::kOld); |
- const String& cls_name = String::Handle(name_visibility == kScrubbedName |
- ? cls.ScrubbedName() |
- : cls.UserVisibleName()); |
- result = String::Concat(cls_name, result, Heap::kOld); |
+ if (kind() == RawFunction::kConstructor) { |
siva
2017/04/20 00:14:59
I tried your cl and changed this line to
if (fun.k
|
+ result = String::Concat(Symbols::ConstructorStacktracePrefix(), result, |
+ Heap::kOld); |
+ } else { |
+ result = String::Concat(Symbols::Dot(), result, Heap::kOld); |
+ const String& cls_name = String::Handle(name_visibility == kScrubbedName |
+ ? cls.ScrubbedName() |
+ : cls.UserVisibleName()); |
+ result = String::Concat(cls_name, result, Heap::kOld); |
+ } |
} |
return result.raw(); |
} |