package protocolstate
import (
"github.com/Mzack9999/goja"
"github.com/Mzack9999/goja/parser"
"github.com/projectdiscovery/gologger"
)
func NewJSRuntime() *goja.Runtime {
vm := goja.New()
vm.SetParserOptions(parser.WithDisableSourceMaps)
if err := vm.Set("eval", "undefined"); err != nil {
gologger.Error().Msgf("could not set eval to undefined: %s", err)
}
return vm
}