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

VERIFIED FIXED in mozilla1.8beta4

Status

()

Core
JavaScript Engine
P2
normal
VERIFIED FIXED
13 years ago
12 years ago

People

(Reporter: mozilla, Assigned: brendan)

Tracking

({js1.5})

Trunk
mozilla1.8beta4
js1.5
Points:
---
Bug Flags:
blocking1.8b5 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

13 years ago
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
(Reporter)

Comment 1

13 years ago
hit <Enter> a little bit too early... 
According to the Ecmascript spec (section 10.1.3) locally declared functions 
should take precedence over parameters. 
(Reporter)

Comment 2

13 years ago
Created attachment 188201 [details]
test-case, where a parameter takes precedence over a locally declared function.

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)

Updated

13 years ago
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: js1.5
OS: Linux → All
Hardware: PC → All
Version: 1.7 Branch → Trunk
(Assignee)

Comment 3

13 years ago
Created attachment 188957 [details] [diff] [review]
simple fix: override hidden arg with local var for JSOP_DEFLOCALFUN

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+
(Assignee)

Comment 5

13 years ago
Bob always does, no need to nag ;-P.

/be
Status: NEW → ASSIGNED
Flags: blocking1.8b4+

Comment 6

13 years ago
(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?
(Assignee)

Updated

13 years ago
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta4
(Assignee)

Comment 7

13 years ago
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+
(Assignee)

Comment 8

13 years ago
Fixed.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Comment 9

13 years ago
This was backed out.. don't forget to check it in again ;-)

Comment 10

13 years ago
(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?
(Assignee)

Comment 11

13 years ago
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 → ---
(Assignee)

Comment 12

13 years ago
Fixed.

/be
Status: REOPENED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → FIXED

Comment 13

13 years ago
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+

Comment 14

12 years ago
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.