S12.1_A2.js (1058B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 The production StatementList Statement is evaluated as follows 7 1. Evaluate Statement. 8 2. If an exception was thrown, return (throw, V, empty) where V is the exception 9 es5id: 12.1_A2 10 description: Throwing exception within a Block 11 ---*/ 12 13 ////////////////////////////////////////////////////////////////////////////// 14 //CHECK#1 15 assert.throws(ReferenceError, function() { 16 { 17 x(); 18 } 19 }); 20 21 // 22 ////////////////////////////////////////////////////////////////////////////// 23 24 ////////////////////////////////////////////////////////////////////////////// 25 //CHECK#2 26 try { 27 throw "catchme"; 28 throw new Test262Error('#2: throw "catchme" lead to throwing exception'); 29 } catch (e) { 30 if (e!=="catchme") { 31 throw new Test262Error('#2.1: Exception === "catchme". Actual: Exception ==='+ e ); 32 } 33 } 34 35 // 36 ////////////////////////////////////////////////////////////////////////////// 37 38 reportCompare(0, 0);