summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js
blob: 45f95bb47b75f77a83b0914372f1f0c7e4158303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-array.prototype.indexof
description: Array.prototype.indexOf must return correct index(null)
---*/

var obj = {
  toString: function() {
    return null
  }
};
var _null = null;
var a = new Array(true, undefined, 0, false, _null, 1, "str", 0, 1, obj, true, false, null);

assert.sameValue(a.indexOf(null), 4, 'a[4]=_null');

reportCompare(0, 0);