On Sun, Oct 19, 2014 at 7:48 PM, Domenic Denicola < [email protected]> wrote:
> From: es-discuss [mailto:[email protected]] On Behalf Of > Mark Volkmann > > > Can we say anything more concrete if we restrict the discussion to > modern browsers as opposed to non-browser ES engines? Is it fair to say > that in those environments a file will always be treated as a module if it > is imported by another file that the browser has loaded? > > Concretely, the plan of record (which may change as implementation > realities descend upon us) is: > > - Any code inside `<script type="module">` will be parsed as a module > - Any code inside `<module>` will be parsed as a module, if we can get > away with the relevant parser change > We cannot. Ian Hickson pointed out the compat/security problems with trying to introduce such a tag, and they are fatal. We discussed them here and IIRC no one had a workable answer. IIRC, the browser rules for skipping element content of unrecognized elements is not compatible with the rules for parsing the element content of the <module> tag. This difference would make the web vulnerable to a new class of injection attacks. For all new standard tags, browsers that recognize these tags and browsers that do not must agree on when the element is done. If anyone has a link to the prior discussion, please post. > - Any code which is imported, e.g. via an `import` statement inside > another module, or via a `System.import` call in a script or module, will > be parsed as a module > > That basically leaves any code inside of or loaded by a > non-`type="module"` `<script>` as script code, with all others module code. > > +Dave to correct me if I got any of this wrong. > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

