jscript: Throw TypeError in in_eval.

This commit is contained in:
Jacek Caban 2010-08-16 12:36:59 +02:00 committed by Alexandre Julliard
parent be3dc38183
commit d6648e4f6a
2 changed files with 5 additions and 4 deletions

View File

@ -2065,10 +2065,8 @@ static HRESULT in_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *obj, jsexcept_t
BSTR str; BSTR str;
HRESULT hres; HRESULT hres;
if(V_VT(obj) != VT_DISPATCH) { if(V_VT(obj) != VT_DISPATCH || !V_DISPATCH(obj))
FIXME("throw TypeError\n"); return throw_type_error(ctx->parser->script, ei, IDS_OBJECT_EXPECTED, NULL);
return E_FAIL;
}
hres = to_string(ctx->parser->script, lval, ei, &str); hres = to_string(ctx->parser->script, lval, ei, &str);
if(FAILED(hres)) if(FAILED(hres))

View File

@ -1891,6 +1891,9 @@ exception_test(function() {encodeURI('\udcaa');}, "URIError", -2146823264);
exception_test(function() {(new Object()) instanceof 3;}, "TypeError", -2146823286); exception_test(function() {(new Object()) instanceof 3;}, "TypeError", -2146823286);
exception_test(function() {(new Object()) instanceof null;}, "TypeError", -2146823286); exception_test(function() {(new Object()) instanceof null;}, "TypeError", -2146823286);
exception_test(function() {(new Object()) instanceof nullDisp;}, "TypeError", -2146823286); exception_test(function() {(new Object()) instanceof nullDisp;}, "TypeError", -2146823286);
exception_test(function() {"test" in 3;}, "TypeError", -2146823281);
exception_test(function() {"test" in null;}, "TypeError", -2146823281);
exception_test(function() {"test" in nullDisp;}, "TypeError", -2146823281);
function testThisExcept(func, number) { function testThisExcept(func, number) {
exception_test(function() {func.call(new Object())}, "TypeError", number); exception_test(function() {func.call(new Object())}, "TypeError", number);