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

Unified Diff: src/isolate.cc

Issue 917743002: [V8] Use Function.name for stack frames in v8::StackTrace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added Function.name getter check Created 5 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 | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 7cd8b002c4b096e15c83a085eba72eaaf4b8739c..9c2d9e5a77c18d3c0c9939e2ee5746c9c39fb78b 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -489,6 +489,8 @@ class CaptureStackTraceHelper {
if (options & StackTrace::kFunctionName) {
function_key_ = factory()->InternalizeOneByteString(
STATIC_CHAR_VECTOR("functionName"));
+ name_key_ =
+ factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("name"));
}
if (options & StackTrace::kIsEval) {
eval_key_ =
@@ -550,7 +552,9 @@ class CaptureStackTraceHelper {
}
if (!function_key_.is_null()) {
- Handle<Object> fun_name(fun->shared()->DebugName(), isolate_);
+ Handle<Object> fun_name = JSObject::GetDataProperty(fun, name_key_);
+ if (!fun_name->IsString())
+ fun_name = Handle<Object>(fun->shared()->DebugName(), isolate_);
JSObject::AddProperty(stack_frame, function_key_, fun_name, NONE);
}
@@ -581,6 +585,7 @@ class CaptureStackTraceHelper {
Handle<String> function_key_;
Handle<String> eval_key_;
Handle<String> constructor_key_;
+ Handle<String> name_key_;
};
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698