Closed Bug 248966 Opened 20 years ago Closed 20 years ago

In <EdAECSSAttributes.js>, 2 "Warning: assignment to undeclared variable" (i & value)

Categories

(SeaMonkey :: Composer, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: sgautherie, Assigned: sgautherie)

References

()

Details

Attachments

(1 obsolete file)

[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040616] (release) (W98SE)
and
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a1) Gecko/20040520] (release) (W98SE)

{{
Warning: assignment to undeclared variable i
Source File: chrome://editor/content/EdAECSSAttributes.js
Line: 66

Warning: assignment to undeclared variable value
Source File: chrome://editor/content/EdAECSSAttributes.js
Line: 69
}}

My case is when opening 'Advaned Properties' for a |<DIV>|...
Fixes the 2 reported warnings,
plus another one that should be (!),
plus removes an unused var.
Assignee: composer → gautheri
Status: NEW → ASSIGNED
Attachment #151908 - Flags: superreview?(sfraser)
Attachment #151908 - Flags: review?(daniel)
Brendan:
Shouldn't we get another warning for |name| at line 68 too ??
Note that window.name is a DOM level 0 property, and var does not override a
pre-existing property of the same name, so lack of var leaves name in a document
script referring to window.name.

/be
Attachment #151908 - Flags: superreview?(sfraser) → superreview+
(In reply to comment #3)
> Note that window.name is a DOM level 0 property, and var does not override a
> pre-existing property of the same name, so lack of var leaves name in a document
> script referring to window.name.

Ah ! Then, it's correct not to get the warning on |name| :-)
Yet, adding |var| on it is what we want here, isn't it !?
Adding var won't override the window property.  If you don't want to change the
name of the window (used by target= and window.open's second argument to find
the named window), then it would be better to use a different variable name --
and of course to declare it with var.

/be
Comment on attachment 151908 [details] [diff] [review]
(Av1) <EdAECSSAttributes.js>
[Checked in: Comment 7]

r=daniel@glazman.org

Serge, add yourself on a new contributor line :-)
Attachment #151908 - Flags: review?(daniel) → review+
Checked in, on Serge's request.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attachment #151908 - Attachment description: (Av1) <EdAECSSAttributes.js> → (Av1) <EdAECSSAttributes.js> [Checked in: Comment 7]
Attachment #151908 - Attachment is obsolete: true
Target Milestone: --- → mozilla1.8alpha2
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: