All users were logged out of Bugzilla on October 13th, 2018

Javascript: setTimeout executes code and then creates javascript errors and stops execution

VERIFIED INVALID

Status

()

VERIFIED INVALID
17 years ago
10 years ago

People

(Reporter: peterjez, Assigned: jst)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

17 years ago
Visit my above smoketest testcase. In getBookmarkWindow I call a setTimeout that
uses gBookmarksShell.open. The function is executed... but it does not allow the
rest of the code after setTimeout to execute (ie the alert and the rest of it).

Error: 
Source File: http://pos.mcom.com/autosmoke/tests/bookmarksTest.html
Line: 39

Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.setTimeout]"  nsresult:
"0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame ::
http://pos.mcom.com/autosmoke/tests/bookmarksTest.html :: getBookmarkWindow ::
line 39"  data: no]
(Reporter)

Comment 1

17 years ago
BTW, in order to use the testcase, add the following line to your prefs.js:

user_pref("signed.applets.codebase_principal_support",true);
(Assignee)

Comment 2

17 years ago
This bug is invalid. The error comes from the line:

  currentWindow.setTimeout(openNewWindow(currentWindow,
                           bookmarksTree.selectedItems[0]),1);

which is incorrect. What you want is:

currentWindow.setTimeout(openNewWindow, 1, currentWindow,
                         bookmarksTree.selectedItems[0]);

Change that and it should work, if not reopen this bug.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID

Comment 3

17 years ago
johnny,
i could not reach the reporter and the url is not valid anymore. i was looking
at u'r comments. 
window.setTimeout("func()", 1); is a valid syntax rite.
thanks
(Assignee)

Comment 4

17 years ago
Yes, window.setTimeout("func()", 1); is valid, so is window.setTimeout(func,
1);, but window.setTimeout(func(), 1); is not (unless calling func() returns a
function or string that should be executed).

Comment 5

17 years ago
verifying invalid based on johnny's comments and not have not heard from reporter.
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.