Closed
Bug 557073
Opened 15 years ago
Closed 15 years ago
Appending new text nodes that include undefined on a setInterval create random numbers unexpectedly
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 394769
People
(Reporter: delan.azabani, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a4pre) Gecko/20100403 Ubuntu/10.04 (lucid) Minefield/3.7a4pre
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a4pre) Gecko/20100403 Ubuntu/10.04 (lucid) Minefield/3.7a4pre
When creating and appending a text node to the body of a page within a repeated setInterval, using an un-passed argument (which should evaluate to undefined), the text node contains random numbers, mostly zero, instead of undefined. Opera and Chrome do not show this behaviour.
Reproducible: Always
Steps to Reproduce:
1. Create a setInterval call
2. Make the function have an expected argument defined
3. Add a createTextNode/appendChild call including that argument
Actual Results:
Random integers are written over the screen, mostly zero.
Expected Results:
The word undefined should be written repeatedly over the screen.
This is the offending code:
setInterval(function(t) {
document.body.appendChild(document.createTextNode(t + ' '));
}, 0);
More details at my blog post: http://azabani.com/45
Comment 1•15 years ago
|
||
It's not exactly random, see https://developer.mozilla.org/en/DOM/window.setInterval#Callback_arguments
This is tracked in bug 394769.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•