Garrett Smith (2014-06-10T21:31:06.000Z)
domenic at domenicdenicola.com (2014-06-17T20:39:55.682Z)
On 6/10/14, Ian Hickson <ian at hixie.ch> wrote: > Do you have an example of how any of those steps could fail? I'm guessing that applies for any early error. ```html <script> var tew; continue; // early error; `tew` is not bound. </script> <script> alert(rrq); var rrq; g; // ReferenceError, not an early error; `rrq` is bound. </script> ``` The following example results in a ReferenceError. Although `gv` is defined, that does not occur until the subsequent <script>. After the browser has reached the first </script>, the Program is evaluated, and at that point, the global Lexical Environment Record does not have a `gv` property. Where and how is this behavior described? ```html <script>alert(gv); // context to subsequent script is segmented. </script> <script>var gv;</script> ``` I vaguely remember seeing examples more complex than the example above, including dealings with the global scope polluter, and with more divergent behavior. Moving `gv` to the same script results results in no such runtime error, as is explained in ES3. ```html <script> alert(gv); // contiguous context in same script. var gv; </script> ```