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: Created Nov. 10, 2014, 9:05 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
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());
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | src/WebRequestJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld