summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js
blob: a3ef08822e0e725c30bf50eb42c1a2c51c0250b9 (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
// 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.16-1-13
description: Array.prototype.every applied to the JSON object
includes: [runTestCase.js]
---*/

function testcase() {
        function callbackfn(val, idx, obj) {
            return ('[object JSON]' !== Object.prototype.toString.call(obj));
        }

        try {
            JSON.length = 1;
            JSON[0] = 1;
            return !Array.prototype.every.call(JSON, callbackfn);
        } finally {
            delete JSON.length;
            delete JSON[0];
        }
    }
runTestCase(testcase);