Module naming and declarations

Anne van Kesteren annevk at annevk.nl
Mon May 6 17:40:26 PDT 2013


On Mon, May 6, 2013 at 4:39 PM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> And this "weird" behavior is hardly without precedent: aren't *all*
> other URLs a script deals with, including the existing APIs for
> loading other scripts (adding a <script> tag or loading the code with
> an XHR), resolved relative to the document base URL?

Typically the entry script's base URL, which can be different in
cross-document scenarios. And for XMLHttpRequest it's the document
associated with its constructor object (which annoyingly is somewhat
different from the rest).


> Good point. It can do what XHR does in workers: use the script's base
> url. (If the site happens to have a single directory for serving
> static js, and the worker script happens to be in it, that's
> especially convenient.)

So now you have two conventions...


--
http://annevankesteren.nl/


More information about the es-discuss mailing list