Permalink
Browse files

Copy options before adding callback.

  • Loading branch information...
1 parent 28e8be5 commit e4d1e25c1648ef91f6baf1ef407c712509af4b66 @nrn nrn committed Feb 6, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −1 main.js
  2. +2 −1 tests/test-params.js
View
@@ -105,7 +105,6 @@ function Request (options) {
}
}
}
- options = copy(options)
this.init(options)
}
@@ -1095,6 +1094,8 @@ function request (uri, options, callback) {
options = uri
}
+ options = copy(options)
+
if (callback) options.callback = callback
var r = new Request(options)
return r
@@ -82,7 +82,8 @@ s.listen(s.port, function () {
}
counter = counter - 1;
if (counter === 0) {
- console.log(Object.keys(tests).length+" tests passed.")
+ assert.notEqual(typeof test.callback, 'function')
+ console.log(1 + Object.keys(tests).length+" tests passed.")
s.close()
}
})

0 comments on commit e4d1e25

Please sign in to comment.