WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 193347
202044
Block scoped variables should be visible across scripts
https://bugs.webkit.org/show_bug.cgi?id=202044
Summary
Block scoped variables should be visible across scripts
Paulius Varna
Reported
2019-09-20 05:49:01 PDT
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>
Attachments
Add attachment
proposed patch, testcase, etc.
Paulius Varna
Comment 1
2019-09-20 05:50:49 PDT
On Safari 12.1, 13 and 13.1 throws error at console.log({ two }). It shouldn't.
Radar WebKit Bug Importer
Comment 2
2019-09-20 09:58:08 PDT
<
rdar://problem/55563029
>
Yusuke Suzuki
Comment 3
2021-06-24 18:20:45 PDT
Fixed in
bug 193347
*** This bug has been marked as a duplicate of
bug 193347
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug