js/src/tests/test262/ch11/11.13/11.13.2/S11.13.2_A4.3_T2.4.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:9411f89dd361
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 * The production x %= y is the same as x = x % y
6 *
7 * @path ch11/11.13/11.13.2/S11.13.2_A4.3_T2.4.js
8 * @description Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined
9 */
10
11 //CHECK#1
12 x = 1;
13 x %= undefined;
14 if (isNaN(x) !== true) {
15 $ERROR('#1: x = 1; x %= undefined; x === Not-a-Number. Actual: ' + (x));
16 }
17
18 //CHECK#2
19 x = undefined;
20 x %= 1;
21 if (isNaN(x) !== true) {
22 $ERROR('#2: x = undefined; x %= 1; x === Not-a-Number. Actual: ' + (x));
23 }
24
25 //CHECK#3
26 x = new Number(1);
27 x %= undefined;
28 if (isNaN(x) !== true) {
29 $ERROR('#3: x = new Number(1); x %= undefined; x === Not-a-Number. Actual: ' + (x));
30 }
31
32 //CHECK#4
33 x = undefined;
34 x %= new Number(1);
35 if (isNaN(x) !== true) {
36 $ERROR('#4: x = undefined; x %= new Number(1); x === Not-a-Number. Actual: ' + (x));
37 }
38

mercurial