Improve docs for JS engine slightly

This commit is contained in:
Marcel Schramm 2020-10-13 17:07:10 +02:00
parent 75a9dea28f
commit 159d9d1062
No known key found for this signature in database
GPG Key ID: 05971054C70EEDC7
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,8 @@ type ScriptInstance struct {
onMessageDelete *otto.Value
}
// New instantiates a new scripting engine
// New instantiates a new scripting engine. The resulting object doesn't hold
// any data or VMs initially. Only upon loading scripts, VMs are created.
func New() *JavaScriptEngine {
return &JavaScriptEngine{}
}
@ -176,6 +177,8 @@ func (engine *JavaScriptEngine) readScriptsRecursively(dirname string) error {
return nil
}
// SetErrorOutput sets the writer to which errors can be written from inside
// the JavaScript engines.
func (engine *JavaScriptEngine) SetErrorOutput(errorOutput io.Writer) {
engine.errorOutput = errorOutput
}