jscript: Throw type error from call and apply functions.

This commit is contained in:
Jacek Caban 2009-09-24 00:45:42 +02:00 committed by Alexandre Julliard
parent 52ac3b3bf0
commit 7f2d50f344
2 changed files with 12 additions and 9 deletions

View File

@ -416,13 +416,10 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
TRACE("\n"); TRACE("\n");
if(!(function = function_from_vdisp(jsthis))) { if(!(function = function_this(jsthis)))
FIXME("dispex is not a function\n"); return throw_type_error(ctx, ei, IDS_NOT_FUNC, NULL);
return E_FAIL;
}
argc = arg_cnt(dp); argc = arg_cnt(dp);
if(argc) { if(argc) {
hres = to_object(ctx, get_arg(dp,0), &this_obj); hres = to_object(ctx, get_arg(dp,0), &this_obj);
if(FAILED(hres)) if(FAILED(hres))
@ -471,10 +468,8 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
TRACE("\n"); TRACE("\n");
if(!(function = function_from_vdisp(jsthis))) { if(!(function = function_this(jsthis)))
FIXME("dispex is not a function\n"); return throw_type_error(ctx, ei, IDS_NOT_FUNC, NULL);
return E_FAIL;
}
argc = arg_cnt(dp); argc = arg_cnt(dp);
if(argc) { if(argc) {

View File

@ -1688,6 +1688,14 @@ function testArrayThis(func) {
testArrayThis("toString"); testArrayThis("toString");
function testFunctionThis(func) {
testThisExcept(Function.prototype[func], -2146823286);
}
testFunctionThis("toString");
testFunctionThis("call");
testFunctionThis("apply");
function testArrayHostThis(func) { function testArrayHostThis(func) {
exception_test(function() { Array.prototype[func].call(testObj); }, "TypeError", -2146823274); exception_test(function() { Array.prototype[func].call(testObj); }, "TypeError", -2146823274);
} }