block-local-closure-set-before-initialization.js (390B)
1 // Copyright (C) 2011 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 13.1 5 description: > 6 let: block local closure [[Set]] before initialization. 7 (TDZ, Temporal Dead Zone) 8 ---*/ 9 { 10 function f() { x = 1; } 11 12 assert.throws(ReferenceError, function() { 13 f(); 14 }); 15 16 let x; 17 } 18 19 reportCompare(0, 0);