head-expr-to-obj.js (478B)
1 // Copyright (C) 2013 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.6.4.12 S8.b 5 description: > 6 The value of the expression in a for-of statement's head is subject to the 7 semantics of the ToObject abstract operation. 8 ---*/ 9 var x; 10 11 assert.throws(TypeError, function() { 12 for (x of null) {} 13 }); 14 15 assert.throws(TypeError, function() { 16 for (x of undefined) {} 17 }); 18 19 reportCompare(0, 0);