12.14-13.js (849B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 12.14-13 6 description: catch introduces scope - updates are based on scope 7 flags: [noStrict] 8 ---*/ 9 10 var res1 = false; 11 var res2 = false; 12 var res3 = false; 13 14 (function() { 15 var x_12_14_13 = 'local'; 16 17 function foo() { 18 this.x_12_14_13 = 'instance'; 19 } 20 21 try { 22 throw foo; 23 } 24 catch (e) { 25 res1 = (x_12_14_13 === 'local'); 26 e(); 27 res2 = (x_12_14_13 === 'local'); 28 } 29 res3 = (x_12_14_13 === 'local'); 30 })(); 31 32 assert(res1, 'res1 !== true'); 33 assert(res2, 'res2 !== true'); 34 assert(res3, 'res3 !== true'); 35 36 reportCompare(0, 0);