test/script/basic/no_line_numbers.js

changeset 962
ac62e33a99b0
parent 0
b1a7da25b547
equal deleted inserted replaced
961:93b032dd26bc 962:ac62e33a99b0
1 /* 1 /*
2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that 12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code). 13 * accompanied this code).
14 * 14 *
15 * You should have received a copy of the GNU General Public License version 15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation, 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 * 18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 23
51 print("THIS SHOULD NEVER BE PRINTED!"); 51 print("THIS SHOULD NEVER BE PRINTED!");
52 } 52 }
53 53
54 while (true) { 54 while (true) {
55 break; 55 break;
56 if (true) { 56 if (true) {
57 var s; 57 var s;
58 } 58 }
59 } 59 }
60 60
61 print("s = "+s); 61 print("s = "+s);
62 62
63 print("u = "+u); 63 print("u = "+u);
64 for ( ; ; ) { 64 for ( ; ; ) {
65 break; 65 break;
66 while (true) { 66 while (true) {
67 do { 67 do {
68 var u; 68 var u;
69 } while (true); 69 } while (true);
70 } 70 }
71 } 71 }
72 72
73 function terminal() { 73 function terminal() {
74 print("r = "+r); 74 print("r = "+r);
75 print("t = "+t); 75 print("t = "+t);
76 for (;;) { 76 for (;;) {
77 var r; 77 var r;
78 return; 78 return;
79 var t; 79 var t;
80 print("THIS SHOULD NEVER BE PRINTED!"); 80 print("THIS SHOULD NEVER BE PRINTED!");
81 } 81 }
82 print("NEITHER SHOULD THIS"); 82 print("NEITHER SHOULD THIS");
83 } 83 }
84 84
85 terminal(); 85 terminal();
86 86
87 function terminal2() { 87 function terminal2() {
88 print("q = "+q); 88 print("q = "+q);
89 for (;;) { 89 for (;;) {
90 return; 90 return;
91 print("THIS SHOULD NEVER BE PRINTED!"); 91 print("THIS SHOULD NEVER BE PRINTED!");
92 } 92 }
93 print("NEITHER SHOULD THIS"); 93 print("NEITHER SHOULD THIS");
94 } 94 }
95 95
96 try { 96 try {
97 terminal2(); 97 terminal2();
98 } catch (e) { 98 } catch (e) {
99 print(e); 99 print(e);
100 } 100 }
101 101
109 try { 109 try {
110 print("b is = "+b); 110 print("b is = "+b);
111 } catch (e) { 111 } catch (e) {
112 print(e); 112 print(e);
113 } 113 }
114 114
115 115
116 function disp_a() { 116 function disp_a() {
117 var a = 20; 117 var a = 20;
118 print("Value of 'a' inside the function " + a); 118 print("Value of 'a' inside the function " + a);
119 } 119 }
120 120
121 var a = 10; 121 var a = 10;
122 122
123 disp_a(); 123 disp_a();
124 124
125 print("Value of 'a' outside the function " + a); 125 print("Value of 'a' outside the function " + a);

mercurial