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

Function SetProtoMethodNoSideEffect

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

Source from the content-addressed store, hash-verified

350 }
351
352 void SetProtoMethodNoSideEffect(v8::Isolate *isolate,
353 Local <v8::FunctionTemplate> that,
354 const char *name,
355 v8::FunctionCallback callback,
356 Local <v8::Value> data) {
357 Local<v8::Signature> signature = v8::Signature::New(isolate, that);
358 Local<v8::FunctionTemplate> t =
359 NewFunctionTemplate(isolate,
360 callback,
361 data,
362 signature,
363 v8::ConstructorBehavior::kThrow,
364 v8::SideEffectType::kHasNoSideEffect);
365 // kInternalized strings are created in the old space.
366 const v8::NewStringType type = v8::NewStringType::kInternalized;
367 Local<v8::String> name_string =
368 v8::String::NewFromUtf8(isolate, name, type).ToLocalChecked();
369 that->PrototypeTemplate()->Set(name_string, t);
370 t->SetClassName(name_string); // NODE_SET_PROTOTYPE_METHOD() compatibility.
371 }
372
373 void SetInstanceMethod(v8::Isolate *isolate,
374 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