[debugger] more informative break message (reverting back partially)
authorFedor Indutny <fedor.indutny@gmail.com>
Sat, 10 Sep 2011 05:38:42 +0000 (12:38 +0700)
committerFedor Indutny <fedor.indutny@gmail.com>
Sat, 10 Sep 2011 05:48:21 +0000 (12:48 +0700)
lib/_debugger.js

index 19dbc68..89b4392 100644 (file)
@@ -616,14 +616,20 @@ function SourceUnderline(sourceText, position) {
 }
 
 
+function SourceInvocation(body) {
+  return body.invocationText.replace(/\n/g, '')
+                            .replace(/^([^(]*)\(.*\)([^)]*)$/, '$1(...)$2');
+}
+
+
 function SourceInfo(body) {
-  var result = '';
+  var result = 'break in ' + SourceInvocation(body);
 
   if (body.script) {
     if (body.script.name) {
-      result += body.script.name;
+      result += ', ' + body.script.name;
     } else {
-      result += '[unnamed]';
+      result += '[unnamed]';
     }
   }
   result += ':';