jscript: Use the proper variable_obj for bytecodes with named items.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2020-03-18 15:19:48 +02:00 committed by Alexandre Julliard
parent 4ff594e885
commit b7ddcbbc18
1 changed files with 2 additions and 0 deletions

View File

@ -3030,6 +3030,8 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi
}else if(!(flags & (EXEC_GLOBAL | EXEC_EVAL))) {
hres = create_dispex(ctx, NULL, NULL, &variable_obj);
if(FAILED(hres)) return hres;
}else if(bytecode->named_item) {
variable_obj = jsdisp_addref(bytecode->named_item->script_obj);
}else {
variable_obj = jsdisp_addref(ctx->global);
}