generator-invoke-ctor.js (415B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Generator functions declared as methods cannot be used as constructors. 7 es6id: 14.4.13 8 features: [generators] 9 ---*/ 10 11 var method = { *method() {} }.method; 12 13 assert.throws(TypeError, function() { 14 var instance = new method(); 15 }); 16 17 reportCompare(0, 0);