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

vbscript: Clean up lookup_identifier.

Be more explicit about what applies only to non-global code. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 708c1e86
......@@ -109,6 +109,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return S_OK;
}
if(ctx->func->type != FUNC_GLOBAL) {
for(i=0; i < ctx->func->var_cnt; i++) {
if(!wcsicmp(ctx->func->vars[i].name, name)) {
ref->type = REF_VAR;
......@@ -125,10 +126,9 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
}
}
if(lookup_dynamic_vars(ctx->func->type == FUNC_GLOBAL ? ctx->script->global_vars : ctx->dynamic_vars, name, ref))
if(lookup_dynamic_vars(ctx->dynamic_vars, name, ref))
return S_OK;
if(ctx->func->type != FUNC_GLOBAL) {
if(ctx->vbthis) {
/* FIXME: Bind such identifier while generating bytecode. */
for(i=0; i < ctx->vbthis->desc->prop_cnt; i++) {
......@@ -159,7 +159,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
}
}
if(ctx->func->type != FUNC_GLOBAL && lookup_dynamic_vars(ctx->script->global_vars, name, ref))
if(lookup_dynamic_vars(ctx->script->global_vars, name, ref))
return S_OK;
for(i = 0; i < ctx->script->global_funcs_cnt; i++) {
......
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