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

Method defaultConstruct

func.go:545–557  ·  view source on GitHub ↗
(ccall func(ConstructorCall) *Object, args []Value, newTarget *Object)

Source from the content-addressed store, hash-verified

543}
544
545func (f *nativeFuncObject) defaultConstruct(ccall func(ConstructorCall) *Object, args []Value, newTarget *Object) *Object {
546 obj := f.createInstance(newTarget)
547 ret := ccall(ConstructorCall{
548 This: obj,
549 Arguments: args,
550 NewTarget: newTarget,
551 })
552
553 if ret != nil {
554 return ret
555 }
556 return obj
557}
558
559func (f *nativeFuncObject) assertCallable() (func(FunctionCall) Value, bool) {
560 if f.f != nil {

Callers 1

newNativeConstructorMethod · 0.95

Calls 1

createInstanceMethod · 0.45

Tested by

no test coverage detected