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

jscript: Added Function default value implementation.

parent 5760eb80
......@@ -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();
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