Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/less-than-or-equal/11.8.3-3.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 11.8.3-3
6 description: >
7 11.8.3 Less-than-or-equal Operator - Partial left to right order
8 enforced when using Less-than-or-equal operator: toString <=
9 valueOf
10 ---*/
11
12 var accessed = false;
13 var obj1 = {
14 toString: function () {
15 accessed = true;
16 return 3;
17 }
18 };
19 var obj2 = {
20 valueOf: function () {
21 if (accessed === true) {
22 return 4;
23 } else {
24 return 2;
25 }
26 }
27 };
28
29 assert((obj1 <= obj2), '(obj1 <= obj2) !== true');