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

jscript: Support properties argument in Object.create.

parent 34d4a9c7
......@@ -598,11 +598,6 @@ static HRESULT Object_create(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
TRACE("(%s)\n", debugstr_jsval(argv[0]));
if(argc > 1) {
FIXME("Unsupported properties argument %s\n", debugstr_jsval(argv[1]));
return E_NOTIMPL;
}
if(argc && is_object_instance(argv[0])) {
if(get_object(argv[0]))
proto = to_jsdisp(get_object(argv[0]));
......@@ -615,13 +610,18 @@ static HRESULT Object_create(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return E_INVALIDARG;
}
if(r) {
hres = create_dispex(ctx, NULL, proto, &obj);
if(FAILED(hres))
return hres;
hres = create_dispex(ctx, NULL, proto, &obj);
if(FAILED(hres))
return hres;
if(argc >= 2 && !is_undefined(argv[1]))
hres = jsdisp_define_properties(ctx, obj, argv[1]);
if(SUCCEEDED(hres) && r)
*r = jsval_obj(obj);
}
return S_OK;
else
jsdisp_release(obj);
return hres;
}
static HRESULT Object_getPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
......
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