MCPcopy Create free account
hub / github.com/buke/quickjs-go / WithBootstrapTimers

Function WithBootstrapTimers

runtime.go:338–342  ·  view source on GitHub ↗

WithBootstrapTimers toggles timer injection in bootstrap. Timer injection imports setTimeout/clearTimeout from the "os" module, so enabling timers implicitly requires std/os registration. During option normalization, injectTimers=true forces loadStdOS=true.

(enabled bool)

Source from the content-addressed store, hash-verified

336// enabling timers implicitly requires std/os registration. During option
337// normalization, injectTimers=true forces loadStdOS=true.
338func WithBootstrapTimers(enabled bool) ContextBootstrapOption {
339 return func(o *ContextBootstrapOptions) {
340 o.injectTimers = enabled
341 }
342}
343
344func newContextBootstrapOptions(opts ...ContextBootstrapOption) ContextBootstrapOptions {
345 cfg := ContextBootstrapOptions{

Callers 1

Calls

no outgoing calls

Tested by 1