| 705 | } |
| 706 | |
| 707 | void CallbackHandlers::LogMethodCallback(const v8::FunctionCallbackInfo<v8::Value> &args) { |
| 708 | try { |
| 709 | if ((args.Length() > 0) && args[0]->IsString()) { |
| 710 | auto isolate = args.GetIsolate(); |
| 711 | auto context = isolate->GetCurrentContext(); |
| 712 | String::Utf8Value message(isolate, args[0]->ToString(context).ToLocalChecked()); |
| 713 | DEBUG_WRITE("%s", *message); |
| 714 | } |
| 715 | } catch (NativeScriptException &e) { |
| 716 | e.ReThrowToV8(); |
| 717 | } catch (std::exception e) { |
| 718 | stringstream ss; |
| 719 | ss << "Error: c++ exception: " << e.what() << endl; |
| 720 | NativeScriptException nsEx(ss.str()); |
| 721 | nsEx.ReThrowToV8(); |
| 722 | } catch (...) { |
| 723 | NativeScriptException nsEx(std::string("Error: c++ exception!")); |
| 724 | nsEx.ReThrowToV8(); |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | void CallbackHandlers::DrainMicrotaskCallback(const v8::FunctionCallbackInfo<v8::Value> &args) { |
| 729 | try { |
nothing calls this directly
no test coverage detected