Commit be3dc381 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Throw TypeError in instanceof_expression_eval.

parent 50ef3a20
......@@ -1999,10 +1999,8 @@ static HRESULT instanceof_eval(exec_ctx_t *ctx, VARIANT *inst, VARIANT *objv, js
static const WCHAR prototypeW[] = {'p','r','o','t','o','t', 'y', 'p','e',0};
if(V_VT(objv) != VT_DISPATCH) {
FIXME("throw TypeError\n");
return E_FAIL;
}
if(V_VT(objv) != VT_DISPATCH || !V_DISPATCH(objv))
return throw_type_error(ctx->parser->script, ei, IDS_NOT_FUNC, NULL);
obj = iface_to_jsdisp((IUnknown*)V_DISPATCH(objv));
if(!obj) {
......
......@@ -26,6 +26,7 @@ STRINGTABLE
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_CREATE_OBJ_ERROR "Automation server can't create object"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_UNSUPPORTED_ACTION "Object doesn't support this action"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_SYNTAX_ERROR "Syntax error"
IDS_SEMICOLON "Expected ';'"
......
......@@ -22,6 +22,7 @@
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_CREATE_OBJ_ERROR 0x01AD
#define IDS_NO_PROPERTY 0x01B6
#define IDS_UNSUPPORTED_ACTION 0x01BD
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_SYNTAX_ERROR 0x03EA
#define IDS_SEMICOLON 0x03EC
......
......@@ -1888,6 +1888,9 @@ exception_test(function() {eval("'unterminated")}, "SyntaxError", -2146827273);
exception_test(function() {eval("nonexistingfunc()")}, "TypeError", -2146823281);
exception_test(function() {RegExp(/a/, "g");}, "RegExpError", -2146823271);
exception_test(function() {encodeURI('\udcaa');}, "URIError", -2146823264);
exception_test(function() {(new Object()) instanceof 3;}, "TypeError", -2146823286);
exception_test(function() {(new Object()) instanceof null;}, "TypeError", -2146823286);
exception_test(function() {(new Object()) instanceof nullDisp;}, "TypeError", -2146823286);
function testThisExcept(func, number) {
exception_test(function() {func.call(new Object())}, "TypeError", number);
......
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