Debian Codegraph @

js/src/tests/test262/language/expressions/greater-than/S11.8.2_A3.2_T1.2.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 String and Type(Primitive(y)) is String, then
7 operator x > y returns ToString(x) > ToString(y)
8 es5id: 11.8.2_A3.2_T1.2
9 description: >
10 Type(Primitive(x)) and Type(Primitive(y)) vary between Object
11 object and Function object
12 ---*/
13
14 //CHECK#1
15 if (({} > function(){return 1}) !== ({}.toString() > function(){return 1}.toString())) {
16 throw new Test262Error('#1: ({} > function(){return 1}) === ({}.toString() > function(){return 1}.toString())');
17 }
18
19 //CHECK#2
20 if ((function(){return 1} > {}) !== (function(){return 1}.toString() > {}.toString())) {
21 throw new Test262Error('#2: (function(){return 1} > {}) === (function(){return 1}.toString() > {}.toString())');
22 }
23
24 //CHECK#3
25 if ((function(){return 1} > function(){return 1}) !== (function(){return 1}.toString() > function(){return 1}.toString())) {
26 throw new Test262Error('#3: (function(){return 1} > function(){return 1}) === (function(){return 1}.toString() > function(){return 1}.toString())');
27 }
28
29 //CHECK#4
30 if (({} > {}) !== ({}.toString() > {}.toString())) {
31 throw new Test262Error('#4: ({} > {}) === ({}.toString() > {}.toString())');
32 }
33
34 reportCompare(0, 0);