| Index: src/GlobalJsObject.cpp |
| diff --git a/src/GlobalJsObject.cpp b/src/GlobalJsObject.cpp |
| index 46731d31b855270c243c59e9564d5812950b6e3f..0bcf01a4653d3dca48412c4487ab7d7e0496a784 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; |
| @@ -66,6 +67,7 @@ namespace |
| v8::Handle<v8::Value> SetTimeoutCallback(const v8::Arguments& arguments) |
| { |
| TimeoutThread* timeoutThread; |
| + |
|
Felix Dahlke
2015/02/06 04:17:27
Unrelated change.
|
| try |
| { |
| AdblockPlus::JsValueList converted = |
| @@ -75,7 +77,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(); |
| @@ -89,9 +92,13 @@ 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")); |
|
Felix Dahlke
2015/02/06 04:17:27
Also unrelated.
|
| + if (converted.size() < 1) |
| + { |
| + 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); |