Index: src/GlobalJsObject.cpp |
=================================================================== |
--- 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; |
@@ -66,6 +67,8 @@ |
v8::Handle<v8::Value> SetTimeoutCallback(const v8::Arguments& arguments) |
{ |
TimeoutThread* timeoutThread; |
+ |
+ v8::Isolate* isolate = arguments.GetIsolate(); |
Felix Dahlke
2015/02/05 04:58:24
I think we should move this to the catch block whe
|
try |
{ |
AdblockPlus::JsValueList converted = |
@@ -75,7 +78,7 @@ |
} |
catch (const std::exception& e) |
{ |
- return v8::ThrowException(v8::String::New(e.what())); |
+ return v8::ThrowException(Utils::ToV8String(isolate, e.what())); |
} |
timeoutThread->Start(); |
@@ -89,8 +92,11 @@ |
{ |
AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arguments); |
AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments); |
+ |
+ v8::Isolate* isolate = arguments.GetIsolate(); |
Felix Dahlke
2015/02/05 04:58:24
Same here, we only need it if converted.size() < 1
|
if (converted.size() < 1) |
- return v8::ThrowException(v8::String::New("_triggerEvent expects at least one parameter")); |
+ return v8::ThrowException(Utils::ToV8String(isolate, |
+ "_triggerEvent expects at least one parameter")); |
std::string eventName = converted.front()->AsString(); |
converted.erase(converted.begin()); |