Skip to content

Commit 0345b25

Browse files
author
Joscha Rohmann
committed
jsdebugs "less-args" error is now printing param-names and is not printing
params double if a param has been specified.
1 parent 0871c4b commit 0345b25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/blocks/jsdebug.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ function addError(message, error, method, paramNames) {
257257
if (error.actual > 0) {
258258
message.addText(', ');
259259
}
260-
for (index = 0; index < error.expected; index++) {
260+
for (index = error.actual; index < error.expected; index++) {
261261
message
262262
.beginSpan({
263263
'background-color': 'red',
264264
padding: '0 5px',
265265
color: 'white'
266266
})
267-
.addText('?')
267+
.addText(paramNames[index] || '?')
268268
.endSpan();
269269
if (index != error.expected - 1) {
270270
message.addText(', ');
@@ -320,7 +320,7 @@ function addError(message, error, method, paramNames) {
320320

321321
function debugFunc(callback) {
322322
return function () {
323-
if (blocks.debug.executing) {
323+
if (blocks.debug.executing||!blocks.debug.enabled) {
324324
return;
325325
}
326326
blocks.debug.executing = true;

0 commit comments

Comments
 (0)