helpers

package
v0.0.0-...-841f565 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentModuleFilePath

func GetCurrentModuleFilePath(runtime *goja.Runtime) string

GetCurrentModuleFilePath evaluates the runtime callstack to determine the current file path

func GetCurrentModulePath

func GetCurrentModulePath(runtime *goja.Runtime) string

GetCurrentModulePath evaluates the runtime callstack to determine the current modules path

func GetRootCaller

func GetRootCaller(runtime *goja.Runtime) string

GetRootCaller evaluates the runtime callstack to determine the root caller

func NewGojaErrHandler

func NewGojaErrHandler(runtime *goja.Runtime, f GojaErrFunc) func(call goja.FunctionCall) goja.Value

NewGojaErrHandler wraps a go function that returns an error and propagates errors to goja's runtime using panic This is not idiomatic go but its how goja was designed so instead of writing panics in our goja function we can return errors in a more idiomatic way and allow this function to panic for us

Types

type GojaErrFunc

type GojaErrFunc func(call goja.FunctionCall) (goja.Value, error)

GojaErrFunc our more idiomatic goja function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL