| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
The [[Prototype]] property of the newly constructed object |
| 7 |
is set to the original Number prototype object, the one that is the |
| 8 |
initial value of Number.prototype |
| 9 |
es5id: 15.7.2.1_A2 |
| 10 |
description: Checking prototype property of the newly created objects |
| 11 |
---*/ |
| 12 |
|
| 13 |
// CHECK#1 |
| 14 |
var x1 = new Number(1); |
| 15 |
if (typeof x1.constructor.prototype !== "object") { |
| 16 |
$ERROR('#1: typeof x1.constructor.prototype === "object"'); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK#2 |
| 20 |
var x2 = new Number(2); |
| 21 |
if (!Number.prototype.isPrototypeOf(x2)) { |
| 22 |
$ERROR('#2: Number.prototype.isPrototypeOf(x2)'); |
| 23 |
} |
| 24 |
|
| 25 |
//CHECK#3 |
| 26 |
var x3 = new Number(3); |
| 27 |
if (Number.prototype !== x3.constructor.prototype) { |
| 28 |
$ERROR('#3: Number.prototype === x3.constructor.prototype'); |
| 29 |
} |