Closed Bug 204138 Opened 23 years ago Closed 23 years ago

Cannot enumerate all event properties without exceptions being thrown

Categories

(Core :: DOM: Events, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: hjtoi-bugzilla, Assigned: bryner)

Details

(Keywords: regression, topembed+, Whiteboard: [adt2])

Attachments

(2 files)

JavaScript: The Definitive Guide and other sources recommend a small snippet of code to enumerate all the properties of an object; it goes roughly like this: var eventProperties = ""; for (prop in e) { eventProperties += prop + " : '" + e[prop] + "'\n"; } Doing this for event object stopped working some time after 1.0. Now you get an exception thrown: * Call to xpconnect wrapped JSObject produced this error: * [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMPopupBlockedEvent.requestingWindowURI]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://www.mozilla.org/xmlextras/get.xhtml :: myfunc :: line 57" data: no] I'll attach a testcase.
Flags: blocking1.4b?
adt: nsbeta1+/adt2
Keywords: nsbeta1nsbeta1+
Whiteboard: [adt2]
Flags: blocking1.4b?
Flags: blocking1.4b-
Flags: blocking1.4?
bryner or ben, can you look at this?
Flags: blocking1.4? → blocking1.4+
ADT: Nominating topembed
Keywords: topembed
->bryner
Assignee: saari → bryner
Discussed in topembed bug triage. Plussing.
Keywords: topembedtopembed+
Attached patch fixSplinter Review
Attachment #123192 - Flags: superreview?(jst)
Attachment #123192 - Flags: review?(danm)
Comment on attachment 123192 [details] [diff] [review] fix + NS_WARNING("Tried to get requestingWindowURI for non-popupblocked event!"); Given that this code will be trigged if someone simply enumerates the properties of an event, I don't like this warning. I'd say take it out. sr=jst
Attachment #123192 - Flags: superreview?(jst) → superreview+
Attachment #123192 - Flags: review?(danm) → review+
Attachment #123192 - Flags: approval1.4?
Comment on attachment 123192 [details] [diff] [review] fix a=asa (on behalf of drivers) for checkin to 1.4
Attachment #123192 - Flags: approval1.4? → approval1.4+
checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified with 2003-06-12-04-trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: