On Mon, Jul 8, 2013 at 11:58 PM, Lyndsey <[email protected]> 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