summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/generators/invoke-as-constructor.js
blob: 041fd4ff6b8d94ae933e1f50ee0489544489260e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
    Generator statements cannot be used as constructors.
es6id: 14.4
features: [generators]
---*/

function* g(){}

assert.throws(TypeError, function() {
  var instance = new g();
});

reportCompare(0, 0);