jscript: Pass 'this' as jsdisp_t to setters.

This commit is contained in:
Jacek Caban 2015-02-06 12:09:47 +01:00 committed by Alexandre Julliard
parent d541b525e4
commit 1316403770
6 changed files with 15 additions and 20 deletions

View file

@ -126,9 +126,9 @@ static HRESULT Array_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
return S_OK;
}
static HRESULT Array_set_length(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT Array_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
ArrayInstance *This = array_from_vdisp(jsthis);
ArrayInstance *This = array_from_jsdisp(jsthis);
DOUBLE len = -1;
DWORD i;
HRESULT hres;

View file

@ -470,14 +470,9 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServi
switch(prop->type) {
case PROP_BUILTIN:
if(prop->u.p->setter) {
vdisp_t vthis;
if(prop->u.p->setter)
return prop->u.p->setter(This->ctx, This, val);
set_jsdisp(&vthis, This);
hres = prop->u.p->setter(This->ctx, &vthis, val);
vdisp_release(&vthis);
return hres;
}
if(prop->u.p->setter) {
FIXME("getter with no setter\n");
return E_FAIL;
@ -512,7 +507,7 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServi
return S_OK;
}
HRESULT builtin_set_const(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
HRESULT builtin_set_const(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
TRACE("%p %s\n", jsthis, debugstr_jsval(value));
return S_OK;

View file

@ -375,7 +375,7 @@ static HRESULT Function_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t
return S_OK;
}
static HRESULT Function_set_length(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT Function_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("\n");
return E_NOTIMPL;

View file

@ -188,9 +188,9 @@ static inline jsdisp_t *get_jsdisp(vdisp_t *vdisp)
typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*);
typedef HRESULT (*builtin_getter_t)(script_ctx_t*,jsdisp_t*,jsval_t*);
typedef HRESULT (*builtin_setter_t)(script_ctx_t*,vdisp_t*,jsval_t);
typedef HRESULT (*builtin_setter_t)(script_ctx_t*,jsdisp_t*,jsval_t);
HRESULT builtin_set_const(script_ctx_t*,vdisp_t*,jsval_t) DECLSPEC_HIDDEN;
HRESULT builtin_set_const(script_ctx_t*,jsdisp_t*,jsval_t) DECLSPEC_HIDDEN;
typedef struct {
const WCHAR *name;

View file

@ -256,7 +256,7 @@ static HRESULT RegExp_get_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r
return S_OK;
}
static HRESULT RegExp_set_source(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT RegExp_set_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("\n");
return E_NOTIMPL;
@ -268,7 +268,7 @@ static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r
return E_NOTIMPL;
}
static HRESULT RegExp_set_global(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("\n");
return E_NOTIMPL;
@ -280,7 +280,7 @@ static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_
return E_NOTIMPL;
}
static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("\n");
return E_NOTIMPL;
@ -292,7 +292,7 @@ static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t
return E_NOTIMPL;
}
static HRESULT RegExp_set_multiline(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT RegExp_set_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("\n");
return E_NOTIMPL;
@ -322,9 +322,9 @@ static HRESULT RegExp_get_lastIndex(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t
return jsval_copy(regexp->last_index_val, r);
}
static HRESULT RegExp_set_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT RegExp_set_lastIndex(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
RegExpInstance *regexp = regexp_from_vdisp(jsthis);
RegExpInstance *regexp = regexp_from_jsdisp(jsthis);
HRESULT hres;
TRACE("\n");

View file

@ -121,7 +121,7 @@ static HRESULT String_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r
return S_OK;
}
static HRESULT String_set_length(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t value)
static HRESULT String_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
{
FIXME("%p\n", jsthis);
return E_NOTIMPL;