Remove use of for each from Venkman debugger - broken in nightly loads

RESOLVED FIXED in mozilla21


Other Applications
Venkman JS Debugger
6 years ago
3 years ago


(Reporter: morac, Assigned: morac)


Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment, 1 obsolete attachment)



6 years ago
The JavaScript Debugger Add-on (aka Venkman) does not load in the current nightly load (20.0a1 (2013-01-03)).  It puts up the following error:

An exception occurred while initializing, please file a bug.
ReferenceError: initViews is not defined @ <chrome://venkman/content/venkman-static.js> 614

I'm not sure when it broke exactly, but it was relatively recently.

Comment 1

6 years ago
I checked the error console and there's an error in file that defines initView():

Timestamp: 1/3/2013 1:04:30 PM
Error: SyntaxError: missing ( after for
Source File: chrome://venkman/content/venkman-views.js
Line: 3590, Column: 16
Source Code:
            for each (node in fragment.childNodes) 

It looks like "for each" has been removed from the latest Nightly.  See bug 825801.
Blocks: 825801
Summary: ReferenceError: initViews is not defined @ <chrome://venkman/content/venkman-static.js> 614 → Remove use of for each from Venkman debugger - broken in nightly loads

Comment 2

6 years ago
Created attachment 697535 [details] [diff] [review]

Not sure if this is being maintained anymore so I threw together a patch and used the reviewer of the last patch.
Assignee: nobody → morac99-firefox2
Attachment #697535 - Flags: review?(gijskruitbosch+bugs)

Comment 3

6 years ago
WFM for SM Trunk Linux x86-64. I had to change a/resources manually to
a/mozilla/extensions/venkman/resources so that the patch was compatible with my build system.

Comment 4

6 years ago
Comment on attachment 697535 [details] [diff] [review]

Unfortunately, while this works on trunk, it won't work on older released versions which Venkman still supports, because for...of is an ES Harmony feature, which wasn't available in Fx 3.5, SM 2, etc. (at least, I don't think so?)

Instead, can you just write a plain for loop? Id est:

for (var i = 0; i < node.childNodes.length; i++)
    var childNode = node.childNodes[i];
    ... etc. ...

Then I can rubberstamp that and check it in. Thank you for contributing, and sorry the review took a while...
Attachment #697535 - Flags: review?(gijskruitbosch+bugs) → review-

Comment 5

6 years ago
Created attachment 703073 [details] [diff] [review]
Patch (v2) [Checked in: Comment 8]

Okay I fixed it the way you stated.

Unfortunately even though this gets Venkman running, it sometimes decides to ignore breakpoints and the like.  Not sure why, but it seems to do with attaching to a window after it opens.  Any way, at least it somewhat works now.
Attachment #697535 - Attachment is obsolete: true
Attachment #703073 - Flags: review?(gijskruitbosch+bugs)

Comment 6

6 years ago
Comment on attachment 703073 [details] [diff] [review]
Patch (v2) [Checked in: Comment 8]

Looks good, thanks!

(do you have push access, or do you need me to push it for you?)
Attachment #703073 - Flags: review?(gijskruitbosch+bugs) → review+

Comment 7

6 years ago
I don't have push access, so please push it for me.  Thanks.


6 years ago
OS: Windows XP → All
Hardware: x86 → All
Target Milestone: --- → mozilla21

Comment 8

6 years ago
Comment on attachment 703073 [details] [diff] [review]
Patch (v2) [Checked in: Comment 8]
Attachment #703073 - Attachment description: Patch (v2) → Patch (v2) [Checked in: Comment 8]


6 years ago
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 9

6 years ago
This is also needed for current aurora (2.17a2) so need to make sure that comm-aurora's pulls a later version than currently ('VENKMAN_RELEASE_0_9_89')


3 years ago
Blocks: 1083470
You need to log in before you can comment on or make changes to this bug.