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

Method LogMethodCallback

test-app/runtime/src/main/cpp/CallbackHandlers.cpp:707–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707void 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
728void CallbackHandlers::DrainMicrotaskCallback(const v8::FunctionCallbackInfo<v8::Value> &args) {
729 try {

Callers

nothing calls this directly

Calls 7

IsStringMethod · 0.80
ToLocalCheckedMethod · 0.80
ReThrowToV8Method · 0.80
LengthMethod · 0.45
GetIsolateMethod · 0.45
ToStringMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected