23 24 /** 25 * JDK-8051889: Implement block scoping in symbol assignment and scope computation 26 * 27 * @test 28 * @run 29 * @option --language=es6 30 */ 31 32 "use strict"; 33 34 load(__DIR__ + "let-load-lib.js"); 35 36 { 37 let a = 20; 38 const c = 30; 39 print("print local defs: " + a, c); 40 } 41 42 print("imported var: " + a); 43 try { 44 print("imported let: " + b); 45 } catch (e) { 46 print(e); 47 } 48 49 try { 50 print("imported const: " + c); 51 } catch (e) { 52 print(e); 53 } 54 55 top(); 56 57 try { 58 block(); 59 } catch (e) { 60 print(e); 61 } 62 63 | 23 24 /** 25 * JDK-8051889: Implement block scoping in symbol assignment and scope computation 26 * 27 * @test 28 * @run 29 * @option --language=es6 30 */ 31 32 "use strict"; 33 34 load(__DIR__ + "let-load-lib.js"); 35 36 { 37 let a = 20; 38 const c = 30; 39 print("print local defs: " + a, c); 40 } 41 42 print("imported var: " + a); 43 print("imported let: " + b); 44 print("imported const: " + c); 45 46 top(); 47 48 try { 49 block(); 50 } catch (e) { 51 print(e); 52 } 53 54 try { 55 c = "foo"; 56 } catch (e) { 57 print(e); 58 } 59 60 |