Closed Bug 327891 Opened 19 years ago Closed 17 years ago

ASSERTION: object instantiated without constructor

Categories

(Core :: DOM: Core & HTML, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: assertion, testcase)

Steps to reproduce:
1. javascript:new HTMLDocument();

Result:
###!!! ASSERTION: object instantiated without constructor: 'Error', file /Users/admin/trunk/mozilla/dom/src/base/nsDOMClassInfo.cpp, line 4658

I ran into this while trying to make a list of global constructors and things (such as new Image and new XMLHttpRequest) for bug 326633.  Those things don't show up in "for (p in window)" for some reason.  I guess HTMLDocument isn't intended to be a constructor, and might not be useful for anything other than instanceof.
WFM.  Now I just get:

JavaScript error: , line 0: uncaught exception: [Exception... "Cannot convert WrappedNative to function"  nsresult: "0x8057000d (NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN)"  location: "JS frame :: javascript:new%20HTMLDocument();%20void%200 :: <TOP_LEVEL> :: line 1"  data: no]
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
I checked in a mochitest that just makes sure that "new HTMLDocument()" throws (and doesn't assert).
Flags: in-testsuite+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.