| 238 | } |
| 239 | |
| 240 | string MethodCache::ResolveConstructor(const FunctionCallbackInfo<Value>& args, jclass javaClass, bool isInterface) { |
| 241 | JEnv env; |
| 242 | string resolvedSignature; |
| 243 | |
| 244 | JsArgToArrayConverter argConverter(args, isInterface); |
| 245 | if (argConverter.IsValid()) { |
| 246 | jobjectArray javaArgs = argConverter.ToJavaArray(); |
| 247 | |
| 248 | auto runtime = Runtime::GetRuntime(args.GetIsolate()); |
| 249 | |
| 250 | jstring signature = (jstring) env.CallObjectMethod(runtime->GetJavaRuntime(), RESOLVE_CONSTRUCTOR_SIGNATURE_ID, javaClass, javaArgs); |
| 251 | |
| 252 | const char* str = env.GetStringUTFChars(signature, nullptr); |
| 253 | resolvedSignature = string(str); |
| 254 | env.ReleaseStringUTFChars(signature, str); |
| 255 | env.DeleteLocalRef(signature); |
| 256 | } else { |
| 257 | JsArgToArrayConverter::Error err = argConverter.GetError(); |
| 258 | throw NativeScriptException(err.msg); |
| 259 | } |
| 260 | |
| 261 | return resolvedSignature; |
| 262 | } |
| 263 | |
| 264 | robin_hood::unordered_map<string, MethodCache::CacheMethodInfo> MethodCache::s_mthod_ctor_signature_cache; |
| 265 | jclass MethodCache::RUNTIME_CLASS = nullptr; |
nothing calls this directly
no test coverage detected