Search code examples
javascriptfirefoxsource-maps

sourceURL in Firefox 24 doesn't seem to work


I can't get //# sourceURL comments to work in Firefox 24.

Here is test.html:

<html>
<script src="test.js"></script>

And here is test.js:

document.write('<p>hello</p>');

//# sourceURL=one.js

var fn;

fn = eval("(function two() { console.log(1); })\n//# sourceURL=two.js");
fn.call();

fn = new Function([], "console.log(2);\n//# sourceURL=three.js");
fn.call();

If this were to work, I should see three files in the Firefox debugger: one.js, two.js, and three.js. However, the debugger shows me one file, test.js:

firefox debugger

Any clues as to what I've missed?


Solution

  • Nope, sourceURL isn't implemented in Firefox yet.

    See Bug 904144 (engine), Bug 833744 (frontend).

    However, Firebug seems to support it.