1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/testCallProtoMethod.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,14 @@ 1.4 +function testCallProtoMethod() { 1.5 + function X() { this.x = 1; } 1.6 + X.prototype.getName = function () { return "X"; } 1.7 + 1.8 + function Y() { this.x = 2; } 1.9 + Y.prototype.getName = function() "Y"; 1.10 + 1.11 + var a = [new X, new X, new X, new X, new Y]; 1.12 + var s = ''; 1.13 + for (var i = 0; i < a.length; i++) 1.14 + s += a[i].getName(); 1.15 + return s; 1.16 +} 1.17 +assertEq(testCallProtoMethod(), 'XXXXY');