Index: src/AppInfoJsObject.cpp |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/src/AppInfoJsObject.cpp |
@@ -0,0 +1,20 @@ |
+#include <AdblockPlus/AppInfo.h> |
+ |
+#include "AppInfoJsObject.h" |
+ |
+using namespace AdblockPlus; |
+ |
+v8::Handle<v8::ObjectTemplate> AppInfoJsObject::Create(const AppInfo& appInfo) |
+{ |
+ v8::HandleScope handleScope; |
+ const v8::Handle<v8::ObjectTemplate> infoObject = v8::ObjectTemplate::New(); |
+ infoObject->Set(v8::String::New("id"), |
+ v8::String::New(appInfo.id.c_str())); |
Wladimir Palant
2013/04/17 17:53:25
Utils::ToV8String()?
|
+ infoObject->Set(v8::String::New("version"), |
+ v8::String::New(appInfo.version.c_str())); |
+ infoObject->Set(v8::String::New("name"), |
+ v8::String::New(appInfo.name.c_str())); |
+ infoObject->Set(v8::String::New("platform"), |
+ v8::String::New(appInfo.platform.c_str())); |
+ return handleScope.Close(infoObject); |
+} |