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 "break" and Identifier is not allowed, "break" is evaluated without label
6 *
7 * @path ch12/12.8/S12.8_A2.js
8 * @description Checking by using eval, inserting LineTerminator between break and Identifier
9 */
11 //////////////////////////////////////////////////////////////////////////////
12 //CHECK#1
13 try{
14 eval("FOR1 : for(var i=1;i<2;i++){ LABEL1 : do {var x =1;break\u000AFOR1;var y=2;} while(0);}");
15 if (i!==2) {
16 $ERROR('#1: Since LineTerminator(U-000A) between break and Identifier not allowed break evaluates without label');
17 }
18 } catch(e){
19 $ERROR('#1.1: eval("FOR1 : for(var i=1;i<2;i++){ LABEL1 : do {var x =1;break\\u000AFOR1;var y=2;} 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++){ LABEL2 : do {var x =1;break\u000DFOR2;var y=2;} while(0);}");
28 if (i!==2) {
29 $ERROR('#2: Since LineTerminator(U-000D) between break and Identifier not allowed break evaluates without label');
30 }
31 } catch(e){
32 $ERROR('#2.1: eval("FOR2 : for(var i=1;i<2;i++){ LABEL2 : do {var x =1;break\\u000DFOR2;var y=2;} 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++){ LABEL3 : do {var x =1;break\u2028FOR3;var y=2;} while(0);}");
41 if (i!==2) {
42 $ERROR('#3: Since LineTerminator(U-2028) between break and Identifier not allowed break evaluates without label');
43 }
44 } catch(e){
45 $ERROR('#3.1: eval("FOR3 : for(var i=1;i<2;i++){ LABEL3 : do {var x =1;break\\u2028FOR3;var y=2;} 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++){ LABEL4 : do {var x =1;break\u2029FOR4;var y=2;} while(0);}");
54 if (i!==2) {
55 $ERROR('#4: Since LineTerminator(U-2029) between break and Identifier not allowed break evaluates without label');
56 }
57 } catch(e){
58 $ERROR('#4.1: eval("FOR4 : for(var i=1;i<2;i++){ LABEL4 : do {var x =1;break\\u2029FOR4;var y=2;} while(0);}") does not lead to throwing exception');
59 }
60 //
61 //////////////////////////////////////////////////////////////////////////////