js/src/tests/test262/ch07/7.9/S7.9_A1.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch07/7.9/S7.9_A1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     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 + * Check Continue Statement for automatic semicolon insertion
     1.9 + *
    1.10 + * @path ch07/7.9/S7.9_A1.js
    1.11 + * @description Try use continue \n Label construction
    1.12 + */
    1.13 +
    1.14 +//CHECK#1
    1.15 +label1: for (var i = 0; i <= 0; i++) {
    1.16 +  for (var j = 0; j <= 1; j++) {
    1.17 +    if (j === 0) {
    1.18 +      continue label1;
    1.19 +    } else {
    1.20 +      $ERROR('#1: Check continue statement for automatic semicolon insertion');
    1.21 +    }
    1.22 +  }  
    1.23 +}
    1.24 +
    1.25 +//CHECK#2
    1.26 +var result = false;
    1.27 +label2: for (var i = 0; i <= 1; i++) {
    1.28 +  for (var j = 0; j <= 1; j++) {
    1.29 +    if (j === 0) {
    1.30 +      continue 
    1.31 +      label2; 
    1.32 +    } else {
    1.33 +      result = true;
    1.34 +    }
    1.35 +  }    
    1.36 +}
    1.37 +
    1.38 +if (result !== true) {
    1.39 +  $ERROR('#2: Check continue statement for automatic semicolon insertion');
    1.40 +}
    1.41 +

mercurial