summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/non-constructor-msg.js
blob: dc86f05d198bdf899d83ed9d73f5dacf1bc419e4 (plain)
1
2
3
4
5
6
7
load(libdir + 'asserts.js');

// Censor potentially existing toSource to trigger fallback in ValueToSource.
Function.prototype.toSource = null;

assertTypeErrorMessage(() => { new (function*() {}) },
                      "(function*() {}) is not a constructor");