Variable value remains 'undefined' when stopped in a debugger before initialization

RESOLVED WORKSFORME

Status

RESOLVED WORKSFORME
10 years ago
8 years ago

People

(Reporter: mstepanov, Assigned: rginda)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1
Build Identifier: 2008070206

When script execution is interrupted by JSD (breakpoint or debugger keyword), a value of variable differs from uninterrupted case.

Reproducible: Always

Steps to Reproduce:
1. Open attached mootools_sample.html
2. Enable Firebug (1.2.0 or beta)
3. Set a breakpoint at line 15 (var index = selector.selectedIndex)
4. Press 'Test' button, Firebug suspends execution; see 'index' value as'undefined'.
5. Continue execution, see 'undefined' alert box.
---
Repeat #1, #2 as above
3. Set breakpoint at line 14 (var selector = $("ab")).
Repeat #4, #5 above; see '0' as value.
(Reporter)

Updated

10 years ago
Blocks: 449452
(Reporter)

Comment 1

10 years ago
Created attachment 332938 [details]
Test case to reproduce
Status: UNCONFIRMED → NEW
Ever confirmed: true
There is this warning related, but I don't know if this is the cause:
WARNING: Positioned frame that does not handle positioned kids; looking further up the parent chain: file /home/asrail/mozbuilds/hg.mozilla.org/comm-central/mozilla/layout/base/nsCSSFrameConstructor.cpp, line 7635
Confirmed on trunk, linux.
Version: unspecified → Trunk

Comment 4

8 years ago
This is filed under Venkman, but I fail to see the problem with current (SeaMonkey) trunk Venkman...

And besides, setting breakpoint on "var index = selector.selectedIndex" will of course result in index being undefined, because the break will happen before the initialization...
IIUC, then without a debugger attachd, the alert() call outputs '0', but when you attach the debugger on line 15 and then continue, the alert() call outputs 'undefined'.

Comment 6

8 years ago
(In reply to comment #5)
> IIUC, then without a debugger attachd, the alert() call outputs '0', but when
> you attach the debugger on line 15 and then continue, the alert() call outputs
> 'undefined'.

That's my understanding as well, but I don't see this, using Venkman trunk with a SeaMonkey Linux trunk build...
(Reporter)

Comment 7

8 years ago
Just tested with Firefox 3.6.13 and Firebug 1.6.2 - does not an issue anymore.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.