Closed
Bug 373261
Opened 18 years ago
Closed 17 years ago
XPCOM error thrown when onsubmit handler called via setTimeout
Categories
(Core :: XPConnect, defect, P1)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: Dolske, Unassigned)
Details
Attachments
(1 file)
1.81 KB,
text/html
|
Details |
A test case I was writing for password manager basically did the following:
window.addEventListener("submit", someFunction, false);
setTimeout(form.submit, 50);
The following error is thrown, showing up in the Error Console. |someFunction| never seems to be called.
Error: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no]
Reporter | ||
Comment 1•18 years ago
|
||
Testcase to demonstrate bug. Just load, and it will alert() with pass/fail. [And you can see the error in the Error Console.]
Bonus points: It's Mochitest ready! (With minor pre-commented edits)
Comment 2•17 years ago
|
||
"MacOSX Darwin 8.8.4 qm-xserve01 dep unit test" fails with this same error constantly.
*** 11665 ERROR FAIL | Error thrown during test: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: http://localhost:8888/tests/docshell/test/navigation/NavigationUtils.js :: searchForFinishedFrames :: line 207" data: no] | got 0, expected 1 | /tests/docshell/test/navigation/test_reserved.html
Flags: blocking1.9?
Priority: -- → P1
Version: 1.8 Branch → unspecified
Comment 3•17 years ago
|
||
(In reply to comment #2)
> "MacOSX Darwin 8.8.4 qm-xserve01 dep unit test" fails with this same error
> constantly.
philor filed bug 416622 on this issue, so it may not be this bug, but I'm leaving this as blocking? until I hear otherwise.
Comment 4•17 years ago
|
||
(In reply to comment #0)
> A test case I was writing for password manager basically did the following:
>
> window.addEventListener("submit", someFunction, false);
> setTimeout(form.submit, 50);
Functions exposed by xpconnect need their 'this' object at the time of the call, so this won't work. As sad as it may seem, this is per design and unlikely to change anytime soon. Moz2 maybe, but not before that. Marking WONTFIX as for now, this is per design.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
This reason this fails is that you're basically doing
foo = form.submit;
foo();
This will call the submit function, but the 'this' pointer won't be the correct form.
You need to log in
before you can comment on or make changes to this bug.
Description
•