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: * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression michael@0: * michael@0: * @path ch12/12.13/S12.13_A2_T5.js michael@0: * @description Throwing number michael@0: */ michael@0: michael@0: // CHECK#1 michael@0: try{ michael@0: throw 13; michael@0: } michael@0: catch(e){ michael@0: if (e!==13) $ERROR('#1: Exception ===13. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#2 michael@0: var b=13; michael@0: try{ michael@0: throw b; michael@0: } michael@0: catch(e){ michael@0: if (e!==13) $ERROR('#2: Exception ===13. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#3 michael@0: try{ michael@0: throw 2.13; michael@0: } michael@0: catch(e){ michael@0: if (e!==2.13) $ERROR('#3: Exception ===2.13. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#4 michael@0: try{ michael@0: throw NaN; michael@0: } michael@0: catch(e){ michael@0: if (!isNaN(e)) $ERROR('#4: Exception is NaN'); michael@0: } michael@0: michael@0: // CHECK#5 michael@0: try{ michael@0: throw +Infinity; michael@0: } michael@0: catch(e){ michael@0: if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#6 michael@0: try{ michael@0: throw -Infinity; michael@0: } michael@0: catch(e){ michael@0: if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#7 michael@0: try{ michael@0: throw +0; michael@0: } michael@0: catch(e){ michael@0: if (e!==+0) $ERROR('#7: Exception ===+0. Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: // CHECK#8 michael@0: try{ michael@0: throw -0; michael@0: } michael@0: catch(e){ michael@0: if (e!==-0) $ERROR('#8: Exception ===-0. Actual: Exception ==='+ e ); michael@0: } michael@0: