New issue
Advanced search Search tips

Issue 817777 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Inconsistent results for both Array.prototype.includes & Array.prototype.indexOf across OS (Mac/Win)

Reported by t...@tradelab.fr, Mar 1 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36

Steps to reproduce the problem:
Enter following code in Chrome console:

const validTypes = ['application/vnd.ms-excel.sheet.macroenabled.12'];
const ext = 'application/vnd.ms-excel.sheet.macroEnabled.12';

validTypes.includes(ext)

validTypes.indexOf(ext) > -1

What is the expected behavior?
Returned value should be the same across operating systems running same Chrome browser version.

What went wrong?
Both methods returns true with MacOS, and both methods returns false with Windows 10

Did this work before? N/A 

Chrome version: 64.0.3282.186  Channel: stable
OS Version: OS X 10.13.3
Flash Version: 

Both methods are case sensitive with Chrome on Win10. I must confess i lost a fair amount of my hairs on this one guys.
 

Comment 1 by woxxom@gmail.com, Mar 1 2018

Both methods must be case-sensitive as per the specification:
https://www.ecma-international.org/ecma-262/7.0/#sec-array.prototype.includes
https://tc39.github.io/ecma262/#sec-array.prototype.includes

  * If SameValueZero(searchElement, elementK) is true, return true.
  * SameValueZero returns SameValueNonNumber(x, y) when x and y have the same string type
  * SameValueNonNumber for strings returns true if x and y are *exactly the same sequence of code units*

If Chrome on MacOS performs a case-insensitive comparison, it is certainly a bug.
Components: -Blink Blink>JavaScript
Labels: OS-Windows
The second comment here seems to be in error.

The first issue seems to be JS.

Comment 3 by ajha@chromium.org, Mar 2 2018

Labels: Needs-Triage-M64
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

@Reporter: We are able to see "false" as a result, when the given code is pasted in console and hit enter across all Operating systems. As per your comment#0 which says Windows 10 returned "false" while Mac returned "true". But we observed even Mac returning "false" after pasting the code and hitting enter. Attaching the screen shot from Mac OS for reference.

Please have a look at the screen shot and let us know if anything missed from our end. Your inputs helps us to triage the issue in a better way.
817777.png
797 KB View Download
Status: WontFix (was: Unconfirmed)
Mac triage: WontFix old issue with no repro.

Sign in to add a comment