michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * The FunctionBody must be SourceElements michael@0: * michael@0: * @path ch13/13.0/S13_A7_T2.js michael@0: * @description Inserting elements that is different from SourceElements into the FunctionBody michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try{ michael@0: eval("function __func(){/ ABC}"); michael@0: $ERROR('#1: eval("function __func(){/ ABC}") lead to throwing exception'); michael@0: } catch(e){ michael@0: if(!(e instanceof SyntaxError)){ michael@0: $ERROR('#1.1: eval("function __func(){/ ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: try{ michael@0: eval("function __func(){&1}"); michael@0: $ERROR('#3: eval("function __func(){&1}") lead to throwing exception'); michael@0: } catch(e){ michael@0: if(!(e instanceof SyntaxError)){ michael@0: $ERROR('#3.1: eval("function __func(){&1}") lead to throwing exception of SyntaxError. Actual: exception is '+e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: try{ michael@0: eval("function __func(){# ABC}"); michael@0: $ERROR('#4: eval("function __func(){# ABC}") lead to throwing exception'); michael@0: } catch(e){ michael@0: if(!(e instanceof SyntaxError)){ michael@0: $ERROR('#4.1: eval("function __func(){# ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: