"use strict" VS setTimeout

Andrea Giammarchi andrea.giammarchi at gmail.com
Sun Sep 7 10:29:56 PDT 2014


I know this is probably W3C land but the following code shows the global
object in every JS engine I could test:

```js
(function () {
  'use strict';
  setTimeout(function () {
    'use strict';
    console.log(this);
    // [window/global Object]
  }, 0);
}());
```

This looks like a potential problem when possible passed methods are not
bound + it looks inconsistent with *"use strict"* expectations.

Thoughts ?

Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140907/57313353/attachment.html>


More information about the es-discuss mailing list