Add functionality for inspecting arbitrary past calls
This made it much easier to debug multiple calls while developing this patch.
This commit is contained in:
parent
89d833e909
commit
f844cc8134
3 changed files with 10 additions and 3 deletions
|
|
@ -49,6 +49,7 @@ else window.o = m()
|
|||
var spy = function() {
|
||||
spy.this = this
|
||||
spy.args = [].slice.call(arguments)
|
||||
spy.calls.push({this: this, args: spy.args})
|
||||
spy.callCount++
|
||||
|
||||
if (fn) return fn.apply(this, arguments)
|
||||
|
|
@ -59,6 +60,7 @@ else window.o = m()
|
|||
name: {value: fn.name}
|
||||
})
|
||||
spy.args = []
|
||||
spy.calls = []
|
||||
spy.callCount = 0
|
||||
return spy
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue