summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testCallProtoMethod.js
blob: cd0be83cc8c48f3f17c94160792c35a7c3bb46cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function testCallProtoMethod() {
    function X() { this.x = 1; }
    X.prototype.getName = function () { return "X"; }

    function Y() { this.x = 2; }
    Y.prototype.getName = function() "Y";

    var a = [new X, new X, new X, new X, new Y];
    var s = '';
    for (var i = 0; i < a.length; i++)
        s += a[i].getName();
    return s;
}
assertEq(testCallProtoMethod(), 'XXXXY');