Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Boolean/S15.6.2.1_A2.js

raw
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 Boolean prototype object, the one that is the
8 initial value of Boolean.prototype
9 esid: sec-boolean-constructor
10 es5id: 15.6.2.1_A2
11 description: Checking prototype property of the newly created object
12 ---*/
13
14 // CHECK#1
15 var x1 = new Boolean(1);
16 if (typeof x1.constructor.prototype !== "object") {
17 $ERROR('#1: typeof x1.constructor.prototype === "object"');
18 }
19
20 //CHECK#2
21 var x2 = new Boolean(2);
22 if (!Boolean.prototype.isPrototypeOf(x2)) {
23 $ERROR('#2: Boolean.prototype.isPrototypeOf(x2)');
24 }
25
26 //CHECK#3
27 var x3 = new Boolean(3);
28 if (Boolean.prototype !== x3.constructor.prototype) {
29 $ERROR('#3: Boolean.prototype === x3.constructor.prototype');
30 }