jscript: Add Error_message implementation.

This commit is contained in:
Piotr Caban 2009-07-20 18:17:54 +02:00 committed by Alexandre Julliard
parent f33f5c9286
commit f17b1f6334
2 changed files with 20 additions and 2 deletions

View File

@ -39,8 +39,19 @@ static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','
static HRESULT Error_message(DispatchEx *dispex, LCID lcid, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
ErrorInstance *This = (ErrorInstance*)dispex;
TRACE("\n");
switch(flags) {
case DISPATCH_PROPERTYGET:
return VariantCopy(retv, &This->message);
case DISPATCH_PROPERTYPUT:
return VariantCopy(&This->message, get_arg(dp, 0));
default:
FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL;
}
}
static HRESULT Error_toString(DispatchEx *dispex, LCID lcid, WORD flags,

View File

@ -1252,9 +1252,14 @@ err = new Error();
ok(err.valueOf === Object.prototype.valueOf, "err.valueOf !== Object.prototype.valueOf");
ok(Error.prototype.name === "Error", "Error.prototype.name = " + Error.prototype.name);
ok(err.name === "Error", "err.name = " + err.name);
EvalError.prototype.message = "test";
err = new EvalError();
ok(EvalError.prototype.name === "EvalError", "EvalError.prototype.name = " + EvalError.prototype.name);
ok(err.name === "EvalError", "err.name = " + err.name);
ok(err.toString === Error.prototype.toString, "err.toString !== Error.prototype.toString");
ok(err.message === "", "err.message != ''");
err.message = date;
ok(err.message === date, "err.message != date");
err = new RangeError();
ok(RangeError.prototype.name === "RangeError", "RangeError.prototype.name = " + RangeError.prototype.name);
ok(err.name === "RangeError", "err.name = " + err.name);
@ -1270,5 +1275,7 @@ ok(err.name === "TypeError", "err.name = " + err.name);
err = new URIError();
ok(URIError.prototype.name === "URIError", "URIError.prototype.name = " + URIError.prototype.name);
ok(err.name === "URIError", "err.name = " + err.name);
err = new Error("message");
ok(err.message === "message", "err.message !== 'message'");
reportSuccess();