>
> But if you try to modularize the code like:
>
> <script async>
> module "mod" {
>    export function getNode1() {
>       return node1
>    }
>    export function getNode2() {
>      return node2
>    }
> }
> </script>
> <div id='node1' />
> <div id='node2' />
>
> then it may randomly work or fail with an error depending upon who wins the
> race.  What seems like it should be a safe refactoring instead produces
> non-deterministic intermittent errors.
>

The code would be

    export function getNode2() {
      return document.getElementById("node2");
    }


Though which should be fine.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to