Closed
Bug 849069
Opened 13 years ago
Closed 12 years ago
relative source map URLs should be resolved according to the spec's rules
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 23
People
(Reporter: fitzgen, Assigned: fitzgen)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
22.97 KB,
patch
|
Details | Diff | Splinter Review |
The rules for relative source map URL resolution are defined here: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#heading=h.lmz475t4mvbx
![]() |
Assignee | |
Updated•13 years ago
|
Blocks: dbg-sourcemap
![]() |
Assignee | |
Comment 1•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=fc0d64ce4468
Updating the source map library in bug 772119 fixed the issues I was having with this patch! Woo!
Verified that using coffeescript's defaults results in debuggable coffescript files without needing to play with urls or source roots or anything!
Attachment #730378 -
Flags: review?(past)
Comment 2•13 years ago
|
||
Comment on attachment 730378 [details] [diff] [review]
v1
Review of attachment 730378 [details] [diff] [review]:
-----------------------------------------------------------------
This doesn't seem to work as expected in this test case:
http://astithas.com/test/coffee/binary_search.html
With the patch from bug 849071 I get a 404 for the coffee script file, when I toggle between original and generated sources.
::: toolkit/devtools/debugger/server/dbg-script-actors.js
@@ +506,5 @@
> return locationPromise.then(function (aLocation) {
> let line = aLocation.line;
> + if (this.dbg.findScripts({ url: aLocation.url }).length == 0 ||
> + line < 0 ||
> + line === null) {
Why not line == null to catch undefined, too?
@@ +2431,5 @@
> return {
> url: source,
> line: line
> };
> + }.bind(this));
This is not necessary, there is no reference to |this| in this function.
Attachment #730378 -
Flags: review?(past)
![]() |
Assignee | |
Comment 3•13 years ago
|
||
(In reply to Panos Astithas [:past] from comment #2)
> Comment on attachment 730378 [details] [diff] [review]
> v1
>
> Review of attachment 730378 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> This doesn't seem to work as expected in this test case:
>
> http://astithas.com/test/coffee/binary_search.html
>
> With the patch from bug 849071 I get a 404 for the coffee script file, when
> I toggle between original and generated sources.
What is happening is that we are hitting this issue: https://github.com/mozilla/source-map/issues/43
Will fix.
>
> ::: toolkit/devtools/debugger/server/dbg-script-actors.js
> @@ +506,5 @@
> > return locationPromise.then(function (aLocation) {
> > let line = aLocation.line;
> > + if (this.dbg.findScripts({ url: aLocation.url }).length == 0 ||
> > + line < 0 ||
> > + line === null) {
>
> Why not line == null to catch undefined, too?
The source map lib will always return null, so I thought we could do strict equality, but I now realize that if there isn't a source map, we return what we were given so it could indeed be undefined. Will change.
>
> @@ +2431,5 @@
> > return {
> > url: source,
> > line: line
> > };
> > + }.bind(this));
>
> This is not necessary, there is no reference to |this| in this function.
Good catch.
Will have a new patch up soon.
![]() |
Assignee | |
Comment 4•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=8a5a2640e991
* Updated to the latest mozilla/source-map
* This fixes the issues with joining relative paths to their root that you were experiencing.
* Added two more xpcshell tests
* One for making sure absolute source map urls work
* One for making sure that relative source map urls work
* Added changes suggested in last review.
Attachment #730378 -
Attachment is obsolete: true
Attachment #732194 -
Flags: review?(past)
Comment 5•13 years ago
|
||
Comment on attachment 732194 [details] [diff] [review]
v2
Clearing review until the oranges are dealt with.
Attachment #732194 -
Flags: review?(past)
![]() |
Assignee | |
Comment 6•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=d0b7589b17e0
Rebased on the new patch for bug 772119
Attachment #732194 -
Attachment is obsolete: true
Attachment #734104 -
Flags: review?(past)
Comment 7•13 years ago
|
||
Comment on attachment 734104 [details] [diff] [review]
V3
Review of attachment 734104 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/devtools/debugger/server/dbg-script-actors.js
@@ +2364,5 @@
> }
>
> return this.sourceMap(aScript)
> + .then((aSourceMap) => {
> + return [this.source(s) for (s of aSourceMap.sources)];
You could probably get rid of the braces and the |return| here if you care.
Attachment #734104 -
Flags: review?(past) → review+
![]() |
Assignee | |
Comment 8•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=3ddd5d28881d
* Removed the brackets+return that Panos mentioned
* Disabled source map tests that rely on file:// urls in b2g
Attachment #734104 -
Attachment is obsolete: true
![]() |
Assignee | |
Updated•12 years ago
|
Whiteboard: [land-in-fx-team]
![]() |
Assignee | |
Comment 9•12 years ago
|
||
> * Disabled source map tests that rely on file:// urls in b2g
Just want to note that this is what Panos and I decided upon in an irc conversation, for posterity.
Comment 10•12 years ago
|
||
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Comment 11•12 years ago
|
||
Backed out on suspicion of mochitest-chrome leaks:
https://hg.mozilla.org/integration/fx-team/rev/4ca11b942d5a
Whiteboard: [fixed-in-fx-team]
Comment 12•12 years ago
|
||
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [fixed-in-fx-team]
![]() |
||
Comment 13•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 23
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•