function property and local variable of same name causes undefined

RESOLVED WORKSFORME

Status

()

P3
normal
RESOLVED WORKSFORME
19 years ago
17 years ago

People

(Reporter: martin.honnen, Assigned: mike+mozilla)

Tracking

Trunk
x86
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
As functions are object they can have properties e.g.
  function f () { alert(f.p) }
  f.p = 42;
  f();
With NN4 and NN5 (M11) if I choose a local variable of the same name as the
property I get an undefined value where I would expect the local variable to
shadow the function property after it is defined:

function compareRows (row1, row2) {
  var col = compareRows.col;
  alert(col);
}
compareRows.col = 1;
compareRows()


shows me
  undefined
with NN4 and NN5 whereas IE5 shows the
  1
value.

Updated

19 years ago
Status: NEW → ASSIGNED

Comment 1

19 years ago
I don't see a problem with this in M12 era builds
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → WORKSFORME
(Assignee)

Comment 2

19 years ago
Works for Roger.  Setting to WORKSFORME.
You need to log in before you can comment on or make changes to this bug.