Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setTimeout does not pass additional parameters correctly #1553

Closed
Ventero opened this issue May 10, 2012 · 0 comments
Closed

setTimeout does not pass additional parameters correctly #1553

Ventero opened this issue May 10, 2012 · 0 comments
Milestone

Comments

@Ventero
Copy link
Contributor

Ventero commented May 10, 2012

When supplying additional parameters (that is, parameters other than callback and timeout delay) to setTimeout, they are not correctly passed on. Instead, an array of all additional parameters is passed to the callback as first parameter, and a nsITimer instance as second parameter.

Example testcase (direct link to gist):

// ==UserScript==
// @name        Timeout additional parameter test
// @namespace   ventero.de
// @include     *
// @version     1
// ==/UserScript==

setTimeout(function(a, b){alert(a.foo + "//" + typeof b)}, 0, {foo:1}, {});

Steps to reproduce: Refresh any website
Expected output: An alert showing "1//object".
Observed output: An alert showing "undefined//object".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants