summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/new-bound-function.js
blob: 49d06d8c3c51e5f1e1543e16d039b5ec55067dd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var funProto = Function.prototype;
assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);

function Point(x, y) { this.x = x; this.y = y; }

var YAxisPoint = Point.bind(null, 0);

assertEq(YAxisPoint.prototype, undefined);

var oldPoint;
for (var i = 0, sz = 9; i < sz; oldPoint = point, i++)
{
  var point = new YAxisPoint(5);
  assertEq(point === oldPoint, false);
  assertEq(point.x, 0);
  assertEq(point.y, 5);
  assertEq(Object.getOwnPropertyDescriptor(funProto, "prototype"), undefined);
  assertEq(Object.getOwnPropertyDescriptor(YAxisPoint, "prototype"), undefined);
}