Closed Bug 105814 Opened 23 years ago Closed 23 years ago

Displaying window object's children causes errors - getHelperForLanguage and getInterfaces methods doesn't exist

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 99808

People

(Reporter: liorean, Assigned: jst)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5) Gecko/20011011 BuildID: 20001101117 When trying to make an object tree viewer, I created a long script that had a few errors in it. Some of those reported errors were of the kind I can't work around myself, though. I got around to trying to find out what caused them to file a bug here... Testcase in JSConsole: for(var i in window)alert('window.'+i+':\nType: ' + typeof eval(window[i])+'\nContent: '+ eval(window[i])); Errors appear after the alert for window.content: window.content Type: object Content: null They could either be caused by the alert for window.sidebar that follows: window.sidebar Type: object Content: [xpconnect wrapped nsISidebar] or by an object that isn't alerted because of the error, but that should be in between the two. Errors thrown: Error: [Exception... "'JavaScript component does not have a method named: "getHelperForLanguage"' when calling method: [nsIClassInfo::getHelperForLanguage]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no] Error: [Exception... "'JavaScript component does not have a method named: "getInterfaces"' when calling method: [nsIClassInfo::getInterfaces]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no] (I have turned off displaying the sidebar, if that might have any inpact on the error) Reproducible: Always Steps to Reproduce: 1. Write "for(var i in window)alert('window.'+i+':\nType: ' + typeof eval(window[i])+'\nContent: '+ eval(window[i]));" in JSConsole. 2. Evaluate Actual Results: Error: [Exception... "'JavaScript component does not have a method named: "getHelperForLanguage"' when calling method: [nsIClassInfo::getHelperForLanguage]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no] Error: [Exception... "'JavaScript component does not have a method named: "getInterfaces"' when calling method: [nsIClassInfo::getInterfaces]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: <unknown filename> :: <TOP_LEVEL> :: line 0" data: no] Errors appear between alerts for window.content and window.sidebar, or maybe when window.sidebar alert is to be displayed. Expected Results: Displayed the alert without errors and continued through the children of window until end is reached. Error also appears in my object tree revealer (under construction), http://liorean.tripod.com/treeview/index.html, which gave the additional error: Error: uncaught exception: Permission denied to create wrapper for object Interesting to note is that on other objects, my tree viewer throws non-existing errors like Error: write is not defined Source File: http://liorean.tripod.com/treeview/listing.js Line: 25 on window.document, on an object that has been enumerated, or that it throws the same "<child> is not defined" on the nodeType property for window.document.body and on other children for other objects.
Sounds like classinfo trouble... Wasn't jband going to make that "Permission denied to create wrapper for object " message more informative? :)
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM Core
Ever confirmed: true
QA Contact: pschwartau → stummala
Yeah, this is nsSidebar.js. We added nsIClassInfo to its QueryInterface method and a flags property. But we didn't add the two other methods that xpconnect might call. It is fully safe that these fail. The error message in the console is safely ignored. We can add simple implementations. I think the following will work (untested)... nsSidebar.prototype.getInterfaces = function(c) {c.value = 0; return [];} nsSidebar.prototype.getHelperForLanguage = function() {return null;} Better messages on security errors are the caps sytem's problem. I can't speak to the other points.
Bug 99808 should take care of this problem. *** This bug has been marked as a duplicate of 99808 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified dupe of 99808
Status: RESOLVED → VERIFIED
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.