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

Function toMethod

object.go:1407–1417  ·  view source on GitHub ↗
(v Value)

Source from the content-addressed store, hash-verified

1405}
1406
1407func toMethod(v Value) func(FunctionCall) Value {
1408 if v == nil || IsUndefined(v) || IsNull(v) {
1409 return nil
1410 }
1411 if obj, ok := v.(*Object); ok {
1412 if call, ok := obj.self.assertCallable(); ok {
1413 return call
1414 }
1415 }
1416 panic(newTypeError("%s is not a method", v.String()))
1417}
1418
1419func instanceOfOperator(o Value, c *Object) bool {
1420 if instOfHandler := toMethod(c.self.getSym(SymHasInstance, c)); instOfHandler != nil {

Callers 15

proxyCallMethod · 0.85
builtin_newMapMethod · 0.85
array_fromMethod · 0.85
stringproto_matchMethod · 0.85
stringproto_matchAllMethod · 0.85
stringproto_replaceMethod · 0.85
stringproto_searchMethod · 0.85
stringproto_splitMethod · 0.85
typedArray_fromMethod · 0.85

Calls 5

IsUndefinedFunction · 0.85
IsNullFunction · 0.85
newTypeErrorFunction · 0.85
assertCallableMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…