mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 21:07:17 +00:00
11 lines
317 B
Go
11 lines
317 B
Go
|
package duktape
|
||
|
|
||
|
// Must returns existing *Context or throw panic.
|
||
|
// It is highly recommended to use Must all the time.
|
||
|
func (d *Context) Must() *Context {
|
||
|
if d.duk_context == nil {
|
||
|
panic("[duktape] Context does not exists!\nYou cannot call any contexts methods after `DestroyHeap()` was called.")
|
||
|
}
|
||
|
return d
|
||
|
}
|