MCPcopy Create free account
hub / github.com/nodejs/nan / NAN_METHOD

Method NAN_METHOD

test/cpp/wrappedobjectfactory.cpp:76–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 static NAN_METHOD(NewInstance) {
77 v8::Local<v8::Function> cons = Nan::New(constructor());
78 double value = info[0]->IsNumber() ? To<double>(info[0]).FromJust() : 0;
79 const int argc = 1;
80 v8::Local<v8::Value> argv[1] = {Nan::New(value)};
81 info.GetReturnValue().Set(
82 Nan::NewInstance(cons, argc, argv).ToLocalChecked());
83 }
84
85 private:
86 explicit MyObject(double value = 0) : value_(value) {}

Callers

nothing calls this directly

Calls 7

FromJustMethod · 0.80
ToLocalCheckedMethod · 0.80
WrapMethod · 0.80
NewFunction · 0.50
NewInstanceFunction · 0.50
SetMethod · 0.45
GetReturnValueMethod · 0.45

Tested by

no test coverage detected