js/src/jit-test/tests/basic/new-bound-function.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/new-bound-function.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +var funProto = Function.prototype;
     1.5 +assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);
     1.6 +
     1.7 +function Point(x, y) { this.x = x; this.y = y; }
     1.8 +
     1.9 +var YAxisPoint = Point.bind(null, 0);
    1.10 +
    1.11 +assertEq(YAxisPoint.prototype, undefined);
    1.12 +
    1.13 +var oldPoint;
    1.14 +for (var i = 0, sz = 9; i < sz; oldPoint = point, i++)
    1.15 +{
    1.16 +  var point = new YAxisPoint(5);
    1.17 +  assertEq(point === oldPoint, false);
    1.18 +  assertEq(point.x, 0);
    1.19 +  assertEq(point.y, 5);
    1.20 +  assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);
    1.21 +  assertEq(Object.getOwnPropertyDescriptor(YAxisPoint, "prototype"), undefined);
    1.22 +}
    1.23 +

mercurial