JS warnings about winhooks at startup

VERIFIED FIXED in mozilla0.9.3

Status

P3
normal
VERIFIED FIXED
17 years ago
14 years ago

People

(Reporter: sfraser_bugs, Assigned: jag-mozilla)

Tracking

Trunk
mozilla0.9.3

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

17 years ago
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.
(Reporter)

Comment 1

17 years ago
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
(Assignee)

Updated

17 years ago
Priority: -- → P3
Target Milestone: --- → mozilla0.9.3

Comment 3

17 years ago
Also seen on OpenVMS debug build.
(Assignee)

Comment 4

17 years ago
Created attachment 43142 [details] [diff] [review]
[patch] Hush 'em up.
(Assignee)

Comment 5

17 years ago
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
(Assignee)

Comment 6

17 years ago
Oh, doh, forgot about the leakdetector and urlwidget (that's still in there?).
New patch coming up.
(Assignee)

Comment 7

17 years ago
Created attachment 43147 [details] [diff] [review]
[patch] get rid of strict warnings
(Assignee)

Comment 8

17 years ago
Created attachment 43148 [details] [diff] [review]
[patch] Also set LeakDetector.prototype in else case.
r=bbaetz
(Assignee)

Comment 11

17 years ago
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
(Assignee)

Comment 13

17 years ago
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
(Assignee)

Comment 15

17 years ago
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 :-)
(Assignee)

Comment 16

17 years ago
Checked in, marking fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 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.