From 03adceec62a76eb59cc705969e9d1e0514cf8859 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 10 Sep 2011 12:38:42 +0700 Subject: [PATCH] [debugger] more informative break message (reverting back partially) --- lib/_debugger.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index 19dbc689b60..89b4392e13a 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -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 += ':';