Jacek Caban : jscript: Use compiler for hanling empty statements.

Alexandre Julliard julliard at winehq.org
Mon Dec 19 13:39:23 CST 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Dec 19 15:00:06 2011 +0100

jscript: Use compiler for hanling empty statements.

---

 dlls/jscript/compile.c |    2 ++
 dlls/jscript/engine.c  |    9 ---------
 dlls/jscript/engine.h  |    1 -
 dlls/jscript/parser.y  |    2 +-
 4 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 9fdce33..09384bc 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -928,6 +928,8 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat)
     switch(stat->type) {
     case STAT_BLOCK:
         return compile_block_statement(ctx, ((block_statement_t*)stat)->stat_list);
+    case STAT_EMPTY:
+        return push_instr(ctx, OP_undefined) == -1 ? E_OUTOFMEMORY : S_OK; /* FIXME */
     case STAT_EXPR:
         return compile_expression_statement(ctx, (expression_statement_t*)stat);
     case STAT_IF:
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 6ca10b3..2dc1b29 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -703,15 +703,6 @@ HRESULT var_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t
     return S_OK;
 }
 
-/* ECMA-262 3rd Edition    12.3 */
-HRESULT empty_statement_eval(script_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret)
-{
-    TRACE("\n");
-
-    V_VT(ret) = VT_EMPTY;
-    return S_OK;
-}
-
 /* ECMA-262 3rd Edition    12.6.2 */
 HRESULT while_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret)
 {
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index ebca7db..0fae5fb 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -399,7 +399,6 @@ typedef struct {
 
 HRESULT compiled_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT var_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
-HRESULT empty_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT while_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT for_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT forin_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN;
diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y
index 925b12d..085b819 100644
--- a/dlls/jscript/parser.y
+++ b/dlls/jscript/parser.y
@@ -839,7 +839,7 @@ static const statement_eval_t stat_eval_table[] = {
     compiled_statement_eval,
     break_statement_eval,
     continue_statement_eval,
-    empty_statement_eval,
+    compiled_statement_eval,
     compiled_statement_eval,
     for_statement_eval,
     forin_statement_eval,




More information about the wine-cvs mailing list