Re: Typeconverting Exotics

Historical note: We had a window during ES5 days where we could have
limited the document.all insanity to sloppy mode, by codifying the FF
behavior on edge cases rather than the WebKit behavior on edge cases.
Instead TC39 dropped this ball and DOM picked it up, codifying the dead-end
WebKit behavior which we are now forever stuck with. The salient difference
was that the FF behavior could be construed as a per-code issue rather than
a per-value issue.



On Sun, Jan 12, 2014 at 2:08 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/12/14 3:39 PM, Garrett Smith wrote:
>
>> Exotics are host objects that can implement non-standard behavior.
>>
>
> Note that the behavior for document.all is in fact specced.  It's an
> insane behavior, but less insane than any other web-compatible option. The
> spec is at http://www.whatwg.org/specs/web-apps/current-work/
> multipage/obsolete.html#dom-document-all and the weird bits are:
>
> 1) ToBoolean(document.all) returns false.
> 2) document.all == undefined and document.all == null test true.
>    document.all != undefined and document.all != null test false.
> 3) typeof document.all == "undefined".
>
> All the other behaviors are as normal for WebIDL objects, which defines
> things like ToPrimitive() and whatnot.
>
> This is the only object that needs this behavior and the only one that
> ever will, ideally, so while it might be nice to have a way of describing
> its behavior in ES6 terms it's even more important to not make it look like
> creating such objects is in any way OK or supported...
>
> -Boris
>
>


-- 
    Cheers,
    --MarkM

Received on Sunday, 12 January 2014 22:22:38 UTC