(vm *goja.Runtime)
| 118 | } |
| 119 | |
| 120 | func AddIsResolvable(vm *goja.Runtime) error { |
| 121 | return vm.GlobalObject().Set("isResolvable", func(call goja.FunctionCall) goja.Value { |
| 122 | if len(call.Arguments) != 1 { |
| 123 | panic(vm.NewTypeError("isResolvable expects exactly 1 argument")) |
| 124 | } |
| 125 | res := dnsResolve(call.Argument(0).String()) |
| 126 | return vm.ToValue(res.IsValid()) |
| 127 | }) |
| 128 | } |
| 129 | |
| 130 | func AddIsInNet(vm *goja.Runtime) error { |
| 131 | return vm.GlobalObject().Set("isInNet", func(call goja.FunctionCall) goja.Value { |
nothing calls this directly
no test coverage detected