"use strict" VS setTimeout

Andrea Giammarchi andrea.giammarchi at gmail.com
Tue Sep 9 00:10:20 PDT 2014


If we don't end up emails with questions, maybe? :P

Thanks Boris for the improved report bug in webkit.

Best Regards

Sent from my Windows PhoneFrom: Brendan Eich
Sent: ‎9/‎9/‎2014 0:10
To: Andrea Giammarchi
Cc: Mark Miller; Mark S. Miller; es-discuss list
Subject: Re: "use strict" VS setTimeout
Andrea Giammarchi wrote:
> Thanks for the background history, however I am still not sold the
> fact it's a global object method should mean a global context should
> be passed.

"Is" (or "was" and therefore "is" because "don't break the web") -- not
"ought".

You need a way out of Hume's Guillotine on the Web. I don't know of one.
Ideals don't cut it without God-mode powers to rewrite unknown amounts
of content. Strict mode could eventually pave a cowpath, but as Mark
said, we don't want runtime strictness-testing magic in setTimeout or
other builtins.

The point here is that otherWin.setTimeout(func, ...) must -- because of
"is" not "ought" -- not pass undefined to func in case it is strict
mode, because if it's sloppy and if it is scoped by the current window
(not otherWin), then the wrong window will be used.

Is there any point in continuing this thread?

/be


More information about the es-discuss mailing list