Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore trailing undefined arguments to Spy() functions

  • Loading branch information...
commit 575453b085767584426ef94ec1539282bef629b4 1 parent 3b0f912
@ianb authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 doctest.js
View
7 doctest.js
@@ -1412,7 +1412,12 @@ doctest.Spy = function (name, options, extraOptions) {
return s + ':never called';
}
s += '(';
- for (var i=0; i<self.args.length; i++) {
+ // This eliminates trailing undefined arguments:
+ var length = self.args.length;
+ while (length && self.args[length-1] === undefined) {
+ length--;
+ }
+ for (var i=0; i<length; i++) {
if (i) {
s += ', ';
}
Please sign in to comment.
Something went wrong with that request. Please try again.