joyent/node — Issue #2079: setTimeout() handles a delay of 0 (zero) incorrectly with optional parameters
Author: ahildoer
Created: 2011-11-12 05:47:58+00:00
State: open

Just upgraded from 0.4.12 to 0.6.1 and encountered a problem with setTimeout.

The following code:

var test = function() {
console.log(arguments);
}

setTimeout(test, 0, 'arg1', 'arg2');

Prints:
{ '0': 0 }

The expected output is:
{ '0': 'arg1', '1': 'arg2' }

Environment:
OS: Ubuntu 10.04.3 LTS 64-bit

Package:
nodejs (from: http://ppa.launchpad.net/chris-lea/node.js/ubuntu/)
New: yes
State: installed
Automatically installed: no
Version: 0.6.1-1chl1~lucid1
Priority: extra
Section: web
Maintainer: Jérémy Lal