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: * FunctionDeclaration inside the "if" Expression is evaluated as true and function will not be declarated michael@0: * michael@0: * @path ch12/12.5/S12.5_A5.js michael@0: * @description The "if" Expression is "function __func(){throw "FunctionExpression";}" michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try { michael@0: __func=__func; michael@0: $ERROR('#1: "__func=__func" lead to throwing exception'); michael@0: } catch (e) { michael@0: ; michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: try { michael@0: if(function __func(){throw "FunctionExpression";}) (function(){throw "TrueBranch"})(); else (function(){"MissBranch"})(); michael@0: } catch (e) { michael@0: if (e !== "TrueBranch") { michael@0: $ERROR('#2: Exception ==="TrueBranch". Actual: Exception ==='+ e); michael@0: } michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: try { michael@0: __func=__func; michael@0: $ERROR('#3: "__func=__func" lead to throwing exception'); michael@0: } catch (e) { michael@0: ; michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: michael@0: michael@0: