Good catch and thanks for the correction! The take-home from the example is that: due to the global lexical scope, a TDZ error could arise later due to newly introduced bindings.
On Thu, Sep 17, 2015 at 7:34 PM, Boris Zbarsky <bzbar...@mit.edu> wrote: > On 9/17/15 8:26 PM, Shu-yu Guo wrote: > >> The first call to f() does not throw. >> > > It actually does, because the bareword lookup for "x" fails. You get > "ReferenceError: x is not defined". > > If you replaced "x" with "window.x" or "self.x" or "this.x" or something I > think you'd get the behavior you describe. > > -Boris > > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > -- shu _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform