mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 23:35:27 +00:00
24 lines
547 B
Go
24 lines
547 B
Go
|
|
package compiler
|
||
|
|
|
||
|
|
import (
|
||
|
|
"sync"
|
||
|
|
|
||
|
|
"github.com/dop251/goja"
|
||
|
|
"github.com/remeh/sizedwaitgroup"
|
||
|
|
)
|
||
|
|
|
||
|
|
var (
|
||
|
|
ephemeraljsc = sizedwaitgroup.New(NonPoolingVMConcurrency)
|
||
|
|
lazyFixedSgInit = sync.OnceFunc(func() {
|
||
|
|
ephemeraljsc = sizedwaitgroup.New(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)
|
||
|
|
}
|