summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js
blob: 18b8888ee76107a133ed4f8ceb2f20cc727f212c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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.lastindexof
es5id: 15.4.4.15-8-6
description: Array.prototype.lastIndexOf 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, null, true, false, undefined, _null, "null", undefined, "str", obj);

assert.sameValue(a.lastIndexOf(null), 13, 'a.lastIndexOf(null)');