Closed Bug 299639 Opened 19 years ago Closed 19 years ago

locally declared functions don't take precedence over parameters of the same name.

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8beta4

People

(Reporter: mozilla, Assigned: brendan)

Details

(Keywords: js1.5)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6)



Reproducible: Always
hit <Enter> a little bit too early... 
According to the Ecmascript spec (section 10.1.3) locally declared functions 
should take precedence over parameters. 
the test-case should print the function, and not the parameter.
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.7 Branch
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: js1.5
OS: Linux → All
Hardware: PC → All
Version: 1.7 Branch → Trunk
This leaves the argv slot inaccessible, but it's a hard case, and who cares in
light of the code size savings of this approach, as opposed to adding some
variant of JSOP_DEFLOCALFUN that uses a fp->argv instead of fp->vars slot.

/be
Attachment #188957 - Flags: review?(shaver)
Comment on attachment 188957 [details] [diff] [review]
simple fix: override hidden arg with local var for JSOP_DEFLOCALFUN

r=shaver, let's get a test in the suite too.
Attachment #188957 - Flags: review?(shaver) → review+
Bob always does, no need to nag ;-P.

/be
Status: NEW → ASSIGNED
Flags: blocking1.8b4+
(In reply to comment #4)
> (From update of attachment 188957 [details] [diff] [review] [edit])
> r=shaver, let's get a test in the suite too.

set testcase? flag to make sure I don't forget.
Flags: testcase?
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta4
Comment on attachment 188957 [details] [diff] [review]
simple fix: override hidden arg with local var for JSOP_DEFLOCALFUN

Self-approving, this is a straightforward spot-fix.

/be
Attachment #188957 - Flags: approval1.8b4+
Fixed.

/be
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
This was backed out.. don't forget to check it in again ;-)
(In reply to comment #9)
> This was backed out.. don't forget to check it in again ;-)

Caleb, can you point me to the bug where this was done?
Only record of it was in CVS, on bonsai from tinderbox.  I got a "you're off the
hook" tree open email, and checked in.  Chase asked me to back out, cuz he had
to respin a few builds from the trunk.

Reopening so everyone can see the fixes go in again tomorrow.

/be
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Fixed.

/be
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Checking in 10.1.3-2.js;
/cvsroot/mozilla/js/tests/ecma/ExecutionContexts/10.1.3-2.js,v  <--  10.1.3-2.js
initial revision: 1.1
Flags: testcase? → testcase+
verified fixed 20060401 1.8.0.2, 1.8, 1.9a1 win/mac/linux
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: