test/script/basic/NASHORN-58.js

changeset 962
ac62e33a99b0
parent 7
5a1b0714df0e
child 1205
4112748288bb
     1.1 --- a/test/script/basic/NASHORN-58.js	Tue Aug 19 20:43:03 2014 +0100
     1.2 +++ b/test/script/basic/NASHORN-58.js	Wed Aug 20 10:25:28 2014 +0200
     1.3 @@ -1,21 +1,21 @@
     1.4  /*
     1.5   * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 - * 
     1.8 + *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10   * under the terms of the GNU General Public License version 2 only, as
    1.11   * published by the Free Software Foundation.
    1.12 - * 
    1.13 + *
    1.14   * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17   * version 2 for more details (a copy is included in the LICENSE file that
    1.18   * accompanied this code).
    1.19 - * 
    1.20 + *
    1.21   * You should have received a copy of the GNU General Public License version
    1.22   * 2 along with this work; if not, write to the Free Software Foundation,
    1.23   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.24 - * 
    1.25 + *
    1.26   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.27   * or visit www.oracle.com if you need additional information or have any
    1.28   * questions.
    1.29 @@ -30,14 +30,14 @@
    1.30  
    1.31  function test1() {
    1.32      var x = 1;
    1.33 -    try { 
    1.34 -	print('try'); 
    1.35 -	x = 2; 
    1.36 +    try {
    1.37 +    print('try');
    1.38 +    x = 2;
    1.39      } catch(e) {
    1.40 -	print('catch');
    1.41 -    } finally { 
    1.42 -	print('finally');
    1.43 -	x = 3; 
    1.44 +    print('catch');
    1.45 +    } finally {
    1.46 +    print('finally');
    1.47 +    x = 3;
    1.48      }
    1.49      print(x);
    1.50  }
    1.51 @@ -45,81 +45,81 @@
    1.52  function test2() {
    1.53      var x = 1;
    1.54      try {
    1.55 -	print('try');
    1.56 +    print('try');
    1.57      } finally {
    1.58 -	print('finally');
    1.59 -	x = 2;
    1.60 +    print('finally');
    1.61 +    x = 2;
    1.62      }
    1.63      print(x);
    1.64  }
    1.65  
    1.66  function test3() {
    1.67      try {
    1.68 -	return 2;
    1.69 +    return 2;
    1.70      } finally {
    1.71 -	return 3;
    1.72 +    return 3;
    1.73      }
    1.74  }
    1.75  
    1.76  function test4() {
    1.77      try {
    1.78 -	x = 1;
    1.79 -	print(x);
    1.80 -	try {
    1.81 -	    x = 2;
    1.82 -	    print(x);
    1.83 -	} finally {
    1.84 -	    x = 3;
    1.85 -	    print(x)
    1.86 -	    try {
    1.87 -		x = 4;
    1.88 -		print(x);
    1.89 -	    } finally {
    1.90 -		x = 5;
    1.91 -		print(x);
    1.92 -	    }
    1.93 -	}
    1.94 -	print(x)
    1.95 +    x = 1;
    1.96 +    print(x);
    1.97 +    try {
    1.98 +        x = 2;
    1.99 +        print(x);
   1.100      } finally {
   1.101 -	x = 6;
   1.102 -	print(x);
   1.103 +        x = 3;
   1.104 +        print(x)
   1.105 +        try {
   1.106 +        x = 4;
   1.107 +        print(x);
   1.108 +        } finally {
   1.109 +        x = 5;
   1.110 +        print(x);
   1.111 +        }
   1.112 +    }
   1.113 +    print(x)
   1.114 +    } finally {
   1.115 +    x = 6;
   1.116 +    print(x);
   1.117      }
   1.118      print(x);
   1.119  }
   1.120  
   1.121  function test5() {
   1.122      try {
   1.123 -	x = 1;
   1.124 -	print(x);
   1.125 -	try {
   1.126 -	    x = 2;
   1.127 -	    print(x);
   1.128 -	} finally {
   1.129 -	    x = 3;
   1.130 -	    print(x)
   1.131 -	    try {
   1.132 -		x = 4;
   1.133 -		print(x);
   1.134 -	    } finally {
   1.135 -		x = 5;
   1.136 -		return x;
   1.137 -	    }
   1.138 -	}
   1.139 -	print(x)
   1.140 +    x = 1;
   1.141 +    print(x);
   1.142 +    try {
   1.143 +        x = 2;
   1.144 +        print(x);
   1.145      } finally {
   1.146 -	x = 6;
   1.147 -	return x;
   1.148 +        x = 3;
   1.149 +        print(x)
   1.150 +        try {
   1.151 +        x = 4;
   1.152 +        print(x);
   1.153 +        } finally {
   1.154 +        x = 5;
   1.155 +        return x;
   1.156 +        }
   1.157 +    }
   1.158 +    print(x)
   1.159 +    } finally {
   1.160 +    x = 6;
   1.161 +    return x;
   1.162      }
   1.163  }
   1.164  
   1.165  function test6() {
   1.166      try {
   1.167 -	throw new Error("testing");
   1.168 +    throw new Error("testing");
   1.169      } catch (ex) {
   1.170 -	print(ex);
   1.171 -	return;
   1.172 +    print(ex);
   1.173 +    return;
   1.174      } finally {
   1.175 -	print("finally");
   1.176 +    print("finally");
   1.177      }
   1.178  }
   1.179  
   1.180 @@ -133,7 +133,7 @@
   1.181          i++;
   1.182      }
   1.183      if (i != 4) {
   1.184 -	print("FAIL");
   1.185 +    print("FAIL");
   1.186      }
   1.187      print("SUCCESS");
   1.188  }

mercurial