Last Comment Bug 740805 - Treat JSM files as JS scripts in the debugger
: Treat JSM files as JS scripts in the debugger
Status: RESOLVED FIXED
[chrome-debug][fixed-in-fx-team]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Debugger (show other bugs)
: Trunk
: All All
: P2 normal (vote)
: Firefox 14
Assigned To: Panos Astithas [:past]
:
: James Long (:jlongster)
Mentors:
: 741331 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-30 07:34 PDT by Panos Astithas [:past]
Modified: 2012-04-17 10:48 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Working patch (1.04 KB, patch)
2012-03-30 07:38 PDT, Panos Astithas [:past]
no flags Details | Diff | Splinter Review
Working patch v2 (1.04 KB, patch)
2012-04-10 10:24 PDT, Panos Astithas [:past]
rcampbell: review+
Details | Diff | Splinter Review

Description Panos Astithas [:past] 2012-03-30 07:34:54 PDT
When displaying JS module files we need to have the editor use the JavaScript highlighting mode, not the HTML one.
Comment 1 Panos Astithas [:past] 2012-03-30 07:38:07 PDT
Created attachment 610878 [details] [diff] [review]
Working patch

The patch from the remote-debug repo.
Comment 2 Rob Campbell [:rc] (:robcee) 2012-03-30 10:47:52 PDT
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().
Comment 3 Panos Astithas [:past] 2012-03-30 11:07:39 PDT
(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!
Comment 4 Panos Astithas [:past] 2012-04-02 21:42:45 PDT
*** Bug 741331 has been marked as a duplicate of this bug. ***
Comment 5 Panos Astithas [:past] 2012-04-10 10:24:24 PDT
Created attachment 613659 [details] [diff] [review]
Working patch v2

Updated to use a regex.
Comment 6 Victor Porof [:vporof][:vp] 2012-04-14 02:53:10 PDT
(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 7 Rob Campbell [:rc] (:robcee) 2012-04-16 02:57:41 PDT
Comment on attachment 613659 [details] [diff] [review]
Working patch v2

rebasing is easy!
Comment 8 Panos Astithas [:past] 2012-04-17 03:14:12 PDT
Rebased and landed:

https://hg.mozilla.org/integration/fx-team/rev/0319eb7b084a
Comment 9 Rob Campbell [:rc] (:robcee) 2012-04-17 10:48:41 PDT
https://hg.mozilla.org/mozilla-central/rev/0319eb7b084a

Note You need to log in before you can comment on or make changes to this bug.