|
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 * Since LineTerminator(LT) between Postfix Increment/Decrement Operator(I/DO) and operand is admitted, |
|
6 * Additive/Substract Operator(A/SO) in combination with I/DO separated by LT or white spaces after automatic semicolon insertion gives valid result |
|
7 * |
|
8 * @path ch07/7.9/S7.9_A5.8_T1.js |
|
9 * @description Try use Variable1 \n + \n ++ \n Variable2 construction |
|
10 */ |
|
11 |
|
12 var x=0, y=0; |
|
13 var z= |
|
14 x |
|
15 + |
|
16 ++ |
|
17 y |
|
18 |
|
19 ////////////////////////////////////////////////////////////////////////////// |
|
20 //CHECK#1 |
|
21 if ((z!==1)&&(y!==1)&&(x!==0)) { |
|
22 $ERROR('#1: '); |
|
23 } |
|
24 // |
|
25 ////////////////////////////////////////////////////////////////////////////// |
|
26 |
|
27 z= |
|
28 x |
|
29 + ++ |
|
30 y |
|
31 |
|
32 ////////////////////////////////////////////////////////////////////////////// |
|
33 //CHECK#2 |
|
34 if ((z!==2)&&(y!==2)&&(x!==0)) { |
|
35 $ERROR(''); |
|
36 } |
|
37 // |
|
38 ////////////////////////////////////////////////////////////////////////////// |
|
39 |
|
40 z= |
|
41 x |
|
42 + ++ |
|
43 y |
|
44 |
|
45 ////////////////////////////////////////////////////////////////////////////// |
|
46 //CHECK#3 |
|
47 if ((z!==3)&&(y!==3)&&(x!==0)) { |
|
48 $ERROR(''); |
|
49 } |
|
50 // |
|
51 ////////////////////////////////////////////////////////////////////////////// |
|
52 |