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: * When the production "IfStatement: if ( Expression ) Statement else Statement" is evaluated, Statement(s) is(are) evaluated second michael@0: * michael@0: * @path ch12/12.5/S12.5_A4.js michael@0: * @description The first statement is "(function(){throw "instatement"})()" michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try { michael@0: if (true) (function(){throw "instatement"})(); michael@0: $FAIL("#1 failed") michael@0: } catch (e) { michael@0: if (e !== "instatement") { michael@0: $ERROR('#1: Exception === "instatement". Actual: Exception ==='+ e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: try { michael@0: if (false) (function(){throw "truebranch"})(); (function(){throw "missbranch"})(); michael@0: $FAIL("#2 failed") michael@0: } catch (e) { michael@0: if (e !== "missbranch") { michael@0: $ERROR('#2: Exception === "missbranch". Actual: Exception ==='+ e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: