| 158 | } |
| 159 | |
| 160 | Local<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 | |
| 178 | int64_t ArgConverter::ConvertToJavaLong(Isolate* isolate, const Local<Value>& value) { |
| 179 | assert(!value.IsEmpty()); |
nothing calls this directly
no test coverage detected