Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsError.cpp

Issue 29497616: Noissue - move anonymous namespace from header to cpp file (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created July 25, 2017, 2:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/JsError.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsError.cpp
diff --git a/src/JsError.cpp b/src/JsError.cpp
index d8c6fd8156fee44fd45a66762e7f1fbb895bf06b..49a87c581fd82e45d58c20d0e11bb488bd653f69 100644
--- a/src/JsError.cpp
+++ b/src/JsError.cpp
@@ -17,6 +17,24 @@
#include "JsError.h"
+namespace
+{
+ std::string ExceptionToString(const v8::Handle<v8::Value>& exception,
+ const v8::Handle<v8::Message>& message)
+ {
+ std::stringstream error;
+ error << *v8::String::Utf8Value(exception);
+ if (!message.IsEmpty())
+ {
+ error << " at ";
+ error << *v8::String::Utf8Value(message->GetScriptResourceName());
+ error << ":";
+ error << message->GetLineNumber();
+ }
+ return error.str();
+ }
+}
+
AdblockPlus::JsError::JsError(const v8::Handle<v8::Value>& exception,
const v8::Handle<v8::Message>& message)
: std::runtime_error(ExceptionToString(exception, message))
« no previous file with comments | « src/JsError.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld