Closed Bug 952734 Opened 9 years ago Closed 9 years ago

Sources with LabeledStatements makes ParserHelpers.getNodeLocation puke

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: vporof, Assigned: vporof)

Details

Attachments

(1 file)

STR:

1. Go to http://codemirror.net/demo/emacs.html
2. Open debugger
3. Select codemirror.js in the sources list
4. Click the pause button in the debugger toolbar
5. Hover the source code anywhere

Getting a ton of these:

Warning: syntax tree, TypeError: this.getNodeLocation(...) is null
ParserHelpers.nodeContainsPoint@resource:///modules/devtools/Parser.jsm:490
SyntaxTree.prototype.getIdentifierAt/<.onIdentifier@resource:///modules/devtools/Parser.jsm:279
SyntaxTreeVisitor.Identifier@resource:///modules/devtools/Parser.jsm:2299
SyntaxTreeVisitor.LabeledStatement@resource:///modules/devtools/Parser.jsm:924
SyntaxTreeVisitor.BlockStatement@resource:///modules/devtools/Parser.jsm:841
SyntaxTreeVisitor.FunctionDeclaration@resource:///modules/devtools/Parser.jsm:1396
SyntaxTreeVisitor.BlockStatement@resource:///modules/devtools/Parser.jsm:841
SyntaxTreeVisitor.FunctionExpression@resource:///modules/devtools/Parser.jsm:1605
SyntaxTreeVisitor.CallExpression@resource:///modules/devtools/Parser.jsm:1895
SyntaxTreeVisitor.AssignmentExpression@resource:///modules/devtools/Parser.jsm:1754
SyntaxTreeVisitor.ExpressionStatement@resource:///modules/devtools/Parser.jsm:867
SyntaxTreeVisitor.Program@resource:///modules/devtools/Parser.jsm:770
SyntaxTreeVisitor.walk@resource:///modules/devtools/Parser.jsm:732
SyntaxTree.prototype.getIdentifierAt@resource:///modules/devtools/Parser.jsm:303
SyntaxTreesPool.prototype._call@resource:///modules/devtools/Parser.jsm:222
SyntaxTreesPool.prototype.getIdentifierAt@resource:///modules/devtools/Parser.jsm:136
VariableBubbleView.prototype._findIdentifier@chrome://browser/content/devtools/debugger-panes.js:1736
VariableBubbleView.prototype._onMouseMove/<@chrome://browser/content/devtools/debugger-panes.js:1873
this.setNamedTimeout/<@resource:///modules/devtools/ViewHelpers.jsm:64
setTimeout_timer@resource://gre/modules/Timer.jsm:30

Guess what! CodeMirror has a goto label in skipAtomic, line 2602 in codemirror.js.
Attached patch v1Splinter Review
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Attachment #8350882 - Flags: review?(past)
Comment on attachment 8350882 [details] [diff] [review]
v1

Review of attachment 8350882 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/debugger/test/browser_dbg_parser-06.js
@@ +59,5 @@
>    verify("\nfoo\n=\nbar\n", e => e.name == "foo", [2, 0], [2, 3]);
>    verify("foo = bar", e => e.name == "bar", [1, 6], [1, 9]);
>    verify("\nfoo\n=\nbar\n", e => e.name == "bar", [4, 0], [4, 3]);
>  
> +  // LabeledStatement and ContinueStatement, because it's 1968 again

Hippie.
Attachment #8350882 - Flags: review?(past) → review+
gross.

P3.
Priority: -- → P3
https://hg.mozilla.org/mozilla-central/rev/1a95af5d93aa
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.