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

Function SetMethodNoSideEffect

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

Source from the content-addressed store, hash-verified

287 }
288
289 void SetMethodNoSideEffect(Local <v8::Context> context,
290 Local <v8::Object> that,
291 const char *name,
292 v8::FunctionCallback callback,
293 Local <v8::Value> data) {
294 Isolate *isolate = context->GetIsolate();
295 Local<v8::Function> function =
296 NewFunctionTemplate(isolate,
297 callback,
298 data,
299 Local<v8::Signature>(),
300 v8::ConstructorBehavior::kThrow,
301 v8::SideEffectType::kHasNoSideEffect)
302 ->GetFunction(context)
303 .ToLocalChecked();
304 // kInternalized strings are created in the old space.
305 const v8::NewStringType type = v8::NewStringType::kInternalized;
306 Local<v8::String> name_string =
307 v8::String::NewFromUtf8(isolate, name, type).ToLocalChecked();
308 that->Set(context, name_string, function).Check();
309 function->SetName(name_string); // NODE_SET_METHOD() compatibility.
310 }
311
312 void SetMethodNoSideEffect(Isolate *isolate,
313 Local <v8::Template> that,

Callers

nothing calls this directly

Calls 6

NewFunctionTemplateFunction · 0.85
ToLocalCheckedMethod · 0.80
GetFunctionMethod · 0.80
GetIsolateMethod · 0.45
CheckMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected