gopkg.in/olebedev/go-duktape.v1@v1.0.0-20151008052556-e2ae92f01e4a/utils.go (about)

     1  package duktape
     2  
     3  // Must returns existing *Context or throw panic.
     4  // It is highly recommended to use Must all the time.
     5  func (d *Context) Must() *Context {
     6  	if d.duk_context == nil {
     7  		panic("[duktape] Context does not exists!\nYou cannot call any contexts methods after `DestroyHeap()` was called.")
     8  	}
     9  	return d
    10  }