js/src/tests/test262/ch13/13.0/S13_A7_T2.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     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  */
    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 //////////////////////////////////////////////////////////////////////////////
    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 //////////////////////////////////////////////////////////////////////////////
    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 //////////////////////////////////////////////////////////////////////////////

mercurial