Bug 171041 - We incorrectly throw a syntax error when declaring a top level for-loop iteration variable the same as a parameter
Summary: We incorrectly throw a syntax error when declaring a top level for-loop itera...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified macOS 10.12
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-19 22:17 PDT by Rob Stutton
Modified: 2021-10-03 16:15 PDT (History)
20 users (show)

See Also:


Attachments
patch (11.09 KB, patch)
2017-05-21 15:10 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (11.09 KB, patch)
2017-05-21 15:19 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Stutton 2017-04-19 22:17:54 PDT
I wouldn't write code like this (below) myself, but it was emitted by the minifier and so my app doesn't work in Safari, or Safari TP.
The code looks legal to me ...

let e = e => {
    console.log(e);
    for (let e of [1, 2, 3]) // Cannot declare a let variable twice: 'e'.
        console.log(e);
};
Comment 1 Saam Barati 2017-04-21 15:04:24 PDT
(In reply to Rob Stutton from comment #0)
> I wouldn't write code like this (below) myself, but it was emitted by the
> minifier and so my app doesn't work in Safari, or Safari TP.
> The code looks legal to me ...
> 
> let e = e => {
>     console.log(e);
>     for (let e of [1, 2, 3]) // Cannot declare a let variable twice: 'e'.
>         console.log(e);
> };

Yeah this looks like it should not be a syntax error, however, I think this should be:
```
let x = (e) => { let e; }
```

I bet the code that ensures that the above is a syntax error is kicking in when it shouldn't be.
Comment 2 Radar WebKit Bug Importer 2017-05-09 12:15:22 PDT
<rdar://problem/32082516>
Comment 3 Saam Barati 2017-05-21 15:10:04 PDT
Created attachment 310818 [details]
patch
Comment 4 Build Bot 2017-05-21 15:13:02 PDT
Attachment 310818 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ChangeLog:13:  Line contains tab character.  [whitespace/tab] [5]
ERROR: Source/JavaScriptCore/ChangeLog:20:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Saam Barati 2017-05-21 15:19:51 PDT
Created attachment 310819 [details]
patch
Comment 6 Yusuke Suzuki 2017-05-21 22:04:44 PDT
Comment on attachment 310819 [details]
patch

r=me
Comment 7 WebKit Commit Bot 2017-05-21 22:47:36 PDT
Comment on attachment 310819 [details]
patch

Clearing flags on attachment: 310819

Committed r217200: <http://trac.webkit.org/changeset/217200>
Comment 8 WebKit Commit Bot 2017-05-21 22:47:38 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Piotrek Koszuliński (Reinmar) 2017-09-05 02:18:01 PDT
How can this patch be not released yet (in a stable channel)? Since May? It will cause most of apps written in minified ES6 to fail.
Comment 11 lasalep 2020-10-04 06:07:03 PDT
I notice an error while getting mystic messenger answers online</a>, can anybody check it and solve it for me. It would be really helpful! Ref: https://mysticmessengeremail.org/
Comment 12 manish108 2021-06-21 07:09:01 PDT
uldn't write code like this (below) myself, but it was emitted by the minifier and so my app doesn't work in Safari, or Safari TP.
The code looks legal to me ...

let e = e => {
    console.log(e);
    for (let e of
https://www.youtubemp3.info/
https://www.convertisseuryoutube.info/
https://www.convertidor.site/
https://www.youtubetomp3.club/
https://www.mysticmessenger.xyz/
Comment 13 manish108 2021-06-21 07:10:00 PDT
I notice an error while getting mystic messenger answers online</a>, can anybody check it and solve it for me. It would be really helpful! Ref:
https://www.youtubemp3.info/
https://www.convertisseuryoutube.info/
https://www.convertidor.site/
https://www.youtubetomp3.club/
https://www.mysticmessenger.xyz/
Comment 14 manish108 2021-06-21 07:12:46 PDT
 wouldn't write code like this (below) myself, but it was emitted by the minifier and so my app doesn't work in Safari, or Safari TP.
The code looks legal to me ...

let e = e => {
    console.log(e);
    for (let e of [1, 2, 3]) // Cannot declare a let variable twice: 'e'.
        console.log(e);
};

<p><a href="https://www.youtubemp3.info/">youtubemp3</a></p>
<p><a href="https://www.convertisseuryoutube.info/">convertisseuryoutube</a></p>
<p><a href="https://www.convertidor.site/">convertidor</a></p>
<p><a href="https://www.youtubetomp3.club/">youtubetomp3</a></p>
<p><a href="https://www.mysticmessenger.xyz/">mysticmessenger</a></p>
Comment 15 gloria 2021-10-03 16:15:39 PDT
Un moyen facile d'accéder à vos nouveaux locaux commerciaux
Recherche de locaux commerciaux à louer partout en France

[https://www.matchoffice.es/alquilar/centros-de-negocios/bilbao

]alquiler oficinas bilbao[/url]