aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/ch13/13.0/S13_A7_T2.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/suite/ch13/13.0/S13_A7_T2.js')
-rw-r--r--test/suite/ch13/13.0/S13_A7_T2.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/suite/ch13/13.0/S13_A7_T2.js b/test/suite/ch13/13.0/S13_A7_T2.js
new file mode 100644
index 000000000..c9be672b8
--- /dev/null
+++ b/test/suite/ch13/13.0/S13_A7_T2.js
@@ -0,0 +1,49 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * The FunctionBody must be SourceElements
+ *
+ * @path ch13/S13_A7_T2.js
+ * @description Inserting elements that is different from SourceElements into the FunctionBody
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+try{
+ eval("function __func(){/ ABC}");
+ $ERROR('#1: eval("function __func(){/ ABC}") lead to throwing exception');
+} catch(e){
+ if(!(e instanceof SyntaxError)){
+ $ERROR('#1.1: eval("function __func(){/ ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
+ }
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+try{
+ eval("function __func(){&1}");
+ $ERROR('#3: eval("function __func(){&1}") lead to throwing exception');
+} catch(e){
+ if(!(e instanceof SyntaxError)){
+ $ERROR('#3.1: eval("function __func(){&1}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
+ }
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+try{
+ eval("function __func(){# ABC}");
+ $ERROR('#4: eval("function __func(){# ABC}") lead to throwing exception');
+} catch(e){
+ if(!(e instanceof SyntaxError)){
+ $ERROR('#4.1: eval("function __func(){# ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e);
+ }
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+