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

Method ConvertFromJavaLong

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

Source from the content-addressed store, hash-verified

158}
159
160Local<Value> ArgConverter::ConvertFromJavaLong(Isolate* isolate, jlong value) {
161 Local<Value> convertedValue;
162 long long longValue = value;
163
164 if ((-JS_LONG_LIMIT < longValue) && (longValue < JS_LONG_LIMIT)) {
165 convertedValue = Number::New(isolate, longValue);
166 } else {
167 auto cache = GetTypeLongCache(isolate);
168 char strNumber[24];
169 sprintf(strNumber, "%lld", longValue);
170 Local<Value> strValue = ConvertToV8String(isolate, strNumber);
171 auto context = isolate->GetCurrentContext();
172 convertedValue = Local<Function>::New(isolate, *cache->LongNumberCtorFunc)->CallAsConstructor(context, 1, &strValue).ToLocalChecked();
173 }
174
175 return convertedValue;
176}
177
178int64_t ArgConverter::ConvertToJavaLong(Isolate* isolate, const Local<Value>& value) {
179 assert(!value.IsEmpty());

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
ToLocalCheckedMethod · 0.80

Tested by

no test coverage detected