summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/greater-than/S11.8.2_A2.3_T1.js
blob: 4c8b975924a5b444b76f622f272954501ef2e201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: In ES5, First expression should be evaluated first.
es5id: 11.8.2_A2.3_T1
description: Checking that operands of a "<" evaluate left-to-right
---*/

//CHECK#1
var x = { valueOf: function () { throw "x"; } };
var y = { valueOf: function () { throw "y"; } };
try {
   x > y;
   throw new Test262Error('#1.1: Should have thrown');
} catch (e) {
   if (e === "y") {
     throw new Test262Error('#1.2: First expression should be evaluated first');
   } else {
     if (e !== "x") {
       throw new Test262Error('#1.3: Failed with: ' + e);
     }
   }
}

reportCompare(0, 0);