mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:35:26 +00:00
24 lines
592 B
Go
24 lines
592 B
Go
package compiler
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/dop251/goja"
|
|
syncutil "github.com/projectdiscovery/utils/sync"
|
|
)
|
|
|
|
var (
|
|
ephemeraljsc, _ = syncutil.New(syncutil.WithSize(NonPoolingVMConcurrency))
|
|
lazyFixedSgInit = sync.OnceFunc(func() {
|
|
ephemeraljsc, _ = syncutil.New(syncutil.WithSize(NonPoolingVMConcurrency))
|
|
})
|
|
)
|
|
|
|
func executeWithoutPooling(p *goja.Program, args *ExecuteArgs, opts *ExecuteOptions) (result goja.Value, err error) {
|
|
lazyFixedSgInit()
|
|
ephemeraljsc.Add()
|
|
defer ephemeraljsc.Done()
|
|
runtime := createNewRuntime()
|
|
return executeWithRuntime(runtime, p, args, opts)
|
|
}
|