|
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 between "continue" and Identifier is not allowed, "continue" is evaluated without label |
|
6 * |
|
7 * @path ch12/12.7/S12.7_A2.js |
|
8 * @description Checking by using eval, inserting LineTerminator between continue and Identifier |
|
9 */ |
|
10 |
|
11 ////////////////////////////////////////////////////////////////////////////// |
|
12 //CHECK#1 |
|
13 try{ |
|
14 eval("FOR1 : for(var i=1;i<2;i++){FOR1NESTED : for(var j=1;j<2;j++) { continue\u000AFOR1; } while(0);}"); |
|
15 if (j!==2) { |
|
16 $ERROR('#1: Since LineTerminator(U-000A) between continue and Identifier not allowed continue evaluates without label'); |
|
17 } |
|
18 } catch(e){ |
|
19 $ERROR('#1.1: eval("FOR1 : for(var i=1;i<2;i++){FOR1NESTED : for(var j=1;j<2;j++) { continue\\u000AFOR1; } while(0);}") does not lead to throwing exception'); |
|
20 } |
|
21 // |
|
22 ////////////////////////////////////////////////////////////////////////////// |
|
23 |
|
24 ////////////////////////////////////////////////////////////////////////////// |
|
25 //CHECK#2 |
|
26 try{ |
|
27 eval("FOR2 : for(var i=1;i<2;i++){FOR2NESTED : for(var j=1;j<2;j++) { continue\u000DFOR2; } while(0);}"); |
|
28 if (j!==2) { |
|
29 $ERROR('#2: Since LineTerminator(U-000D) between continue and Identifier not allowed continue evaluates without label'); |
|
30 } |
|
31 } catch(e){ |
|
32 $ERROR('#2.1: eval("FOR2 : for(var i=1;i<2;i++){FOR2NESTED : for(var j=1;j<2;j++) { continue\\u000DFOR2; } while(0);}") does not lead to throwing exception'); |
|
33 } |
|
34 // |
|
35 ////////////////////////////////////////////////////////////////////////////// |
|
36 |
|
37 ////////////////////////////////////////////////////////////////////////////// |
|
38 //CHECK#3 |
|
39 try{ |
|
40 eval("FOR3 : for(var i=1;i<2;i++){FOR3NESTED : for(var j=1;j<2;j++) { continue\u2028FOR3; } while(0);}"); |
|
41 if (j!==2) { |
|
42 $ERROR('#3: Since LineTerminator(U-2028) between continue and Identifier not allowed continue evaluates without label'); |
|
43 } |
|
44 } catch(e){ |
|
45 $ERROR('#3.1: eval("FOR3 : for(var i=1;i<2;i++){FOR3NESTED : for(var j=1;j<2;j++) { continue\\u2028FOR3; } while(0);}") does not lead to throwing exception'); |
|
46 } |
|
47 // |
|
48 ////////////////////////////////////////////////////////////////////////////// |
|
49 |
|
50 ////////////////////////////////////////////////////////////////////////////// |
|
51 //CHECK#4 |
|
52 try{ |
|
53 eval("FOR4 : for(var i=1;i<2;i++){FOR4NESTED : for(var j=1;j<2;j++) { continue\u2029FOR4; } while(0);}"); |
|
54 if (j!==2) { |
|
55 $ERROR('#4: Since LineTerminator(U-2029) between continue and Identifier not allowed continue evaluates without label'); |
|
56 } |
|
57 } catch(e){ |
|
58 $ERROR('#4.1: eval("FOR4 : for(var i=1;i<2;i++){FOR4NESTED : for(var j=1;j<2;j++) { continue\\u2029FOR4; } while(0);}"); does not lead to throwing exception'); |
|
59 } |
|
60 // |
|
61 ////////////////////////////////////////////////////////////////////////////// |
|
62 |
|
63 |
|
64 |