mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
jscript: Don't initialize variables without initialiser to undefined in variable_list_eval.
This commit is contained in:
parent
ec73ad29e0
commit
47b842bff7
@ -517,25 +517,23 @@ HRESULT block_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t
|
||||
static HRESULT variable_list_eval(exec_ctx_t *ctx, variable_declaration_t *var_list, jsexcept_t *ei)
|
||||
{
|
||||
variable_declaration_t *iter;
|
||||
HRESULT hres = E_FAIL;
|
||||
HRESULT hres = S_OK;
|
||||
|
||||
for(iter = var_list; iter; iter = iter->next) {
|
||||
exprval_t exprval;
|
||||
VARIANT val;
|
||||
|
||||
if(iter->expr) {
|
||||
exprval_t exprval;
|
||||
if(!iter->expr)
|
||||
continue;
|
||||
|
||||
hres = expr_eval(ctx, iter->expr, 0, ei, &exprval);
|
||||
if(FAILED(hres))
|
||||
break;
|
||||
hres = expr_eval(ctx, iter->expr, 0, ei, &exprval);
|
||||
if(FAILED(hres))
|
||||
break;
|
||||
|
||||
hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val);
|
||||
exprval_release(&exprval);
|
||||
if(FAILED(hres))
|
||||
break;
|
||||
}else {
|
||||
V_VT(&val) = VT_EMPTY;
|
||||
}
|
||||
hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val);
|
||||
exprval_release(&exprval);
|
||||
if(FAILED(hres))
|
||||
break;
|
||||
|
||||
hres = jsdisp_propput_name(ctx->var_disp, iter->identifier, ctx->parser->script->lcid, &val, ei, NULL/*FIXME*/);
|
||||
VariantClear(&val);
|
||||
|
@ -741,6 +741,8 @@ function varTestFunc(varTest3) {
|
||||
var varTest4;
|
||||
}
|
||||
|
||||
varTestFunc(3);
|
||||
|
||||
deleteTest = 1;
|
||||
delete deleteTest;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user