>From the right email. On Tue, May 11, 2010 at 10:45 PM, Anton Muhin <[email protected]> wrote: > There are several problems with your code: > > 1) echo the way you use it is a bad idea, you need to do something > like echo.call($out, "It must work"). That's the way JS works (hint: > in the second case this is a global object); > > 2) overall you need args.Holder(), not args.This()---Holder() will > give an object which implements File and thus has internal fields. > > yours, > anton. > > On Tue, May 11, 2010 at 10:34 PM, Seiji Sam Lee <[email protected]> wrote: >> That is a silly question: >> >> >> >> I have done a classical implementation of File: a constructor, open, close, >> eof, isOpen, gets y puts. >> >> But following code only print “Hi world!!” >> >> >> >> $out=new File(�...@out”);//really FILE*stdout >> >> $out.puts("Hi world!!"); (1) >> >> >> >> var echo=$out.puts; >> >> echo("It must work"); (2) >> >> >> >> I catch “FILE*” pointer with “args.This()->GetPointerFromInternalField(2)”. >> >> In (1) “args.This()” is “$out” and in (2) “args.This()” is “echo” (I >> suppouse) that return NULL calling “GetPointerFromInternalField”. >> >> >> >> Are there any way to allow that code like that works fine? That is, “echo” >> call catch correct “FILE*” parameter of “$out”? >> >> >> >> Thanks in advance. >> >> >> >> -- >> v8-users mailing list >> [email protected] >> http://groups.google.com/group/v8-users >
-- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
