LibJS: Throw a TypeError when an arrow function is used as a constructor

This commit is contained in:
Jack Karamanian 2020-05-30 00:16:42 -05:00 committed by Andreas Kling
commit 3ffb0a4e87
Notes: sideshowbarker 2024-07-19 05:58:18 +09:00
2 changed files with 9 additions and 0 deletions

View file

@ -81,6 +81,13 @@ try {
assert(Baz.prototype === undefined);
assertThrowsError(() => {
new Baz();
}, {
error: TypeError,
message: "Baz is not a constructor"
});
(() => {
"use strict";
assert(isStrictMode());