Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

`/*# ... */` or `//#` in JS shouldn't matter

34 views
Skip to first unread message

Simon Lydell

unread,
Feb 7, 2014, 4:29:07 AM2/7/14
to dev-js-s...@lists.mozilla.org
Currently the spec only mentions that the `//#` syntax is allowed to link a source map to a generated JavaScript file. I think that `/*# ... */` should be allowed as well, because:

- It's weird that only one type of comment works. Any type of comment in any type of language at the end of a file on its own line that starts with `# sourceMappingURL=` should work.

- In reality, source maps are only used by JavaScript and CSS. It would be really nice if tools working with source maps didn't have to care whether a file is CSS or JavaScript. If it wants to add a sourceMappingURL it can just add `\n/*# sourceMappingURL=... */` and be done with it.

- Firefox already supports it. (Chrome is a bit weird: It allows either `//#` or `/*\n//# ... \n*/`)

simon....@gmail.com

unread,
Feb 7, 2014, 4:52:37 AM2/7/14
to

Fitzgerald, Nick

unread,
Feb 7, 2014, 12:40:14 PM2/7/14
to dev-js-s...@lists.mozilla.org
> _______________________________________________
> dev-js-sourcemap mailing list
> dev-js-s...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-js-sourcemap
+1

simon....@gmail.com

unread,
Jun 19, 2014, 5:07:28 PM6/19/14
to mozilla-dev-...@lists.mozilla.org
If you really like this proposal, you have to add it to the spec. Chromium likely won't add it otherwise[1].

[1]: https://code.google.com/p/chromium/issues/detail?id=341807#c2
0 new messages