js/src/tests/test262/ch12/12.7/S12.7_A2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch12/12.7/S12.7_A2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +// Copyright 2009 the Sputnik authors.  All rights reserved.
     1.5 +// This code is governed by the BSD license found in the LICENSE file.
     1.6 +
     1.7 +/**
     1.8 + * Since LineTerminator between "continue" and Identifier is not allowed, "continue" is evaluated without label
     1.9 + *
    1.10 + * @path ch12/12.7/S12.7_A2.js
    1.11 + * @description Checking by using eval, inserting LineTerminator between continue and Identifier
    1.12 + */
    1.13 +
    1.14 +//////////////////////////////////////////////////////////////////////////////
    1.15 +//CHECK#1
    1.16 +try{
    1.17 +	eval("FOR1 : for(var i=1;i<2;i++){FOR1NESTED : for(var j=1;j<2;j++) { continue\u000AFOR1; } while(0);}");
    1.18 +	if (j!==2) {
    1.19 +		$ERROR('#1: Since LineTerminator(U-000A) between continue and Identifier not allowed continue evaluates without label');
    1.20 +	}
    1.21 +} catch(e){
    1.22 +	$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');
    1.23 +}
    1.24 +//
    1.25 +//////////////////////////////////////////////////////////////////////////////
    1.26 +
    1.27 +//////////////////////////////////////////////////////////////////////////////
    1.28 +//CHECK#2
    1.29 +try{
    1.30 +	eval("FOR2 : for(var i=1;i<2;i++){FOR2NESTED : for(var j=1;j<2;j++) { continue\u000DFOR2; } while(0);}");
    1.31 +	if (j!==2) {
    1.32 +		$ERROR('#2: Since LineTerminator(U-000D) between continue and Identifier not allowed continue evaluates without label');
    1.33 +	}
    1.34 +} catch(e){
    1.35 +	$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');
    1.36 +}
    1.37 +//
    1.38 +//////////////////////////////////////////////////////////////////////////////
    1.39 +
    1.40 +//////////////////////////////////////////////////////////////////////////////
    1.41 +//CHECK#3
    1.42 +try{
    1.43 +	eval("FOR3 : for(var i=1;i<2;i++){FOR3NESTED : for(var j=1;j<2;j++) { continue\u2028FOR3; } while(0);}");
    1.44 +	if (j!==2) {
    1.45 +		$ERROR('#3: Since LineTerminator(U-2028) between continue and Identifier not allowed continue evaluates without label');
    1.46 +	}
    1.47 +} catch(e){
    1.48 +	$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');
    1.49 +}
    1.50 +//
    1.51 +//////////////////////////////////////////////////////////////////////////////
    1.52 +
    1.53 +//////////////////////////////////////////////////////////////////////////////
    1.54 +//CHECK#4
    1.55 +try{
    1.56 +	eval("FOR4 : for(var i=1;i<2;i++){FOR4NESTED : for(var j=1;j<2;j++) { continue\u2029FOR4; } while(0);}");
    1.57 +	if (j!==2) {
    1.58 +		$ERROR('#4: Since LineTerminator(U-2029) between continue and Identifier not allowed continue evaluates without label');
    1.59 +	}
    1.60 +} catch(e){
    1.61 +	$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');
    1.62 +}
    1.63 +//
    1.64 +//////////////////////////////////////////////////////////////////////////////
    1.65 +
    1.66 +
    1.67 +

mercurial