diff --git a/src/Point.cc b/src/Point.cc index 0c8af32..3ee1d00 100755 --- a/src/Point.cc +++ b/src/Point.cc @@ -24,8 +24,8 @@ Point::Init(Handle target) { ctor->SetClassName(NanNew("Point")); Local proto = ctor->PrototypeTemplate(); - proto->SetAccessor(NanNew("x"), GetX);//, RaiseImmutable); - proto->SetAccessor(NanNew("y"), GetY);//, RaiseImmutable); + proto->SetAccessor(NanNew("x"), GetX, RaiseImmutable);//, RaiseImmutable); + proto->SetAccessor(NanNew("y"), GetY, RaiseImmutable);//, RaiseImmutable); NODE_SET_PROTOTYPE_METHOD(ctor, "dot", Dot); @@ -59,11 +59,10 @@ NAN_GETTER(Point::GetY){//(Local prop, const AccessorInfo &info) { NanReturnValue(NanNew(pt->point.y)); } -/*FIXME: add this back, possibly in a setter -void -Point::RaiseImmutable(Local property, Local value, const AccessorInfo& info) { + +NAN_SETTER(Point::RaiseImmutable){ NanThrowTypeError("Point is immutable"); -} */ +} NAN_METHOD(Point::Dot){ NanScope(); diff --git a/src/Point.h b/src/Point.h index fd5bc84..ca8b218 100755 --- a/src/Point.h +++ b/src/Point.h @@ -7,18 +7,13 @@ class Point: public node::ObjectWrap { CvPoint2D32f point; static Persistent constructor; static void Init(Handle target); - //static Handle New(const Arguments &args); static NAN_METHOD(New); Point(double x, double y); - //static Handle GetX(Local prop, const AccessorInfo &info); static NAN_GETTER(GetX); - //static Handle GetY(Local prop, const AccessorInfo &info); static NAN_GETTER(GetY); - - //static void RaiseImmutable(Local property, Local value, const AccessorInfo& info); - static NAN_METHOD(RaiseImmutable); - //static Handle Dot(const v8::Arguments&); + static NAN_SETTER(RaiseImmutable); + static NAN_METHOD(Dot); };