invoke-as-constructor.js (358B)
1 // Copyright (C) 2015 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Generator statements cannot be used as constructors. 7 es6id: 14.4 8 features: [generators] 9 ---*/ 10 11 function* g(){} 12 13 assert.throws(TypeError, function() { 14 var instance = new g(); 15 }); 16 17 reportCompare(0, 0);