Index: src/ConsoleJsObject.cpp |
=================================================================== |
--- a/src/ConsoleJsObject.cpp |
+++ b/src/ConsoleJsObject.cpp |
@@ -1,37 +1,36 @@ |
-#include <AdblockPlus/JsEngine.h> |
#include <AdblockPlus/JsValue.h> |
#include <AdblockPlus/ErrorCallback.h> |
#include <sstream> |
#include "ConsoleJsObject.h" |
namespace |
{ |
v8::Handle<v8::Value> ErrorCallback(const v8::Arguments& arguments) |
{ |
- AdblockPlus::JsEngine& jsEngine = AdblockPlus::JsEngine::FromArguments(arguments); |
+ AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arguments); |
const AdblockPlus::JsEngine::Context context(jsEngine); |
- AdblockPlus::JsValueList converted = jsEngine.ConvertArguments(arguments); |
+ AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments); |
std::stringstream message; |
for (size_t i = 0; i < converted.size(); i++) |
message << converted[i]->AsString(); |
- AdblockPlus::ErrorCallbackPtr callback = jsEngine.GetErrorCallback(); |
+ AdblockPlus::ErrorCallbackPtr callback = jsEngine->GetErrorCallback(); |
(*callback)(message.str()); |
return v8::Undefined(); |
} |
v8::Handle<v8::Value> TraceCallback(const v8::Arguments& arguments) |
{ |
return v8::Undefined(); |
} |
} |
AdblockPlus::JsValuePtr AdblockPlus::ConsoleJsObject::Setup( |
- AdblockPlus::JsEngine& jsEngine, AdblockPlus::JsValuePtr obj) |
+ AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj) |
{ |
- obj->SetProperty("error", jsEngine.NewCallback(::ErrorCallback)); |
- obj->SetProperty("trace", jsEngine.NewCallback(::TraceCallback)); |
+ obj->SetProperty("error", jsEngine->NewCallback(::ErrorCallback)); |
+ obj->SetProperty("trace", jsEngine->NewCallback(::TraceCallback)); |
return obj; |
} |