MCPcopy Create free account
hub / github.com/NativeScript/android / SetProtoMethod

Function SetProtoMethod

test-app/runtime/src/main/cpp/Util.cpp:331–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329 }
330
331 void SetProtoMethod(v8::Isolate *isolate,
332 Local <v8::FunctionTemplate> that,
333 const char *name,
334 v8::FunctionCallback callback,
335 Local <v8::Value> data) {
336 Local<v8::Signature> signature = v8::Signature::New(isolate, that);
337 Local<v8::FunctionTemplate> t =
338 NewFunctionTemplate(isolate,
339 callback,
340 data,
341 signature,
342 v8::ConstructorBehavior::kThrow,
343 v8::SideEffectType::kHasSideEffect);
344 // kInternalized strings are created in the old space.
345 const v8::NewStringType type = v8::NewStringType::kInternalized;
346 Local<v8::String> name_string =
347 v8::String::NewFromUtf8(isolate, name, type).ToLocalChecked();
348 that->PrototypeTemplate()->Set(name_string, t);
349 t->SetClassName(name_string); // NODE_SET_PROTOTYPE_METHOD() compatibility.
350 }
351
352 void SetProtoMethodNoSideEffect(v8::Isolate *isolate,
353 Local <v8::FunctionTemplate> that,

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
NewFunctionTemplateFunction · 0.85
ToLocalCheckedMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected