Closed Bug 740805 Opened 14 years ago Closed 14 years ago

Treat JSM files as JS scripts in the debugger

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 14

People

(Reporter: past, Assigned: past)

References

Details

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

Attachments

(1 file, 1 obsolete file)

When displaying JS module files we need to have the editor use the JavaScript highlighting mode, not the HTML one.
Attached patch Working patch (obsolete) — Splinter Review
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!
Attached patch Working patch v2Splinter Review
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+
Whiteboard: [chrome-debug] → [chrome-debug][fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: