global-closure-get-before-initialization.js (378B)
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: global closure [[Get]] before initialization. 7 (TDZ, Temporal Dead Zone) 8 ---*/ 9 function f() { return x + 1; } 10 11 assert.throws(ReferenceError, function() { 12 f(); 13 }); 14 15 let x; 16 17 reportCompare(0, 0);