Closed Bug 826329 Opened 9 years ago Closed 9 years ago

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


(Other Applications Graveyard :: Venkman JS Debugger, defect)

Not set


(Not tracked)



(Reporter: morac, Assigned: morac)




(1 file, 1 obsolete file)

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.
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
Attached patch Patch (obsolete) — Splinter 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)
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 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-
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 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+
I don't have push access, so please push it for me.  Thanks.
OS: Windows XP → All
Hardware: x86 → All
Target Milestone: --- → mozilla21
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]
Closed: 9 years ago
Resolution: --- → FIXED
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')
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.