summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/return/S12.9_A1_T8.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/return/S12.9_A1_T8.js')
-rw-r--r--js/src/tests/test262/language/statements/return/S12.9_A1_T8.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/return/S12.9_A1_T8.js b/js/src/tests/test262/language/statements/return/S12.9_A1_T8.js
new file mode 100644
index 0000000000..2d7d918549
--- /dev/null
+++ b/js/src/tests/test262/language/statements/return/S12.9_A1_T8.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Appearing of "return" without a function body leads to syntax error
+es5id: 12.9_A1_T8
+description: >
+ Checking if execution of "return x" with no function, placed into
+ a loop, fails
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+do {
+ var x=1;
+ return x;
+ var y=2;
+} while(0);
+//
+//////////////////////////////////////////////////////////////////////////////