Module: wine Branch: master Commit: 887840a888d26f1d4cfc554d3e408f81d3858ea2 URL: https://source.winehq.org/git/wine.git/?a=commit;h=887840a888d26f1d4cfc554d3...
Author: Jacek Caban jacek@codeweavers.com Date: Tue May 15 13:26:38 2018 +0200
jscript: Move handling PROPF_WRITABLE to property type specific code.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/jscript/dispex.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 2557471..e6835db 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -495,28 +495,34 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) { HRESULT hres;
- if(!(prop->flags & PROPF_WRITABLE) && prop->type != PROP_PROTREF) - return S_OK;
switch(prop->type) { case PROP_BUILTIN: - if(prop->u.p->setter) - return prop->u.p->setter(This->ctx, This, val); - - if(prop->u.p->setter) { - FIXME("getter with no setter\n"); - return E_FAIL; + if(!prop->u.p->setter) { + TRACE("getter with no setter\n"); + return S_OK; } - /* fall through */ + return prop->u.p->setter(This->ctx, This, val); case PROP_PROTREF: + case PROP_DELETED: prop->type = PROP_JSVAL; prop->flags = PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE; prop->u.val = jsval_undefined(); break; case PROP_JSVAL: + if(!(prop->flags & PROPF_WRITABLE)) + return S_OK; + jsval_release(prop->u.val); break; + case PROP_ACCESSOR: + FIXME("not supported for accessor properties\n"); + return E_NOTIMPL; case PROP_IDX: + if(!This->builtin_info->idx_put) { + TRACE("no put_idx\n"); + return S_OK; + } return This->builtin_info->idx_put(This, prop->u.idx, val); default: ERR("type %d\n", prop->type);