Const and let should be scoped to global context if used in top level script. (warning, global context is not the same as global object). Explanation: https://www.youtube.com/watch?v=5LEuJNLfLN0 Reproduction: <script> var one = true; const two = true; </script> <script type="module"> var three = true; const four = true; </script> <script type="module"> console.log({ one }); console.log({ two }); console.log({ three }); // should throw console.log({ four }); // should throw </script>
On Safari 12.1, 13 and 13.1 throws error at console.log({ two }). It shouldn't.
<rdar://problem/55563029>
Fixed in bug 193347 *** This bug has been marked as a duplicate of bug 193347 ***