Closed
Bug 537225
Opened 15 years ago
Closed 15 years ago
function returns global var not local function
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 434912
People
(Reporter: tekai, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2b5) Gecko/20091204 Firefox/3.6b5
Build Identifier: 3.6b5
If a function declaration is wrapped in a conditional and the conditional is not executed the function name references does not reference the function.
This happens in Firefox 3.6b5, Rhino (1.7R2), JavaScript-C (1.8.0 pre-release 1 2009-02-16).
Opera (10), Internet Explorer (8) reference the function and judging by the spec (Section 10.1.3) they do it correctly.
The behavior however is correct for var statements in conditionals.
Reproducible: Always
Steps to Reproduce:
var c="";
function h(a) {
if (a) {
function c() {
return "this is c";
}
}
return typeof c;
}
h(0);
Actual Results:
"string"
Expected Results:
"function"
Updated•15 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•