TypeScript does the same thing as Babel. Did `== null` stop being the idiomatic "check for null or undefined" in JS??
/cc @drosenwasser - those bundle paper cuts will add up 
-
Show this thread
-
It's still idiomatic, but it's not technically correct--document.all == null but it's not null or undefined. (Maybe this is what loose mode transforms are for? I don't know what the current best practice is.)
5 replies 0 retweets 2 likes -
Replying to @littledan @AdamRackis and
How does that document.all thing work? It seems to violate the spec, at a glance.
2 replies 0 retweets 2 likes -
Replying to @BrendanEich @littledan and
There's a special carve-out for it, added in 2017 (since browsers needed to implement that behavior anyway for web compat, might as well spec it): https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot …
1 reply 0 retweets 1 like -
Replying to @bakkoting @littledan and
Did Mozilla ever match this bizarre IE-ism? Cc:
@bz_moz2 replies 0 retweets 1 like -
Replying to @BrendanEich @bakkoting and
Yes, and like the other reply said, you wrote the patch. ;)
1 reply 0 retweets 5 likes -
-
Replying to @BrendanEich @bakkoting and
https://bugzilla.mozilla.org/attachment.cgi?id=152157&action=edit … I guess the actual "use that for document.all" bit was jst in https://bugzilla.mozilla.org/attachment.cgi?id=153679&action=edit … (see the JSRESOLVE_DETECTING checks there).
1 reply 0 retweets 0 likes -
Replying to @really_bz @bz_moz and
I was perp of DETECTING but it did not create a new value that is not == null or undefined.
1 reply 0 retweets 0 likes -
Replying to @BrendanEich @bakkoting and
Ah, so... The initial impl in Mozilla only did the "if (document.all)" thing: made it test false, while document.all would be an object in practice. Then later when we tried to harmonize this across browsers, the magic "object == null" thing was an easier sell than DETECTING
1 reply 0 retweets 0 likes
Standardizing DETECTING would have been exciting. ;)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.