Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
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 */
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 //////////////////////////////////////////////////////////////////////////////
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 //////////////////////////////////////////////////////////////////////////////
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 //////////////////////////////////////////////////////////////////////////////
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 //////////////////////////////////////////////////////////////////////////////