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, Expression is evaluated first michael@0: * michael@0: * @path ch12/12.5/S12.5_A3.js michael@0: * @description The Expression is "(function(){throw 1})()" michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try { michael@0: if ((function(){throw 1})()) abracadabra michael@0: } catch (e) { michael@0: if (e !== 1) { michael@0: $ERROR('#1: Exception === 1. 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 ((function(){throw 1})()) abracadabra; else blablachat; michael@0: } catch (e) { michael@0: if (e !== 1) { michael@0: $ERROR('#2: Exception === 1. Actual: Exception ==='+ e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: