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

Function SetInstanceMethod

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

Source from the content-addressed store, hash-verified

371 }
372
373 void SetInstanceMethod(v8::Isolate *isolate,
374 Local <v8::FunctionTemplate> that,
375 const char *name,
376 v8::FunctionCallback callback,
377 Local <v8::Value> data) {
378 Local<v8::Signature> signature = v8::Signature::New(isolate, that);
379 Local<v8::FunctionTemplate> t =
380 NewFunctionTemplate(isolate,
381 callback,
382 data,
383 signature,
384 v8::ConstructorBehavior::kThrow,
385 v8::SideEffectType::kHasSideEffect);
386 // kInternalized strings are created in the old space.
387 const v8::NewStringType type = v8::NewStringType::kInternalized;
388 Local<v8::String> name_string =
389 v8::String::NewFromUtf8(isolate, name, type).ToLocalChecked();
390 that->InstanceTemplate()->Set(name_string, t);
391 t->SetClassName(name_string);
392 }
393
394 void SetConstructorFunction(Local <v8::Context> context,
395 Local <v8::Object> 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