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

Unified Diff: src/messages.js

Issue 919653002: [V8] Use Function.name in Error.stack (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/mjsunit/stack-traces.js » ('j') | test/mjsunit/stack-traces.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index b4da5326d661379e389b12f13abc3b4337196642..7a067c07bb4512e69b6e3a4a6e8669ae48f92373 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -823,8 +823,13 @@ function CallSiteGetFunction() {
}
function CallSiteGetFunctionName() {
+ // See if the function has displayName
+ var name = GET_PRIVATE(this, CallSiteFunctionKey).displayName;
aandrey 2015/02/11 15:47:39 unlike Function.name, this can throw. you can use
kozy 2015/02/11 16:11:56 Done.
+ if (name && IS_STRING(name)) {
+ return name;
+ }
// See if the function knows its own name
- var name = GET_PRIVATE(this, CallSiteFunctionKey).name;
+ name = GET_PRIVATE(this, CallSiteFunctionKey).name;
if (name) {
return name;
}
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | test/mjsunit/stack-traces.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698