jscript: Added Function default value implementation.

oldstable
Jacek Caban 2008-09-21 15:48:11 +02:00 committed by Alexandre Julliard
parent 5760eb808b
commit e806869d4e
2 changed files with 17 additions and 0 deletions

View File

@ -364,6 +364,19 @@ static HRESULT Function_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR
return invoke_function(function, lcid, dp, retv, ei, caller);
case DISPATCH_PROPERTYGET: {
HRESULT hres;
BSTR str;
hres = function_to_string(function, &str);
if(FAILED(hres))
return hres;
V_VT(retv) = VT_BSTR;
V_BSTR(retv) = str;
break;
}
case DISPATCH_CONSTRUCT:
if(function->value_proc)
return invoke_value_proc(function, lcid, flags, dp, retv, ei, caller);

View File

@ -321,6 +321,8 @@ var func = function (a) {
}.toString();
ok(func.toString() === "function (a) {\n var a = 1;\n if(a) return;\n }",
"func.toString() = " + func.toString());
ok("" + func === "function (a) {\n var a = 1;\n if(a) return;\n }",
"'' + func.toString() = " + func);
function testFuncToString(x,y) {
return x+y;
@ -328,5 +330,7 @@ function testFuncToString(x,y) {
ok(testFuncToString.toString() === "function testFuncToString(x,y) {\n return x+y;\n}",
"testFuncToString.toString() = " + testFuncToString.toString());
ok("" + testFuncToString === "function testFuncToString(x,y) {\n return x+y;\n}",
"'' + testFuncToString = " + testFuncToString);
reportSuccess();