Bug 213244 - Variables declared with "let" keyword are not recognized by separate .js files
Summary: Variables declared with "let" keyword are not recognized by separate .js files
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 13
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-16 05:11 PDT by Farley Reynolds
Modified: 2020-06-17 22:32 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Farley Reynolds 2020-06-16 05:11:23 PDT
If a variable is declared at the global level with the "let" keyword, functions in other files cannot access it.

If the declaration is changed to use the "var" keyword, the other files are able to access it.

This issue seems to arise when a JavaScript module calls the function that requires the global variable.

I was able to confirm that no other browsers display the issue with the "let" keyword.
Comment 1 Radar WebKit Bug Importer 2020-06-17 18:05:34 PDT
<rdar://problem/64471510>
Comment 2 Saam Barati 2020-06-17 22:32:38 PDT
(In reply to Farley Reynolds from comment #0)
> If a variable is declared at the global level with the "let" keyword,
> functions in other files cannot access it.
> 
> If the declaration is changed to use the "var" keyword, the other files are
> able to access it.
> 
> This issue seems to arise when a JavaScript module calls the function that
> requires the global variable.
> 
> I was able to confirm that no other browsers display the issue with the
> "let" keyword.

Can you post an example?