Jacek Caban : jscript: Create undeclared values to script_disp instead of var_disp.

Alexandre Julliard julliard at winehq.org
Thu Aug 27 10:31:26 CDT 2009


Module: wine
Branch: master
Commit: 4b8adbef866eea18e231dab64156c858c66082f9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4b8adbef866eea18e231dab64156c858c66082f9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Aug 27 01:22:17 2009 +0200

jscript: Create undeclared values to script_disp instead of var_disp.

---

 dlls/jscript/engine.c      |    4 ++--
 dlls/jscript/tests/lang.js |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 96117f2..c9db8e6 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -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;
     }
 
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 56f71d6..b0e90fc 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -907,4 +907,7 @@ function () {} nosemicolon();
 
 ok(typeof(doesnotexist) === "undefined", "typeof(doesnotexist) = " + typeof(doesnotexist));
 
+(function() { newValue = 1; })();
+ok(newValue === 1, "newValue = " + newValue);
+
 reportSuccess();




More information about the wine-cvs mailing list