Calling a function containing a for-of over a non-iterable value twice produces 2 different error messages
Reported by
dfshep...@gmail.com,
Jun 28 2018
|
|||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Steps to reproduce the problem:
1. Execute this code:
```js
function f() {for (b of null);};
for (i = 3; i--;) setTimeout(f);
```
2. Observe the error messages logged in console.
3. The first message will be `Uncaught TypeError: null is not iterable`, but the second (and third, and so-on) will be `Uncaught TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null`.
What is the expected behavior?
The same error message should be returned for the same error message every time.
What went wrong?
A different error message is produced only for the first time an erroneous function is called. Further calls produce the other error message.
Did this work before? N/A
Chrome version: 67.0.3396.99 Channel: stable
OS Version: 10.0
Flash Version:
This is really minor, since there's nothing functionally wrong, but it did strike me as important enough to report, because it caused me to have to re-investigate several dozen lines of code due to believing I must be mutating state unintentionally somewhere to cause the same code to produce 2 different error messages.
,
Jun 30 2018
,
Jul 6
Tried to reproduce the issue on reported version 67.0.3396.99. on Windows 10 Executed the above function on DevTools -> console, and everytime we run this code,the error messages as `Uncaught TypeError: null is not iterable` and `Uncaught TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null` are coming up. Attached screenshot for reference. Reporter@ Can you please check and confirm if this is the issue seen. Thanks !
,
Jul 6
I am indeed seeing the same issue. I should have been more clear that this seems to be on a per-function basis, and effectively resets when you re-declare function f. I've attached a screenshot showing the same pattern.
,
Jul 6
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 9
,
Jul 9
,
Jul 10
As per comment#3 able to reproduce issue on reported version #67.0.3396.99 and on #60.0.3072.0(M-60) also.This is a non-regression issue as it is observed from M60 old builds. Attached screenshot for reference. Removing Needs-Bisect label as the issue is seen from M-60. Please feel free to add Needs-Bisect label if you need further bisect information from our end. Thanks...!!
,
Jul 17
,
Aug 16
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by vamshi.kommuri@chromium.org
, Jun 29 2018