| Summary: | Can't find variable but only when Inspector is closed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Eryk Napierała <eryk.piast> | ||||
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | mark.lam, ysuzuki | ||||
| Priority: | P2 | ||||||
| Version: | Safari 15 | ||||||
| Hardware: | Mac (Intel) | ||||||
| OS: | macOS 12 | ||||||
| URL: | https://9wu2z2.sse.codesandbox.io | ||||||
| Attachments: |
|
||||||
|
Description
Eryk Napierała
2022-09-09 08:10:04 PDT
FYI: when you remove additional parentheses around the arrow function from this line, the error stops occurring.
```
methodFactory((() => {}))
```
Same, when you remove the class instance creation (the last line of IIFE body).
I cannot reproduce this error with Safari 15.6.1 on macOS, but not Sith Safari Technology Preview 152, suggesting that the issue is already fixed in WebKit. Indeed, I cannot see this error occurring anymore in TP, checked on r151, WebKit 17615.1.1.2. Sorry for not checking before! Just out of curiosity, what was that about? Some parser edge-case, that's why after removing parentheses it was not breaking anymore? And why did it behave differently depending on whether the Inspector was open? (In reply to Eryk Napierała from comment #3) > Just out of curiosity, what was that about? Some parser edge-case, that's > why after removing parentheses it was not breaking anymore? And why did it > behave differently depending on whether the Inspector was open? Unfortunately, we don't know which change resolved this issue. So, we won't be able to explain what happened. As for the difference in behavior with the Inspector open, running with the Inspector (as it works today) open results in slightly different bytecode being generated to support debugging, and also more aggressively capturing of closures. Perhaps the more aggressive capturing of closures may have perturbed the scoping of variables and hidden the bug? Still, this is only speculation. We won't know what the real issue is unless we spend time to investigate the issue. At this point, that might not be worthwhile given that the issue appears to be resolved, and there are other bugs / features of higher priority. If you do encounter this issue again, please do file a new bug, and we'll investigate. Thanks. Sure thing. Thank you for the transparency, I totally get it. Thanks! |