Skip to content

Commit bccc837

Browse files
author
Mihail Slavchev
committed
replace ASSERT_MESSAGE with V8 exception (issue #221)
1 parent 5635fa5 commit bccc837

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/jni/NativeScriptRuntime.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,12 +703,11 @@ jobjectArray NativeScriptRuntime::GetMethodOverrides(JEnv& env, const Local<Obje
703703

704704
void NativeScriptRuntime::LogMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
705705
{
706-
ASSERT_MESSAGE(args.Length() == 1, "Log should be called with string parameter");
707-
ASSERT_MESSAGE(!args[0]->IsUndefined() && !args[0]->IsNull(), "Log called with undefined");
708-
ASSERT_MESSAGE(args[0]->IsString(), "Log should be called with string parameter");
709-
710-
String::Utf8Value message(args[0]->ToString());
711-
DEBUG_WRITE("%s", *message);
706+
if ((args.Length() > 0) && args[0]->IsString())
707+
{
708+
String::Utf8Value message(args[0]->ToString());
709+
DEBUG_WRITE("%s", *message);
710+
}
712711
}
713712

714713
void NativeScriptRuntime::DumpReferenceTablesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)

0 commit comments

Comments
 (0)