Debian Codegraph @

js/src/tests/test262/language/expressions/greater-than-or-equal/S11.8.4_A3.1_T2.5.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 If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String,
7 then operator x >= y returns ToNumber(x) >= ToNumber(y)
8 es5id: 11.8.4_A3.1_T2.5
9 description: >
10 Type(Primitive(x)) is different from Type(Primitive(y)) and both
11 types vary between String (primitive or object) and Boolean
12 (primitive and object)
13 ---*/
14
15 //CHECK#1
16 if (true >= "1" !== true) {
17 throw new Test262Error('#1: true >= "1" === true');
18 }
19
20 //CHECK#2
21 if ("1" >= true !== true) {
22 throw new Test262Error('#2: "1" >= true === true');
23 }
24
25 //CHECK#3
26 if (new Boolean(true) >= "1" !== true) {
27 throw new Test262Error('#3: new Boolean(true) >= "1" === true');
28 }
29
30 //CHECK#4
31 if ("1" >= new Boolean(true) !== true) {
32 throw new Test262Error('#4: "1" >= new Boolean(true) === true');
33 }
34
35 //CHECK#5
36 if (true >= new String("1") !== true) {
37 throw new Test262Error('#5: true >= new String("1") === true');
38 }
39
40 //CHECK#6
41 if (new String("1") >= true !== true) {
42 throw new Test262Error('#6: new String("1") >= true === true');
43 }
44
45 //CHECK#7
46 if (new Boolean(true) >= new String("1") !== true) {
47 throw new Test262Error('#7: new Boolean(true) >= new String("1") === true');
48 }
49
50 //CHECK#8
51 if (new String("1") >= new Boolean(true) !== true) {
52 throw new Test262Error('#8: new String("1") >= new Boolean(true) === true');
53 }
54
55 reportCompare(0, 0);