MCPcopy Create free account
hub / github.com/dop251/goja / ExampleRuntime_SetParserOptions

Function ExampleRuntime_SetParserOptions

runtime_test.go:2312–2325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2310}
2311
2312func ExampleRuntime_SetParserOptions() {
2313 vm := New()
2314 vm.SetParserOptions(parser.WithDisableSourceMaps)
2315
2316 res, err := vm.RunString(`
2317 "I did not hang!";
2318//# sourceMappingURL=/dev/zero`)
2319
2320 if err != nil {
2321 panic(err)
2322 }
2323 fmt.Println(res.String())
2324 // Output: I did not hang!
2325}
2326
2327func TestRuntime_SetParserOptions_Eval(t *testing.T) {
2328 vm := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetParserOptionsMethod · 0.80
RunStringMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…