This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 480 - Mapping for exception catching uses wrong function
Summary: Mapping for exception catching uses wrong function
Status: RESOLVED FIXED
Alias: None
Product: DOM TS
Classification: Unclassified
Component: ECMAScript Binding (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Curt Arnold
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-22 08:48 UTC by David Faure
Modified: 2004-02-10 21:00 UTC (History)
0 users

See Also:


Attachments

Description David Faure 2004-01-22 08:48:06 UTC
The test DOM-Core-Level1 hc_entitiessetnameditem1 tries to catch two types of 
exception. This turns into the following Javascript code: 
if (ex.prototype.HasOwnProperty('code')) { 
  switch(ex.code) { ... } 
} 
 
The problem is that HasOwnProperty only works in IE (I guess), the proper 
capitalization is hasOwnProperty. 
 
It also looks like neither Mozilla nor Konqueror support ex.prototype 
(specifically on exceptions) at the moment, but I'll fix that for Konqueror, 
and maybe it's fixed in a more recent Mozilla version. But anyway, I'm not sure 
why this is needed - why not test for ex.code right away? Isn't ex.code 
mandatory to support?
Comment 1 David Faure 2004-01-22 09:37:02 UTC
In fact, this test requires that the 'code' is stored in the prototype of the 
exception, instead of being stored in the exception itself. Is there any reason 
for this requirement? There isn't much point in having one prototype per DOM 
exception code, the memory footprint is much smaller with a single error 
prototype for all errors, and the code stored into it. 
Can the test be removed altogether? 
Thanks. 
Comment 2 David Faure 2004-01-22 09:37:45 UTC
oops, when I said "the test" I meant the if() test, not the whole .xml file :) 
Comment 3 Bob Clary 2004-02-10 15:36:57 UTC
to curt.
Comment 4 Bob Clary 2004-02-10 16:00:09 UTC
Fixed by bug 515