Closed Bug 1568330 Opened 5 years ago Closed 5 years ago

for..in loop delivers `rsplit` property in strings

Categories

(Core :: JavaScript: Standard Library, defect)

68 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED INVALID

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
Summary: for..in loop delivers `rsplit` property for strings → for..in loop delivers `rsplit` property in strings

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

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

Flags: needinfo?(alexkilian96)

Also, where do you run the code? in the web console after opening about:blank?

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!

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(alexkilian96)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.