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

Method Init

test-app/runtime/src/main/cpp/ArgConverter.cpp:16–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace tns;
15
16void ArgConverter::Init(Local<Context> context) {
17 Isolate* isolate = context->GetIsolate();
18 auto cache = GetTypeLongCache(isolate);
19
20 auto ft = FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongFunctionCallback);
21 ft->SetClassName(V8StringConstants::GetLongNumber(isolate));
22 ft->InstanceTemplate()->Set(V8StringConstants::GetValueOf(isolate), FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongValueOfFunctionCallback));
23 ft->InstanceTemplate()->Set(V8StringConstants::GetToString(isolate), FunctionTemplate::New(isolate, ArgConverter::NativeScriptLongToStringFunctionCallback));
24 cache->LongNumberCtorFunc = new Persistent<Function>(isolate, ft->GetFunction(context).ToLocalChecked());
25
26 auto nanObject = Number::New(isolate, numeric_limits<double>::quiet_NaN()).As<NumberObject>();
27 cache->NanNumberObject = new Persistent<NumberObject>(isolate, nanObject);
28}
29
30void ArgConverter::NativeScriptLongValueOfFunctionCallback(const v8::FunctionCallbackInfo<Value>& args) {
31 try {

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
ToLocalCheckedMethod · 0.80
GetFunctionMethod · 0.80
GetIsolateMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected