summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/indexOf/fromindex-zero-conversion.js
blob: 721d5db763e3865ea4c4fa68c34d1f55ec232045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2016 The V8 project authors. All rights reserved.
// This code is governed by the license found in the LICENSE file.
/*---
esid: sec-array.prototype.indexof
description: >
  Return +0 when fromIndex is -0 and return index refers to the first position
info: |
  22.1.3.12 Array.prototype.indexOf ( searchElement [ , fromIndex ] )

  ...
  6. If n ≥ 0, then
    a. If n is -0, let k be +0; else let k be n.
  ...
---*/

assert.sameValue(1 / [true].indexOf(true, -0), +Infinity)

reportCompare(0, 0);