Improve performance of Error.stack when stack contains local functions.
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 6 Sep 2010 09:10:11 +0000 (09:10 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 6 Sep 2010 09:10:11 +0000 (09:10 +0000)
BUG=http://crbug.com/53303
TEST=Use the test case attached in the bug report.

Patch by Xianzhu Wang <wangxianzhu@google.com>

Review URL: http://codereview.chromium.org/3167042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5410 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/messages.js

index 0375e8a..f26c3b5 100644 (file)
@@ -831,11 +831,11 @@ function FormatSourcePosition(frame) {
   }
   var line = "";
   var functionName = frame.getFunction().name;
-  var methodName = frame.getMethodName();
   var addPrefix = true;
   var isConstructor = frame.isConstructor();
   var isMethodCall = !(frame.isToplevel() || isConstructor);
   if (isMethodCall) {
+    var methodName = frame.getMethodName();
     line += frame.getTypeName() + ".";
     if (functionName) {
       line += functionName;