mirror of
https://github.com/bellard/quickjs.git
synced 2025-11-15 10:12:14 +03:00
More informative "not a constructor" error message (initial patch by bnoordhuis) (#368)
This commit is contained in:
@@ -248,6 +248,15 @@ function test_delete()
|
||||
assert(err, true, "delete");
|
||||
}
|
||||
|
||||
function test_constructor()
|
||||
{
|
||||
function *G() {}
|
||||
let ex
|
||||
try { new G() } catch (ex_) { ex = ex_ }
|
||||
assert(ex instanceof TypeError)
|
||||
assert(ex.message, "G is not a constructor")
|
||||
}
|
||||
|
||||
function test_prototype()
|
||||
{
|
||||
var f = function f() { };
|
||||
@@ -660,6 +669,7 @@ test_cvt();
|
||||
test_eq();
|
||||
test_inc_dec();
|
||||
test_op2();
|
||||
test_constructor();
|
||||
test_delete();
|
||||
test_prototype();
|
||||
test_arguments();
|
||||
|
||||
Reference in New Issue
Block a user