for..in loop delivers `rsplit` property in strings
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
People
(Reporter: alexkilian96, Unassigned)
Details
When iterating through the enumerable properties of a string, an rsync
property is listed despite Object.propertyIsEnumerable delivering false
for it.
A website I visited was using the for..in
loop to iterate through a string and insert thousands-separators every three characters. With this (seemingly undocumented?) property the website prints the contents of the rsync
function at the end of said number.
Steps to reproduce
Go to any website (about:blank will suffice)
Run
for(let test in 'test')
console.log(test);
Actual Output
0
1
2
3
rsync
Expected Output
0
1
2
3
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
I don't know how I messed this up through the entire description, it's kinda late.
The property in question is rsplit
as in the title and not rsync
Comment 2•5 years ago
|
||
it's likely the property is added by your extension or something.
can you test in safe mode?
https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode
Comment 3•5 years ago
|
||
Also, where do you run the code? in the web console after opening about:blank?
Reporter | ||
Comment 4•5 years ago
|
||
I started Firefox in Safe Mode as suggested and the issue was gone. I then proceeded to disable all extensions one by one which did not resolve the issue first, but after a full cache clear with all extensions disabled everything went to normal.
Funnily enough, I re-enabled all extensions now and the issue is still gone.
So, my bad for not cleaning up my browser first. Thanks for the support!
Description
•