Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/generators/invoke-as-constructor.js

raw
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 expressions cannot be used as constructors.
7 es6id: 14.4
8 features: [generators]
9 ---*/
10
11 var g = function*(){};
12
13 assert.throws(TypeError, function() {
14 var instance = new g();
15 });