Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/jscript/function.c | 2 ++ dlls/jscript/tests/api.js | 1 + 2 files changed, 3 insertions(+)
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 984eebf..37776e6 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -619,6 +619,8 @@ static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, js { NativeFunction *function = (NativeFunction*)func;
+ if((flags & DISPATCH_CONSTRUCT) && !(function->function.flags & PROPF_CONSTR)) + return JS_E_INVALID_PROPERTY; return function->proc(ctx, vthis, flags & ~DISPATCH_JSCRIPT_INTERNAL_MASK, argc, argv, r); }
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 1368f39..f103c91 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2622,6 +2622,7 @@ testException(function() {"test" in nullDisp;}, "E_OBJECT_EXPECTED"); testException(function() {new 3;}, "E_UNSUPPORTED_ACTION"); testException(function() {new null;}, "E_OBJECT_EXPECTED"); testException(function() {new nullDisp;}, "E_NO_PROPERTY"); +testException(function() {new Math.max(5);}, "E_NO_PROPERTY"); testException(function() {new VBArray();}, "E_NOT_VBARRAY"); testException(function() {new VBArray(new VBArray(createArray()));}, "E_NOT_VBARRAY"); testException(function() {VBArray.prototype.lbound.call(new Object());}, "E_NOT_VBARRAY");