Commit 7f2d50f3 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Throw type error from call and apply functions.

parent 52ac3b3b
......@@ -416,13 +416,10 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
TRACE("\n");
if(!(function = function_from_vdisp(jsthis))) {
FIXME("dispex is not a function\n");
return E_FAIL;
}
if(!(function = function_this(jsthis)))
return throw_type_error(ctx, ei, IDS_NOT_FUNC, NULL);
argc = arg_cnt(dp);
if(argc) {
hres = to_object(ctx, get_arg(dp,0), &this_obj);
if(FAILED(hres))
......@@ -471,10 +468,8 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
TRACE("\n");
if(!(function = function_from_vdisp(jsthis))) {
FIXME("dispex is not a function\n");
return E_FAIL;
}
if(!(function = function_this(jsthis)))
return throw_type_error(ctx, ei, IDS_NOT_FUNC, NULL);
argc = arg_cnt(dp);
if(argc) {
......
......@@ -1688,6 +1688,14 @@ function testArrayThis(func) {
testArrayThis("toString");
function testFunctionThis(func) {
testThisExcept(Function.prototype[func], -2146823286);
}
testFunctionThis("toString");
testFunctionThis("call");
testFunctionThis("apply");
function testArrayHostThis(func) {
exception_test(function() { Array.prototype[func].call(testObj); }, "TypeError", -2146823274);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment