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

Unified Diff: src/JsError.cpp

Issue 29531696: Issue 5568 - Improve string handling by splitting read strings into only ASCII and non-ASCII strings (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 30, 2017, 4:55 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
Index: src/JsError.cpp
diff --git a/src/JsError.cpp b/src/JsError.cpp
index 29ea66a74df122e399c4db4d87c10eb26fa78647..3af341f10e16bfa619faa7af87dfd7e136170a77 100644
--- a/src/JsError.cpp
+++ b/src/JsError.cpp
@@ -17,26 +17,25 @@
#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();
- }
-}
+using namespace AdblockPlus;
-AdblockPlus::JsError::JsError(const v8::Handle<v8::Value>& exception,
+JsError::JsError(const v8::Handle<v8::Value>& exception,
const v8::Handle<v8::Message>& message)
: std::runtime_error(ExceptionToString(exception, message))
{
}
+
+std::string JsError::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();
+}

Powered by Google App Engine
This is Rietveld