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

add simple stack depth limit mechanism

This commit is contained in:
deoxxa
2016-04-04 00:07:41 +10:00
parent 53221230c2
commit c142472392
4 changed files with 64 additions and 0 deletions

View File

@@ -367,6 +367,10 @@ func (self Otto) SetRandomSource(fn func() float64) {
self.runtime.random = fn
}
func (self Otto) SetStackDepthLimit(limit int) {
self.runtime.stackLimit = limit
}
// Context is a structure that contains information about the current execution
// context.
type Context struct {