Closed Bug 10573 Opened 25 years ago Closed 24 years ago

onerror function doesn't work like it does for 4.x

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: slogan, Assigned: joki)

Details

I added the file onerror.js tonight, but it doesn't work like it does in 4.x.
This code came from Danny Goodman's JavaScript Bible, and should display a
dialog when it encounters an error in JS code. But it doesn't. To add the js
file to a xul file, try

<html:script language="JavaScript" src="resource:/res/samples/onerror.js"/>
Assignee: mccabe → rogerl
Passing this on to Roger...

Roger - this could end up being something for the imbedding; I don't think the
core engine has ever defined onError.  But it'll likely interact with
exceptions; the best compromise that I found was to have uncaught exceptions
(Just when does it become uncaught?  It's a puzzler...) call the onError
handler.  One way to do this is to have exceptions always look just like
JavaScript errors always have to imbedding code that doesn't know look for an
associated exception value.
Status: NEW → ASSIGNED
Assignee: rogerl → joki
Status: ASSIGNED → NEW
Component: Javascript Engine → Event Handling
Uncaught exceptions - defined as those that make it out to the API invocation
level are turned into errors (marked as having exception-al birthright). The
embedding simply needs to respond to these in the same way as past JS errors.
The onerror event handler does not seem to be hooked up right now, but things
should just work fine when it is; I don't see any reason for the engine to get
into the onerror game since the current mechanism will work fine? I'm sending
the bug onto EventHandling since the initial complaint is that the onerror stuff
simply doesn't work, regardless of exceptions.
Target Milestone: M14
Summary: onerror function doesn't work like it does for 4.x → [4.xP] onerror function doesn't work like it does for 4.x
Target Milestone: M14 → M16
Moving M16.
Setting the keyword all open [4.xp] bugs to 4xp.
Keywords: 4xp
Updating QA contact.
QA Contact: cbegle → janc
Summary: [4.xP] onerror function doesn't work like it does for 4.x → onerror function doesn't work like it does for 4.x
Okay, I've added the onerror event as well as setting it up so that 'return 
true' from inside JS will surpress the error message (as opposed to 'return 
false' for most every other event).  However, in accordance with the DOM Level 2 
spec, the new proper way to accomplish this is to call event.preventDefault().  
PreventDefault works consistently for all events.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Mass update:  changing qacontact to ckritzer@netscape.com
QA Contact: janc → ckritzer
Updating QA Contact.
QA Contact: ckritzer → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
QA contact updated
QA Contact: gerardok → madhur
verified on build 2001-07-30-03-trunk
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.