jscript: Added Function default value implementation.
This commit is contained in:
parent
5760eb808b
commit
e806869d4e
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue