jscript: Throw error in to_primitive function.

This commit is contained in:
Piotr Caban 2009-07-22 13:02:24 +02:00 committed by Alexandre Julliard
parent fba4e3767f
commit 412e0af26f
3 changed files with 6 additions and 4 deletions

View File

@ -22,6 +22,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_TO_PRIMITIVE "Error converting object to primitive type"
IDS_INVALID_CALL_ARG "Invalid procedure call or argument" IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_NO_PROPERTY "Object doesn't support this property or method" IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_ARG_NOT_OPT "Argument not optional" IDS_ARG_NOT_OPT "Argument not optional"

View File

@ -211,7 +211,7 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, ctx->lcid, DISPATCH_METHOD, &dp, ret, ei, NULL /*FIXME*/); hres = jsdisp_call(jsdisp, id, ctx->lcid, DISPATCH_METHOD, &dp, ret, ei, NULL /*FIXME*/);
if(FAILED(hres)) { if(FAILED(hres)) {
FIXME("throw TypeError\n"); WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp); jsdisp_release(jsdisp);
return hres; return hres;
} }
@ -227,7 +227,7 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, ctx->lcid, DISPATCH_METHOD, &dp, ret, ei, NULL /*FIXME*/); hres = jsdisp_call(jsdisp, id, ctx->lcid, DISPATCH_METHOD, &dp, ret, ei, NULL /*FIXME*/);
if(FAILED(hres)) { if(FAILED(hres)) {
FIXME("throw TypeError\n"); WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp); jsdisp_release(jsdisp);
return hres; return hres;
} }
@ -241,8 +241,8 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
jsdisp_release(jsdisp); jsdisp_release(jsdisp);
FIXME("throw TypeError\n"); WARN("failed\n");
return E_FAIL; return throw_type_error(ctx, ei, IDS_TO_PRIMITIVE, NULL);
} }
default: default:
FIXME("Unimplemented for vt %d\n", V_VT(v)); FIXME("Unimplemented for vt %d\n", V_VT(v));

View File

@ -18,6 +18,7 @@
#include <windef.h> #include <windef.h>
#define IDS_TO_PRIMITIVE 0x0001
#define IDS_INVALID_CALL_ARG 0x0005 #define IDS_INVALID_CALL_ARG 0x0005
#define IDS_NO_PROPERTY 0x01B6 #define IDS_NO_PROPERTY 0x01B6
#define IDS_ARG_NOT_OPT 0x01c1 #define IDS_ARG_NOT_OPT 0x01c1