summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js
blob: 70ab8e9e4c134ab84ec563b9a7baee075aff81ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.4.4.20-2-15
description: Array.prototype.filter - 'length' is property of the global object
includes: [fnGlobalObject.js]
---*/

        function callbackfn(val, idx, obj) {
            return  obj.length === 2;
        }

            var oldLen = fnGlobalObject().length;
            fnGlobalObject()[0] = 12;
            fnGlobalObject()[1] = 11;
            fnGlobalObject()[2] = 9;
            fnGlobalObject().length = 2;
            var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn);

assert.sameValue(newArr.length, 2, 'newArr.length');