jscript: Create undeclared values to script_disp instead of var_disp.

This commit is contained in:
Jacek Caban 2009-08-27 01:22:17 +02:00 committed by Alexandre Julliard
parent 9c18f6ef5d
commit 4b8adbef86
2 changed files with 5 additions and 2 deletions

View File

@ -537,11 +537,11 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js
return S_OK;
if(flags & EXPR_NEWREF) {
hres = jsdisp_get_id(ctx->var_disp, identifier, fdexNameEnsure, &id);
hres = jsdisp_get_id(ctx->parser->script->script_disp, identifier, fdexNameEnsure, &id);
if(FAILED(hres))
return hres;
exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(ctx->var_disp), id);
exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(ctx->parser->script->script_disp), id);
return S_OK;
}

View File

@ -907,4 +907,7 @@ function () {} nosemicolon();
ok(typeof(doesnotexist) === "undefined", "typeof(doesnotexist) = " + typeof(doesnotexist));
(function() { newValue = 1; })();
ok(newValue === 1, "newValue = " + newValue);
reportSuccess();