|
1 // Copyright 2009 the Sputnik authors. All rights reserved. |
|
2 // This code is governed by the BSD license found in the LICENSE file. |
|
3 |
|
4 /** |
|
5 * The FunctionBody must be SourceElements |
|
6 * |
|
7 * @path ch13/13.0/S13_A7_T2.js |
|
8 * @description Inserting elements that is different from SourceElements into the FunctionBody |
|
9 */ |
|
10 |
|
11 ////////////////////////////////////////////////////////////////////////////// |
|
12 //CHECK#1 |
|
13 try{ |
|
14 eval("function __func(){/ ABC}"); |
|
15 $ERROR('#1: eval("function __func(){/ ABC}") lead to throwing exception'); |
|
16 } catch(e){ |
|
17 if(!(e instanceof SyntaxError)){ |
|
18 $ERROR('#1.1: eval("function __func(){/ ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); |
|
19 } |
|
20 } |
|
21 // |
|
22 ////////////////////////////////////////////////////////////////////////////// |
|
23 |
|
24 ////////////////////////////////////////////////////////////////////////////// |
|
25 //CHECK#3 |
|
26 try{ |
|
27 eval("function __func(){&1}"); |
|
28 $ERROR('#3: eval("function __func(){&1}") lead to throwing exception'); |
|
29 } catch(e){ |
|
30 if(!(e instanceof SyntaxError)){ |
|
31 $ERROR('#3.1: eval("function __func(){&1}") lead to throwing exception of SyntaxError. Actual: exception is '+e); |
|
32 } |
|
33 } |
|
34 // |
|
35 ////////////////////////////////////////////////////////////////////////////// |
|
36 |
|
37 ////////////////////////////////////////////////////////////////////////////// |
|
38 //CHECK#4 |
|
39 try{ |
|
40 eval("function __func(){# ABC}"); |
|
41 $ERROR('#4: eval("function __func(){# ABC}") lead to throwing exception'); |
|
42 } catch(e){ |
|
43 if(!(e instanceof SyntaxError)){ |
|
44 $ERROR('#4.1: eval("function __func(){# ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); |
|
45 } |
|
46 } |
|
47 // |
|
48 ////////////////////////////////////////////////////////////////////////////// |
|
49 |