Jacek Caban : jscript: Get rid of no longer needed identifier in exprval_t.
Alexandre Julliard
julliard at winehq.org
Tue Dec 20 13:43:26 CST 2011
Module: wine
Branch: master
Commit: 00030ff66f79e356dcb1feb7183c92f93f236440
URL: http://source.winehq.org/git/wine.git/?a=commit;h=00030ff66f79e356dcb1feb7183c92f93f236440
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Dec 20 11:47:02 2011 +0100
jscript: Get rid of no longer needed identifier in exprval_t.
---
dlls/jscript/engine.c | 11 +++++------
dlls/jscript/engine.h | 1 -
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 5ed5751..14bd250 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -220,7 +220,7 @@ static void exprval_release(exprval_t *val)
IDispatch_Release(val->u.idref.disp);
return;
case EXPRVAL_INVALID:
- SysFreeString(val->u.identifier);
+ return;
}
}
@@ -240,7 +240,7 @@ 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*/);
case EXPRVAL_INVALID:
- return throw_type_error(ctx, ei, JS_E_UNDEFINED_VARIABLE, val->u.identifier);
+ assert(0);
}
ERR("type %d\n", val->type);
@@ -653,10 +653,6 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, DWORD flags,
}
ret->type = EXPRVAL_INVALID;
- ret->u.identifier = SysAllocString(identifier);
- if(!ret->u.identifier)
- return E_OUTOFMEMORY;
-
return S_OK;
}
@@ -1585,6 +1581,9 @@ static HRESULT interp_ident(exec_ctx_t *ctx)
if(FAILED(hres))
return hres;
+ if(exprval.type == EXPRVAL_INVALID)
+ return throw_type_error(ctx->parser->script, ctx->ei, JS_E_UNDEFINED_VARIABLE, arg);
+
hres = exprval_to_value(ctx->parser->script, &exprval, ctx->ei, &v);
exprval_release(&exprval);
if(FAILED(hres))
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index 8c4b666..071c98b 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -423,7 +423,6 @@ typedef struct {
IDispatch *disp;
DISPID id;
} idref;
- BSTR identifier;
} u;
} exprval_t;
More information about the wine-cvs
mailing list