Bug 645268 - Try to fix randomly failing browser_webconsole_bug_595934_message_categories.js by properly capturing a variable value in a closure r=ehsan

This commit is contained in:
Cameron McCormack 2011-04-20 10:35:50 +12:00
parent 22100730c3
commit b12a86604c

View File

@ -157,9 +157,10 @@ function testNext() {
pos++; pos++;
if (pos < TESTS.length) { if (pos < TESTS.length) {
if (TESTS[pos].onload) { if (TESTS[pos].onload) {
let position = pos;
browser.addEventListener("load", function(aEvent) { browser.addEventListener("load", function(aEvent) {
browser.removeEventListener(aEvent.type, arguments.callee, true); browser.removeEventListener(aEvent.type, arguments.callee, true);
TESTS[pos].onload(aEvent); TESTS[position].onload(aEvent);
}, true); }, true);
} }