jscript: Throw TypeError in Function_toString.
This commit is contained in:
parent
d8e841ca50
commit
fba4e3767f
|
@ -272,10 +272,8 @@ static HRESULT Function_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISP
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
if(!is_class(dispex, JSCLASS_FUNCTION)) {
|
if(!is_class(dispex, JSCLASS_FUNCTION))
|
||||||
FIXME("throw TypeError\n");
|
return throw_type_error(dispex->ctx, ei, IDS_NOT_FUNC, NULL);
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
function = (FunctionInstance*)dispex;
|
function = (FunctionInstance*)dispex;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ STRINGTABLE DISCARDABLE
|
||||||
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"
|
||||||
|
IDS_NOT_FUNC "Function expected"
|
||||||
IDS_NOT_DATE "'[object]' is not a date object"
|
IDS_NOT_DATE "'[object]' is not a date object"
|
||||||
IDS_NOT_NUM "Number expected"
|
IDS_NOT_NUM "Number expected"
|
||||||
IDS_UNDEFINED "'|' is undefined"
|
IDS_UNDEFINED "'|' is undefined"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#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
|
||||||
|
#define IDS_NOT_FUNC 0x138A
|
||||||
#define IDS_NOT_DATE 0x138E
|
#define IDS_NOT_DATE 0x138E
|
||||||
#define IDS_NOT_NUM 0x1389
|
#define IDS_NOT_NUM 0x1389
|
||||||
#define IDS_UNDEFINED 0x1391
|
#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() {arr.toString = Number.prototype.toString; arr.toString();}, "TypeError", -2146823287);
|
||||||
exception_test(function() {(new Number(3)).toString(1);}, "TypeError", -2146828283);
|
exception_test(function() {(new Number(3)).toString(1);}, "TypeError", -2146828283);
|
||||||
exception_test(function() {not_existing_variable.something();}, "TypeError", -2146823279);
|
exception_test(function() {not_existing_variable.something();}, "TypeError", -2146823279);
|
||||||
|
exception_test(function() {arr.toString = Function.prototype.toString; arr.toString();}, "TypeError", -2146823286);
|
||||||
|
|
||||||
reportSuccess();
|
reportSuccess();
|
||||||
|
|
Loading…
Reference in New Issue