Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/compound-assignment/S11.13.2_A4.2_T2.8.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: The production x /= y is the same as x = x / y
6 es5id: 11.13.2_A4.2_T2.8
7 description: >
8 Type(x) is different from Type(y) and both types vary between
9 Boolean (primitive or object) and Undefined
10 ---*/
11
12 var x;
13
14 //CHECK#1
15 x = true;
16 x /= undefined;
17 if (isNaN(x) !== true) {
18 $ERROR('#1: x = true; x /= undefined; x === Not-a-Number. Actual: ' + (x));
19 }
20
21 //CHECK#2
22 x = undefined;
23 x /= true;
24 if (isNaN(x) !== true) {
25 $ERROR('#2: x = undefined; x /= true; x === Not-a-Number. Actual: ' + (x));
26 }
27
28 //CHECK#3
29 x = new Boolean(true);
30 x /= undefined;
31 if (isNaN(x) !== true) {
32 $ERROR('#3: x = new Boolean(true); x /= undefined; x === Not-a-Number. Actual: ' + (x));
33 }
34
35 //CHECK#4
36 x = undefined;
37 x /= new Boolean(true);
38 if (isNaN(x) !== true) {
39 $ERROR('#4: x = undefined; x /= new Boolean(true); x === Not-a-Number. Actual: ' + (x));
40 }