Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NativeScript/runtime/Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const std::string GetCurrentScriptUrl(v8::Isolate* isolate);

bool LiveSync(v8::Isolate* isolate);

void Assert(bool condition, v8::Isolate* isolate = nullptr);
void Assert(bool condition, v8::Isolate* isolate = nullptr, std::string const &reason = std::string());

}

Expand Down
5 changes: 4 additions & 1 deletion NativeScript/runtime/Helpers.mm
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
return true;
}

void tns::Assert(bool condition, Isolate* isolate) {
void tns::Assert(bool condition, Isolate* isolate, std::string const &reason) {
if (!RuntimeConfig.IsDebug) {
assert(condition);
return;
Expand All @@ -676,6 +676,9 @@

if (isolate == nullptr) {
Log(@"====== Assertion failed ======");
if(!reason.empty()) {
Log(@"Reason: %s", reason.c_str());
}
Log(@"Native stack trace:");
LogBacktrace();
assert(false);
Expand Down