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: * VariableDeclaration within Eval statement is initialized as the program reaches the eval statement michael@0: * michael@0: * @path ch12/12.2/S12.2_A5.js michael@0: * @description Executing eval("var x") michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try{ michael@0: x=x; michael@0: $ERROR('#1: "x=x" lead to throwing exception'); michael@0: }catch(e){ michael@0: $PRINT(e.message); michael@0: }; michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: eval("var x"); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: try{ michael@0: x=x; michael@0: }catch(e){ michael@0: $ERROR('#2: VariableDeclaration inside Eval statement is initialized when program reaches the eval statement '+e.message); michael@0: }; michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: