On Fri, May 15, 2009 at 10:45 AM, William Edney
<bed...@technicalpursuit.com> wrote:
> Then, I could do the following (which would have saved me a lot of debugging
> time over the years):
>
> Null.prototype.__noSuchMethod__ = function (id, args)
> {
> alert('you were a bad boy and tried to send ' + id + ' to null');
> }
>
> Undefined.prototype.__noSuchMethod__ = function (id, args)
> {
> alert('you were a bad boy and tried to send ' + id + ' to undefined');
> }

This seems like something that can be addressed by "quality of
implementation" today, at least as far as error messages go.  I think
it's entirely possible for the error paths to give more context, so
I'm wondering if there are other significant use cases for creating
Null and Undefined.

(And would you then want toString and valueOf hooks to be honoured?
Would Undefined and Null be truthy or falsy?  Boolean is enough of a
mess on that score...)

Mike
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to