Commit 82368f5c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Get rid of no longer needed EXPRVAL_NAMEREF.

parent 962307da
...@@ -31,7 +31,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); ...@@ -31,7 +31,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
#define EXPR_NOVAL 0x0001 #define EXPR_NOVAL 0x0001
#define EXPR_NEWREF 0x0002 #define EXPR_NEWREF 0x0002
#define EXPR_STRREF 0x0004
struct _return_type_t { struct _return_type_t {
enum{ enum{
...@@ -154,11 +153,6 @@ static void exprval_release(exprval_t *val) ...@@ -154,11 +153,6 @@ static void exprval_release(exprval_t *val)
if(val->u.idref.disp) if(val->u.idref.disp)
IDispatch_Release(val->u.idref.disp); IDispatch_Release(val->u.idref.disp);
return; return;
case EXPRVAL_NAMEREF:
if(val->u.nameref.disp)
IDispatch_Release(val->u.nameref.disp);
SysFreeString(val->u.nameref.name);
return;
case EXPRVAL_INVALID: case EXPRVAL_INVALID:
SysFreeString(val->u.identifier); SysFreeString(val->u.identifier);
} }
...@@ -179,8 +173,6 @@ static HRESULT exprval_value(script_ctx_t *ctx, exprval_t *val, jsexcept_t *ei, ...@@ -179,8 +173,6 @@ static HRESULT exprval_value(script_ctx_t *ctx, exprval_t *val, jsexcept_t *ei,
} }
return disp_propget(ctx, val->u.idref.disp, val->u.idref.id, ret, ei, NULL/*FIXME*/); return disp_propget(ctx, val->u.idref.disp, val->u.idref.id, ret, ei, NULL/*FIXME*/);
case EXPRVAL_NAMEREF:
break;
case EXPRVAL_INVALID: case EXPRVAL_INVALID:
return throw_type_error(ctx, ei, JS_E_UNDEFINED_VARIABLE, val->u.identifier); return throw_type_error(ctx, ei, JS_E_UNDEFINED_VARIABLE, val->u.identifier);
} }
...@@ -1494,13 +1486,6 @@ HRESULT array_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flag ...@@ -1494,13 +1486,6 @@ HRESULT array_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flag
hres = to_string(ctx, &val, ei, &str); hres = to_string(ctx, &val, ei, &str);
VariantClear(&val); VariantClear(&val);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
if(flags & EXPR_STRREF) {
ret->type = EXPRVAL_NAMEREF;
ret->u.nameref.disp = obj;
ret->u.nameref.name = str;
return S_OK;
}
hres = disp_get_id(ctx, obj, str, flags & EXPR_NEWREF ? fdexNameEnsure : 0, &id); hres = disp_get_id(ctx, obj, str, flags & EXPR_NEWREF ? fdexNameEnsure : 0, &id);
SysFreeString(str); SysFreeString(str);
} }
...@@ -1546,11 +1531,9 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla ...@@ -1546,11 +1531,9 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
return hres; return hres;
str = SysAllocString(expr->identifier); str = SysAllocString(expr->identifier);
if(flags & EXPR_STRREF) { if(!str) {
ret->type = EXPRVAL_NAMEREF; IDispatch_Release(obj);
ret->u.nameref.disp = obj; return E_OUTOFMEMORY;
ret->u.nameref.name = str;
return S_OK;
} }
hres = disp_get_id(ctx, obj, str, flags & EXPR_NEWREF ? fdexNameEnsure : 0, &id); hres = disp_get_id(ctx, obj, str, flags & EXPR_NEWREF ? fdexNameEnsure : 0, &id);
...@@ -2457,7 +2440,7 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla ...@@ -2457,7 +2440,7 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
TRACE("\n"); TRACE("\n");
hres = expr_eval(ctx, expr->expression, EXPR_STRREF, ei, &exprval); hres = expr_eval(ctx, expr->expression, 0, ei, &exprval);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -2465,7 +2448,7 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla ...@@ -2465,7 +2448,7 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
case EXPRVAL_IDREF: { case EXPRVAL_IDREF: {
IDispatchEx *dispex; IDispatchEx *dispex;
hres = IDispatch_QueryInterface(exprval.u.nameref.disp, &IID_IDispatchEx, (void**)&dispex); hres = IDispatch_QueryInterface(exprval.u.idref.disp, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = IDispatchEx_DeleteMemberByDispID(dispex, exprval.u.idref.id); hres = IDispatchEx_DeleteMemberByDispID(dispex, exprval.u.idref.id);
b = VARIANT_TRUE; b = VARIANT_TRUE;
...@@ -2473,18 +2456,6 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla ...@@ -2473,18 +2456,6 @@ HRESULT delete_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
} }
break; break;
} }
case EXPRVAL_NAMEREF: {
IDispatchEx *dispex;
hres = IDispatch_QueryInterface(exprval.u.nameref.disp, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) {
hres = IDispatchEx_DeleteMemberByName(dispex, exprval.u.nameref.name,
make_grfdex(ctx, fdexNameCaseSensitive));
b = VARIANT_TRUE;
IDispatchEx_Release(dispex);
}
break;
}
default: default:
FIXME("unsupported type %d\n", exprval.type); FIXME("unsupported type %d\n", exprval.type);
hres = E_NOTIMPL; hres = E_NOTIMPL;
......
...@@ -364,7 +364,6 @@ typedef struct { ...@@ -364,7 +364,6 @@ typedef struct {
enum { enum {
EXPRVAL_VARIANT, EXPRVAL_VARIANT,
EXPRVAL_IDREF, EXPRVAL_IDREF,
EXPRVAL_NAMEREF,
EXPRVAL_INVALID EXPRVAL_INVALID
} type; } type;
union { union {
...@@ -373,10 +372,6 @@ typedef struct { ...@@ -373,10 +372,6 @@ typedef struct {
IDispatch *disp; IDispatch *disp;
DISPID id; DISPID id;
} idref; } idref;
struct {
IDispatch *disp;
BSTR name;
} nameref;
BSTR identifier; BSTR identifier;
} u; } u;
} exprval_t; } exprval_t;
......
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