1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Merge pull request #142 from deoxxa/add-debugger-hook

add a way to trigger something with `debugger`
This commit is contained in:
Conrad Pankoff
2015-12-05 21:14:00 +11:00
4 changed files with 39 additions and 4 deletions

View File

@@ -359,6 +359,10 @@ func (self Otto) setValue(name string, value Value) {
self.runtime.globalStash.setValue(name, value, false)
}
func (self Otto) SetDebuggerHandler(fn func(vm *Otto)) {
self.runtime.debugger = fn
}
// Call the given JavaScript with a given this and arguments.
//
// If this is nil, then some special handling takes place to determine the proper