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

Unified Diff: src/GlobalJsObject.cpp

Issue 6112412478472192: Issue 1547 - Pass isolate to v8::API (Closed)
Patch Set: remove new empty lines Created Feb. 9, 2015, 11:02 a.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/FileSystemJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/GlobalJsObject.cpp
diff --git a/src/GlobalJsObject.cpp b/src/GlobalJsObject.cpp
index 46731d31b855270c243c59e9564d5812950b6e3f..0f370eb4ab151f4f5391c3ae4ff25df35cbc4bae 100644
--- a/src/GlobalJsObject.cpp
+++ b/src/GlobalJsObject.cpp
@@ -27,6 +27,7 @@
#include "ConsoleJsObject.h"
#include "WebRequestJsObject.h"
#include "Thread.h"
+#include "Utils.h"
using namespace AdblockPlus;
@@ -75,7 +76,8 @@ namespace
}
catch (const std::exception& e)
{
- return v8::ThrowException(v8::String::New(e.what()));
+ v8::Isolate* isolate = arguments.GetIsolate();
+ return v8::ThrowException(Utils::ToV8String(isolate, e.what()));
}
timeoutThread->Start();
@@ -90,8 +92,11 @@ namespace
AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arguments);
AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments);
if (converted.size() < 1)
- return v8::ThrowException(v8::String::New("_triggerEvent expects at least one parameter"));
-
+ {
+ v8::Isolate* isolate = arguments.GetIsolate();
+ return v8::ThrowException(Utils::ToV8String(isolate,
+ "_triggerEvent expects at least one parameter"));
+ }
std::string eventName = converted.front()->AsString();
converted.erase(converted.begin());
jsEngine->TriggerEvent(eventName, converted);
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld