Hello. I've tried following along with this and the embedder's guide, but 
my point binding only works to an extent. The constructor works, but for 
some reason when I use an invalid constructor the object in JavaScript is 
not undefined (I set the return value to be so). Also, whenever I retrieve 
values from accessors, I get numbers that aren't even close to what they 
should be.

Here's my binding class: binder.cpp <http://pastebin.com/af9G3Uq8>
And here's sample output: sample i/o <http://pastebin.com/2EKWzRwS>

On Tuesday, July 9, 2013 12:12:06 PM UTC-4, Ben Noordhuis wrote:
>
> On Mon, Jul 8, 2013 at 11:58 PM, Lyndsey <[email protected]<javascript:>> 
> wrote: 
> > I should also note that I forgot to change the comment above the 
> GetPointX 
> > method.  I am obviously reaching breakpoints in there now.  :) 
> > 
> > Also, I wholeheartedly agree about adding the check to ensure the 
> > constructor is being called "properly".  I assume that will prevent 
> > Javascripters from constructing a Point with too few, too many, or 
> > incorrectly-typed arguments? 
>
> That too but what I meant was guarding against non-constructor calls, 
> i.e. `MyConstructor()` rather than `new MyConstructor()`, or 
> construction as a different type: 
>
>   function TheirConstructor() {} 
>   TheirConstructor.prototype = new MyConstructor; 
>   new TheirConstructor;  // is-a MyConstructor but doesn't have 
> MyConstructor's internal fields 
>
> The above is why MyConstructor's native methods need to check on entry 
> that args.This() is of the expected type because it won't be when it's 
> part of a prototype chain (but see e.g. 
> args.This()->FindInstanceInPrototypeChain().) 
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to