Closed Bug 87704 Opened 23 years ago Closed 23 years ago

JS warnings about winhooks at startup

Categories

(SeaMonkey :: UI Design, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.3

People

(Reporter: sfraser_bugs, Assigned: jag+mozilla)

Details

Attachments

(3 files)

I get these warnings at startup:

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined 
property Components.classes['@mozilla.org/winhooks;1']

presumably because the winhooks interface is not present on Mac. Although benign, 
it would be good to eliminate this warning.
Other new JS warnings in that file:

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1003: reference to undefined 
property Components.classes['@mozilla.org/xpcom/leakdetector;1']

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1102: reference to undefined 
property Components.classes['@mozilla.org/urlwidget;1']
i also see this in my 6/21 linux debug. don't see this w/verif bits.
OS: Mac System 8.5 → All
Hardware: Macintosh → All
Priority: -- → P3
Target Milestone: --- → mozilla0.9.3
Also seen on OpenVMS debug build.
It's interesting that we're getting so many warnings when there's only one line,
which is only called once.

Brendan, shaver, any idea why that could be?
Status: NEW → ASSIGNED
Oh, doh, forgot about the leakdetector and urlwidget (that's still in there?).
New patch coming up.
r=bbaetz
Thanks for the sr brendan :-) But do you have any idea why we'd see 11 strict JS
warnings for the one same line?
Sure -- it's a runtime warning.  That statement must have executed 11 times.  Do
you know why that might happen?

/be
Well, the code is executed only once.

I've modified that function like this:

var foopyCount = 0;
var barCount = 0;
function checkForDefaultBrowser()
{
  foopyCount++;
  try {
    Components.classes["@mozilla.org/winhooks;1"]
              .getService(Components.interfaces.nsIWindowsHooks)
              .checkSettings(window);
  } catch(e) {
    barCount++;
  }
  dump("Foopy: "+foopyCount+", bar: "+barCount+"...\n");
}

Which results in this chunk of output at startup:

JavaScript strict warning: 
chrome://navigator/content/navigator.js line 1326: reference to undefined
property Components.classes['@mozilla.org/winhooks;1']

[Repeat strict warning 10 times, see original post for an example ;-)]

Foopy: 1, bar: 1...
I repeat that the JS engine does not report errors redudantly.  Can you debug a
bit, see who is?  Maybe it's XPConnect.

/be
I guess xpconnect. It iterates over a bunch of listeners trying to QI them to an
onload listener, the QI fails (it looks for the "QueryInterface" property on the
object), which triggers the strict js warning printing code. This apparently
just prints out the last warning it got. Let me file a new bug on this :-)
Checked in, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
i no longer see these warnings with linux moz debug from last night.
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: