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

Function SetMethod

nan.h:2608–2620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2606
2607template <typename T, template <typename> class HandleType>
2608inline void SetMethod(
2609 HandleType<T> recv
2610 , const char *name
2611 , FunctionCallback callback
2612 , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
2613 HandleScope scope;
2614 v8::Local<v8::FunctionTemplate> t = New<v8::FunctionTemplate>(callback, data);
2615 v8::Local<v8::String> fn_name = New(name).ToLocalChecked();
2616 t->SetClassName(fn_name);
2617 // Note(@agnat): Pass an empty T* as discriminator. See note on
2618 // SetMethodAux(...) above
2619 imp::SetMethodAux(recv, fn_name, t, static_cast<T*>(0));
2620}
2621
2622inline void SetPrototypeMethod(
2623 v8::Local<v8::FunctionTemplate> recv

Callers 3

NAN_MODULE_INITFunction · 0.85
NAN_MODULE_INITFunction · 0.85
NAN_MODULE_INITFunction · 0.85

Calls 3

SetMethodAuxFunction · 0.85
ToLocalCheckedMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected