mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
add support for an external Math.random() provider
This commit is contained in:
4
otto.go
4
otto.go
@@ -363,6 +363,10 @@ func (self Otto) SetDebuggerHandler(fn func(vm *Otto)) {
|
||||
self.runtime.debugger = fn
|
||||
}
|
||||
|
||||
func (self Otto) SetRandomSource(fn func() float64) {
|
||||
self.runtime.random = fn
|
||||
}
|
||||
|
||||
// Context is a structure that contains information about the current execution
|
||||
// context.
|
||||
type Context struct {
|
||||
|
||||
Reference in New Issue
Block a user