Chromium Code Reviews| Index: src/messages.js |
| diff --git a/src/messages.js b/src/messages.js |
| index ab71936725a0daf88b106a682d3aa93202ca7d09..f39f4d57a219a8d62e8c35b3ab1de8609c6b7058 100644 |
| --- a/src/messages.js |
| +++ b/src/messages.js |
| @@ -830,15 +830,8 @@ function CallSiteGetFunctionName() { |
| var name = this.fun.name; |
| if (name) { |
| return name; |
| - } else { |
| - return %FunctionGetInferredName(this.fun); |
| - } |
| - // Maybe this is an evaluation? |
| - var script = %FunctionGetScript(this.fun); |
| - if (script && script.compilation_type == COMPILATION_TYPE_EVAL) { |
| - return "eval"; |
| } |
| - return null; |
| + return %FunctionGetInferredName(this.fun); |
|
Christian Plesner Hansen
2012/05/24 02:15:18
I wonder if the eval case should have been reached
marja
2012/05/24 08:38:16
Done.
|
| } |
| function CallSiteGetMethodName() { |
| @@ -952,20 +945,25 @@ function CallSiteToString() { |
| fileLocation = "unknown source"; |
| } |
| var line = ""; |
| - var functionName = this.getFunction().name; |
| - var addPrefix = true; |
| + var functionName = this.getFunctionName(); |
| + var addSuffix = true; |
|
Christian Plesner Hansen
2012/05/24 02:15:18
I always get suffix and prefix mixed up. I do the
|
| var isConstructor = this.isConstructor(); |
| var isMethodCall = !(this.isToplevel() || isConstructor); |
| if (isMethodCall) { |
| + var typeNamePrefix = this.getTypeName() + "."; |
| var methodName = this.getMethodName(); |
| - line += this.getTypeName() + "."; |
| if (functionName) { |
| + if (typeNamePrefix[0] != '[' && |
|
Christian Plesner Hansen
2012/05/24 02:15:18
Something to consider to make this case easier to
marja
2012/05/24 08:38:16
Done.
|
| + functionName.indexOf(typeNamePrefix) != 0) { |
| + line += typeNamePrefix; |
| + } |
| line += functionName; |
| - if (methodName && (methodName != functionName)) { |
| + if (methodName && functionName.indexOf("." + methodName) != |
|
Christian Plesner Hansen
2012/05/24 02:15:18
Is this equivalent to (methodName != this.getFunct
marja
2012/05/24 08:38:16
Not equivalent; kept this, but fixed indexof -> la
|
| + functionName.length - methodName.length - 1) { |
| line += " [as " + methodName + "]"; |
| } |
| } else { |
| - line += methodName || "<anonymous>"; |
| + line += (typeNamePrefix + (methodName || "<anonymous>")); |
| } |
| } else if (isConstructor) { |
| line += "new " + (functionName || "<anonymous>"); |
| @@ -973,9 +971,9 @@ function CallSiteToString() { |
| line += functionName; |
| } else { |
| line += fileLocation; |
| - addPrefix = false; |
| + addSuffix = false; |
| } |
| - if (addPrefix) { |
| + if (addSuffix) { |
| line += " (" + fileLocation + ")"; |
| } |
| return line; |