Thank you for the reply.
Basically what I want to achieve is the following.
Consider this js example

After my ReleaseObject() function is called x = is still a "point" object
At the second print(x) i would like my variable to be null, or report as 
null without explicitly setting it to null with "x=null;" if possible

I also attach my constructor function, please let me know if i construct my 
object correctly.
Thanks.

function f() {
// Local variable "x"
var x = new point(123,456);
print(x);                   //=> prints "[object point]"
x.ReleaseObject();
print(x);                   //=> prints "[object point]"
x=null;                     //want to incorporate this in x.ReleaseObject();
}

//-----------------------------------
    static Handle<Value> New(const Arguments &args)
    {
      HandleScope handle_scope;

      Local<FunctionTemplate> t = FunctionTemplate::New();
      t->SetClassName(args.Callee()->GetName()->ToString());
      t->ReadOnlyPrototype();

      Handle<ObjectTemplate> obj_templ = t->InstanceTemplate();
      obj_templ->SetInternalFieldCount(1);

      Local<Object> obj = obj_templ->NewInstance();
      Point* p = new Point(args[0]->Int32Value(), args[1]->Int32Value());
      obj->SetInternalField(0, External::New(p));
      obj->Set(String::NewSymbol("toString"), 
FunctionTemplate::New(Point::toString)->GetFunction(), 
PropertyAttribute(DontEnum | DontDelete));
      
      obj->SetAccessor(String::NewSymbol("x"), GetPointX, SetPointX);
      obj->SetAccessor(String::NewSymbol("y"), GetPointY, SetPointY);
      obj->Set(String::NewSymbol("ReleaseObject"), 
FunctionTemplate::New(Point::Delete)->GetFunction(), 
PropertyAttribute(DontEnum | DontDelete));

      return handle_scope.Close(obj);
    }

-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users

Reply via email to