jscript: Fix Object.defineProperty return value.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-08-21 12:32:01 +02:00 committed by Alexandre Julliard
parent 98cf6a6ac7
commit 7dab372271
2 changed files with 5 additions and 2 deletions

View File

@ -500,6 +500,8 @@ static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
hres = jsdisp_define_property(obj, name, &prop_desc);
release_property_descriptor(&prop_desc);
if(SUCCEEDED(hres) && r)
*r = jsval_obj(jsdisp_addref(obj));
return hres;
}

View File

@ -311,8 +311,9 @@ function test_defineProperty() {
ok(false, "expected exception");
}
var obj = new Object();
Object.defineProperty(obj, "test", {});
var obj = new Object(), defined;
defined = Object.defineProperty(obj, "test", {});
ok(defined === obj, "defined != obj");
ok("test" in obj, "test is not in obj");
test_own_data_prop_desc(obj, "test", false, false, false);
ok(obj.test === undefined, "obj.test = " + obj.test);