| // Copyright 2009 the Sputnik authors. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| Using "try" with "catch" or "finally" statement within/without a "with" |
| description: Using try/catch/finally in With and With in try/catch/finally |
| valueOf : function(){return 'obj_valueOf';}, |
| parseInt : function(){return 'obj_parseInt';}, |
| Infinity : 'obj_Infinity', |
| eval : function(){return 'obj_eval';}, |
| parseFloat : function(){return 'obj_parseFloat';}, |
| isNaN : function(){return 'obj_isNaN';}, |
| isFinite : function(){return 'obj_isFinite';} |
| if (e!=="ex") $ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e ); |
| if (e!=="a") $ERROR('#2.1: Exception ==="a". Actual: Exception ==='+ e ); |
| if(myObj.p1!=='pass') $ERROR('#2.2: "throw p1" lead to throwing exception'); |
| if (e!=="b") $ERROR('#3.1: Exception ==="b". Actual: Exception ==='+ e ); |
| if(myObj.p1!=='pass') $ERROR('#3.2: "throw p2" lead to throwing exception'); |
| if(myObj.p2!=='pass') $ERROR('#3.3: "finally" block must be evaluated'); |
| if(myObj.p1!=='pass') $ERROR('#4: "finally" block must be evaluated'); |