Commit fba4e376 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Throw TypeError in Function_toString.

parent d8e841ca
......@@ -272,10 +272,8 @@ static HRESULT Function_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISP
TRACE("\n");
if(!is_class(dispex, JSCLASS_FUNCTION)) {
FIXME("throw TypeError\n");
return E_FAIL;
}
if(!is_class(dispex, JSCLASS_FUNCTION))
return throw_type_error(dispex->ctx, ei, IDS_NOT_FUNC, NULL);
function = (FunctionInstance*)dispex;
......
......@@ -25,6 +25,7 @@ STRINGTABLE DISCARDABLE
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_NOT_FUNC "Function expected"
IDS_NOT_DATE "'[object]' is not a date object"
IDS_NOT_NUM "Number expected"
IDS_UNDEFINED "'|' is undefined"
......
......@@ -21,6 +21,7 @@
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_NO_PROPERTY 0x01B6
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_NOT_FUNC 0x138A
#define IDS_NOT_DATE 0x138E
#define IDS_NOT_NUM 0x1389
#define IDS_UNDEFINED 0x1391
......
......@@ -1314,5 +1314,6 @@ exception_test(function() {arr.test();}, "TypeError", -2146827850);
exception_test(function() {arr.toString = Number.prototype.toString; arr.toString();}, "TypeError", -2146823287);
exception_test(function() {(new Number(3)).toString(1);}, "TypeError", -2146828283);
exception_test(function() {not_existing_variable.something();}, "TypeError", -2146823279);
exception_test(function() {arr.toString = Function.prototype.toString; arr.toString();}, "TypeError", -2146823286);
reportSuccess();
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