js/src/tests/test262/ch12/12.6/12.6.1/S12.6.1_A1.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:b8340200c1e9
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 * When the production "do Statement while ( Expression )" is evaluated, Statement is evaluated first
6 *
7 * @path ch12/12.6/12.6.1/S12.6.1_A1.js
8 * @description Evaluating various Expressions
9 */
10
11 var __in__do;
12
13 do __in__do=1; while ( false );
14
15 //////////////////////////////////////////////////////////////////////////////
16 //CHECK#1
17 if (__in__do!==1) {
18 $ERROR('#1: false evaluates to false');
19 }
20 //
21 //////////////////////////////////////////////////////////////////////////////
22
23 do __in__do=2; while ( 0 );
24
25 //////////////////////////////////////////////////////////////////////////////
26 //CHECK#2
27 if (__in__do!==2) {
28 $ERROR('#2: 0 evaluates to false');
29 }
30 //
31 //////////////////////////////////////////////////////////////////////////////
32
33 do __in__do=3; while ( "" );
34
35 //////////////////////////////////////////////////////////////////////////////
36 //CHECK#3
37 if (__in__do!==3) {
38 $ERROR('#3: "" evaluates to false');
39 }
40 //
41 //////////////////////////////////////////////////////////////////////////////
42

mercurial