summaryrefslogtreecommitdiff
path: root/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-01-20 23:24:30 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-01-20 23:24:30 +0000
commit334bfbad3fda3860f51b74cd6370786ef253ad49 (patch)
tree2cc40bf67b0ad86fc1e8c2e5f0a2e2085498ae7b /Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
parentff634d35c1fbd2831be6c1206bb9298cd5a14eda (diff)
skins: templates are kept in memory
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@128 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp')
-rw-r--r--Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
index ba8d611..732ca29 100644
--- a/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
+++ b/Plugins/skins/SkinLib/BorderState_v8_wrapper.cpp
@@ -15,20 +15,24 @@ using namespace v8;
static Handle<Value> Get_BorderState_left(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getLeft());
+ return scope.Close( Int32::New(tmp->getLeft()) );
}
static void Set_BorderState_left(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -45,20 +49,24 @@ static void Set_BorderState_left(Local<String> property, Local<Value> value, con
static Handle<Value> Get_BorderState_right(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getRight());
+ return scope.Close( Int32::New(tmp->getRight()) );
}
static void Set_BorderState_right(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -75,20 +83,24 @@ static void Set_BorderState_right(Local<String> property, Local<Value> value, co
static Handle<Value> Get_BorderState_top(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getTop());
+ return scope.Close( Int32::New(tmp->getTop()) );
}
static void Set_BorderState_top(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -105,20 +117,24 @@ static void Set_BorderState_top(Local<String> property, Local<Value> value, cons
static Handle<Value> Get_BorderState_bottom(Local<String> property, const AccessorInfo &info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
- return Undefined();
+ return scope.Close( Undefined() );
BorderState *tmp = (BorderState *) wrap->Value();
if (tmp == NULL)
- return Undefined();
+ return scope.Close( Undefined() );
- return Int32::New(tmp->getBottom());
+ return scope.Close( Int32::New(tmp->getBottom()) );
}
static void Set_BorderState_bottom(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
+ HandleScope scope;
+
Local<Object> self = info.Holder();
Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
if (wrap.IsEmpty())
@@ -135,6 +151,8 @@ static void Set_BorderState_bottom(Local<String> property, Local<Value> value, c
void AddBorderStateAcessors(Handle<ObjectTemplate> &templ)
{
+ HandleScope scope;
+
templ->SetAccessor(String::New("left"), Get_BorderState_left, Set_BorderState_left);
templ->SetAccessor(String::New("right"), Get_BorderState_right, Set_BorderState_right);
templ->SetAccessor(String::New("top"), Get_BorderState_top, Set_BorderState_top);