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

Method ConvertToJavaLong

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

Source from the content-addressed store, hash-verified

176}
177
178int64_t ArgConverter::ConvertToJavaLong(Isolate* isolate, const Local<Value>& value) {
179 assert(!value.IsEmpty());
180
181 auto obj = Local<Object>::Cast(value);
182
183 assert(!obj.IsEmpty());
184
185 auto context = isolate->GetCurrentContext();
186 Local<Value> temp;
187 bool success = obj->Get(context, V8StringConstants::GetValue(isolate)).ToLocal(&temp);
188 assert(success && !temp.IsEmpty());
189 auto valueProp = temp.As<Object>();
190
191 string num = ConvertToString(valueProp->ToString(context).ToLocalChecked());
192
193 int64_t longValue = atoll(num.c_str());
194
195 return longValue;
196}
197
198ArgConverter::TypeLongOperationsCache* ArgConverter::GetTypeLongCache(v8::Isolate* isolate) {
199 TypeLongOperationsCache* cache;

Callers

nothing calls this directly

Calls 6

ToLocalMethod · 0.80
ToLocalCheckedMethod · 0.80
CastFunction · 0.50
IsEmptyMethod · 0.45
GetMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected