Index: src/GlobalJsObject.cpp |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/src/GlobalJsObject.cpp |
@@ -0,0 +1,14 @@ |
+#include "GlobalJsObject.h" |
+ |
+using namespace AdblockPlus; |
+ |
+v8::Handle<v8::ObjectTemplate> GlobalJsObject::Create( |
+ ErrorCallback& errorCallback) |
+{ |
+ v8::HandleScope handleScope; |
+ const v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); |
+ const v8::Handle<v8::ObjectTemplate> console = |
+ AdblockPlus::ConsoleJsObject::Create(errorCallback); |
+ global->Set(v8::String::New("console"), console); |
+ return handleScope.Close(global); |
+} |