summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/some/15.4.4.17-7-1.js
blob: 5935681cbcffc904e230f5f6e366e6ad0cd40573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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.some
es5id: 15.4.4.17-7-1
description: >
    Array.prototype.some considers new elements added to array after
    it is called
---*/

  var calledForThree = false;

  function callbackfn(val, idx, obj)
  {
    arr[2] = 3;
    if(val !== 3)
      calledForThree = true;

    return false;
  }

  var arr = [1,2,,4,5];

  var val = arr.some(callbackfn);

assert(calledForThree, 'calledForThree !== true');