|
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 the production x = x * y |
|
6 * |
|
7 * @path ch11/11.13/11.13.2/S11.13.2_A4.1_T1.1.js |
|
8 * @description Type(x) and Type(y) vary between primitive boolean and Boolean object |
|
9 */ |
|
10 |
|
11 //CHECK#1 |
|
12 x = true; |
|
13 x *= true; |
|
14 if (x !== 1) { |
|
15 $ERROR('#1: x = true; x *= true; x === 1. Actual: ' + (x)); |
|
16 } |
|
17 |
|
18 //CHECK#2 |
|
19 x = new Boolean(true); |
|
20 x *= true; |
|
21 if (x !== 1) { |
|
22 $ERROR('#2: x = new Boolean(true); x *= true; x === 1. Actual: ' + (x)); |
|
23 } |
|
24 |
|
25 //CHECK#3 |
|
26 x = true; |
|
27 x *= new Boolean(true); |
|
28 if (x !== 1) { |
|
29 $ERROR('#3: x = true; x *= new Boolean(true); x === 1. Actual: ' + (x)); |
|
30 } |
|
31 |
|
32 //CHECK#4 |
|
33 x = new Boolean(true); |
|
34 x *= new Boolean(true); |
|
35 if (x !== 1) { |
|
36 $ERROR('#4: x = new Boolean(true); x *= new Boolean(true); x === 1. Actual: ' + (x)); |
|
37 } |
|
38 |