Closed Bug 357359 Opened 19 years ago Closed 19 years ago

Heavyweight function unqualified lookup finds Object.prototype slots before globals

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: simon, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061002 SeaMonkey/1.5a Build Identifier: cvs from mozilla/js @ 2006-10-20 17:11 NZDST Any function with nested functions that references a global member will find Object.prototype members before the globals. Note that lightweight functions and accesses qualified with |this| find the correct variable. Reproducible: Always Steps to Reproduce: Evaluate with jsshell (interactive or from .js file) var foo = "Global"; Object.prototype.foo = "Object"; function heavy() { function nested() { print("Make heavy() heavyweight"); } print(foo); print(this.foo); } heavy(); Actual Results: Object Global Expected Results: Global Global
Works for me: js> var foo = "Global"; js> Object.prototype.foo = "Object"; Object js> function heavy() { function nested() { print("Make heavy() heavyweight"); } print(foo); print(this.foo); } js> heavy(); Global Global What version of SpiderMonkey are you using? This was fixed a while ago. /be
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
(In reply to comment #1) > What version of SpiderMonkey are you using? This was fixed a while ago. > I *thought* an up-to-date CVS trunk: I seem to have stuffed up the checkout though (/js/src instead of JSRef?). Sorry for your time! If you can be bothered, could you let me know which bug this was handled in before? I searched several times, but I'm not used to Bugzilla's search.
(In reply to comment #2) > If you can be bothered, could you let me know which bug this was handled in > before? I searched several times, but I'm not used to Bugzilla's search. Via cvs annotate and cvs log -r, bug 290774. /be
You need to log in before you can comment on or make changes to this bug.