setTimeout 'this' requirement

Confirmed Issue #8282928 • Assigned to Kris K.

Details

Author
Calvin M.
Created
Jul 26, 2016
Privacy
This issue is public.
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

IE and edge have a check for what the this object of setTimeout is that is superfluous and unexpected, the following fails

({setTimeout:setTimeout}).setTimeout(fn, 0)

this can also come up if you cache setTimeout into a variable and the script get executed via eval (see this issue).

Fix: if you remove the check for ‘valid calling object’ this bug would go away.

No other browser or environment I am aware of implements this check

Attachments

Comments and activity

  • I couldn’t reproduce with the given snippet, but I could using this repo: https://github.com/leidegre/node-process-ie11-bug

    I’ve also attached the repo as a zip file in case it goes down. Just run npm install and npm start.

    Error is:

    Unhandled rejection TypeError: Invalid calling object
    at process.nextTick (eval code:82:9)
    
  • yeah turns out it’s everyone except node that the first snipit fails for, looks like the eval one is the bigger issue, that one is unique to edge.

  • Microsoft Edge Team

    Changed Assigned To to “Christian F.”

    Changed Assigned To to “Travis L.”

    Changed Assigned To from “Travis L.” to “Kris K.”

    Changed Status to “Confirmed”

You need to sign in to your Microsoft account to add a comment.

Sign in