Closed Bug 57649 Opened 24 years ago Closed 23 years ago

javascript strict warnings in editor.js

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: bugzilla, Assigned: cmanske)

Details

Attachments

(3 files)

JavaScript strict warning:
chrome://editor/content/editor.js line 266: reference to undefined property colo
rs.TextColor

JavaScript strict warning:
chrome://editor/content/editor.js line 269: reference to undefined property colo
rs.BackgroundColor

JavaScript strict warning:
chrome://editor/content/editor.js line 2174: reference to undefined property win
dow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2174: reference to undefined property win
dow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow

JavaScript strict warning:
chrome://editor/content/editor.js line 2216: reference to undefined property tem
pWindow.InsertCharWindow
move to Editor component
Assignee: kmcclusk → beppe
Component: Compositor → Editor
QA Contact: petersen → sujay
assigning to sfraser, simon assigning to you as part of the embedding work,
which will probably include a lot of this type of clean-up.
Assignee: beppe → sfraser
Target Milestone: --- → mozilla0.9
Summary: Lots of strict warnings in editor.js → javascript strict warnings in editor.js
reassigning to charley
Assignee: sfraser → cmanske
First, please tell us what action was taken to generate these warnings.
The colors.TextColor and .Background warnings were fixed.
I cannot fix the reference to "InsertCharWindow". If the Insert Character dialog
exists, this window attribute holds that window. So when we don't have that
dialog, the window attribute is "undefined". I see nothing wrong with testing
if "window.InsertCharWindow" exists -- that's what generates the warning.

Target Milestone: mozilla0.9 → Future
cmanske: you can avoid the warning by writing

   if ("InsertCharWindow" in window)
     window.InsertCharWindow .... etc.
r=blake
@@ -2246,7 +2246,7 @@
<timeless> jag: if i have a field that satisfies ("a" in b), can b.a be null?
<jag> yes
please check for null. or comment explaining why it could never happen.
Note that changing
  if (window.InsertCharWindow)
to
  if ("InsertCharWindow" in window)

changes its functionality. In the first case you check whether the property
isn't null, in the second case you only check whether the window object has a
property called "InsertCharWindow". If an existance check is all you need, then
this patch is fine. If you need to know it exists and isn't null, change those
lines to something like:

  if ("InsertCharWindow" in window && window.InsertCharWindow)
Thanks, my further testing revealed that I also needed to test for value.
New attachment comming -- doing testing concerning related problem.
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla0.8
r=timeless

+  if (windowWithDialog && "InsertCharWindow" in windowWithDialog && 
+      windowWithDialog.InsertCharWindow)
...
+               if (tempWindow != window && "InsertCharWindow" in tempWindow && 
tempWindow.InsertCharWindow)

if you're concerned about long lines, you might want to change the longer 
lines...
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified in 1/24 buld.
Status: RESOLVED → VERIFIED
in build 20010328

JavaScript strict warning:
chrome://editor/content/editor.js line 538: reference to undefined property 
menuItem.value
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Attached patch FixSplinter Review
ready for review
Status: REOPENED → ASSIGNED
Keywords: review
Whiteboard: FIX IN HAND need r=, sr=
Target Milestone: mozilla0.8 → mozilla0.9
sr=sfraser
r=brade
Whiteboard: FIX IN HAND need r=, sr= → FIX IN HAND
Thanks.
Removing requests for reviews.
Keywords: review
checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
Whiteboard: FIX IN HAND
Henrik, is this fixed for you in recent builds ? please mark verified-fixed.
thanks.
warning is now gone...
Status: RESOLVED → VERIFIED
JavaScript strict warning:
chrome://editor/content/editor.js line 2021: reference to undefined property
Components.classes['@mozilla.org/spellchecker;1']
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
This line is how we detect if the spellcheck is installed:
  var spellcheckerClass = Components.classes["@mozilla.org/spellchecker;1"];
I don't think there's any way around this warning when spellchecker isn't
installed.
Kin? Is this correct? Please mark "invalid" if yes.

No, we shouldn't see any JS errors. I don't see that in my Mozilla Win32 debug
build from this morning either, and I don't have the spellchecker installed.
Rather than morphing this bug into something about the spellchecker, could we
please file a bug if this is reproduceable?
Kin doesn't see this in today's debug build, but if you do see a warning and
are concerned about it, please file a new bug. It's hard to wade throught the
old problems to find the newest one. Thanks.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → WORKSFORME
this is still in todays (20010509) build.
Please note:
this is not a javascript error but a warning, which is *only* seen with:
user_pref("javascript.options.strict", true);
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Henrik--please file a new bug on that particular issue.  Thanks!
re-resolve as fixed
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
I've been told by Netscape engineers that when warnings appear in already 
reported (but perhaps fixed) files I should reopen bug instead of open a new. 

But I can also open a new one...
I cant see the warnings with todays build 20010619.
Will reopen if I see them again.

Please add the following line to your prefs.js file, so we could avoid all 
these strict warning fixup...:
user_pref("javascript.options.strict", true);
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: