I think you're on the write track of the fix here.  I knew I needed to specify 
something similar to make instanceof work reasonably for object exemplars.   I 
need to look at it a bit more to be sure.

Allen

On Nov 14, 2011, at 5:18 PM, Mark S. Miller wrote:

> On Mon, Nov 14, 2011 at 5:13 PM, Mark S. Miller <[email protected]> wrote:
> 
>     function [[GetClass]](x) {
>       while (true) {
>         const proto = Object.getPrototypeOf(x);
>         if (proto === null) { return null; /* or void 0? */ }
>         let result;
>         if (hasOwnProperty(proto, 'constructor') &&
>             (result = proto.constructor) &&
>             typeof result === 'function' &&
>             result.prototype === proto) {
>           return result;
>         }
>       }
>     }
> 
> Oops. Should be
> 
>     function [[GetClass]](x) {
>       while (true) {
>         x = Object.getPrototypeOf(x);
>         if (x === null) { return null; /* or void 0? */ }
>         let result;
>         if (hasOwnProperty(x, 'constructor') &&
>             (result = x.constructor) &&
>             typeof result === 'function' &&
>             result.prototype === x) {
>           return result;
>         }
>       }
>     }
> 
> -- 
>     Cheers,
>     --MarkM

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to