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,26 +109,26 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ ...@@ -109,26 +109,26 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return S_OK; return S_OK;
} }
for(i=0; i < ctx->func->var_cnt; i++) { if(ctx->func->type != FUNC_GLOBAL) {
if(!wcsicmp(ctx->func->vars[i].name, name)) { for(i=0; i < ctx->func->var_cnt; i++) {
ref->type = REF_VAR; if(!wcsicmp(ctx->func->vars[i].name, name)) {
ref->u.v = ctx->vars+i; ref->type = REF_VAR;
return TRUE; ref->u.v = ctx->vars+i;
return TRUE;
}
} }
}
for(i=0; i < ctx->func->arg_cnt; i++) { for(i=0; i < ctx->func->arg_cnt; i++) {
if(!wcsicmp(ctx->func->args[i].name, name)) { if(!wcsicmp(ctx->func->args[i].name, name)) {
ref->type = REF_VAR; ref->type = REF_VAR;
ref->u.v = ctx->args+i; ref->u.v = ctx->args+i;
return S_OK; return S_OK;
}
} }
}
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; return S_OK;
if(ctx->func->type != FUNC_GLOBAL) {
if(ctx->vbthis) { if(ctx->vbthis) {
/* FIXME: Bind such identifier while generating bytecode. */ /* FIXME: Bind such identifier while generating bytecode. */
for(i=0; i < ctx->vbthis->desc->prop_cnt; i++) { 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_ ...@@ -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; return S_OK;
for(i = 0; i < ctx->script->global_funcs_cnt; i++) { 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