Treat JSM files as JS scripts in the debugger

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Developer Tools: Debugger
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: past, Assigned: past)

Tracking

Trunk
Firefox 14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [chrome-debug][fixed-in-fx-team])

Attachments

(1 attachment, 1 obsolete attachment)

When displaying JS module files we need to have the editor use the JavaScript highlighting mode, not the HTML one.
Created attachment 610878 [details] [diff] [review]
Working patch

The patch from the remote-debug repo.
Attachment #610878 - Flags: review?(rcampbell)
Status: NEW → ASSIGNED
Comment on attachment 610878 [details] [diff] [review]
Working patch

you're using a regex above this. What about:

if (/\.jsm?$/.test(this._trimUrlQuery(aUrl))) {
  window.editor.setMode(SourceEditor.MODES.JAVASCRIPT);
}

?

It doesn't exactly help readability (so a comment describing the regexp could be helpful) but it does cut down on an extra call to _trimUrlQuery() and .slice().
Attachment #610878 - Flags: review?(rcampbell)
(In reply to Rob Campbell [:rc] (:robcee) from comment #2)
> Comment on attachment 610878 [details] [diff] [review]
> Working patch
> 
> you're using a regex above this. What about:
> 
> if (/\.jsm?$/.test(this._trimUrlQuery(aUrl))) {
>   window.editor.setMode(SourceEditor.MODES.JAVASCRIPT);
> }
> 
> ?
> 
> It doesn't exactly help readability (so a comment describing the regexp
> could be helpful) but it does cut down on an extra call to _trimUrlQuery()
> and .slice().

Yes, that's a good idea!
Duplicate of this bug: 741331
Created attachment 613659 [details] [diff] [review]
Working patch v2

Updated to use a regex.
Attachment #610878 - Attachment is obsolete: true
Attachment #613659 - Flags: review?(rcampbell)
(In reply to Panos Astithas [:past] from comment #5)
> Created attachment 613659 [details] [diff] [review]
> Working patch v2
> 
> Updated to use a regex.

This needs a quick and easy rebase.
Comment on attachment 613659 [details] [diff] [review]
Working patch v2

rebasing is easy!
Attachment #613659 - Flags: review?(rcampbell) → review+
Rebased and landed:

https://hg.mozilla.org/integration/fx-team/rev/0319eb7b084a
Whiteboard: [chrome-debug] → [chrome-debug][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/0319eb7b084a
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.