missing version in hasFeature produces uncaught exception

RESOLVED INVALID

Status

()

RESOLVED INVALID
16 years ago
11 years ago

People

(Reporter: bugzilla, Assigned: jst)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
<script>
alert(document.implementation.hasFeature("XML"));
</script>

produces:

Error: uncaught exception: [Exception... "Not enough arguments
[nsIDOMDOMImplementation.hasFeature]"  nsresult: "0x80570001
(NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS frame :: file:///C:/Temp/dom.html
:: <TOP_LEVEL> :: line 2"  data: no]

http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-102161490
says that:
"This is the version number of the feature to test. In Level 1, this is the
string "1.0". If the version is not specified, supporting any version of the
feature causes the method to return true."

So version is optional!

20030108
(Reporter)

Comment 1

16 years ago
Created attachment 111094 [details]
testcase
It's "optional" as in you can pass in "null" for it.  It's not optional as in
you can not pass it at all.
(Reporter)

Comment 3

16 years ago
IE can do this:
alert(document.implementation.hasFeature("XML"));

otherwise -> invalid. you decide.
(Assignee)

Comment 4

16 years ago
The DOM spec says nothing about the *argument* being optional, passing a valid
*value* is optional though, so null, or empty string is ok.

INVALID.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID

Updated

11 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.