summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/values.js
blob: 902a668123b841f72064f2aace637ef93100b23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/ */

if (Array.prototype.values) {
    assertEq(Array.prototype.values, Array.prototype[Symbol.iterator]);
    assertEq(Array.prototype.values.name, "values");
    assertEq(Array.prototype.values.length, 0);

    function valuesUnscopeable() {
        var values = "foo";
        with ([1, 2, 3]) {
            assertEq(indexOf, Array.prototype.indexOf);
            assertEq(values, "foo");
        }
    }
    valuesUnscopeable();
}

if (typeof reportCompare === 'function')
    reportCompare(0, 0);