Jacek Caban : jscript: Use bytecode for null literal.
Alexandre Julliard
julliard at winehq.org
Thu Nov 24 15:04:39 CST 2011
Module: wine
Branch: master
Commit: 83c53d855a10474949c64767fe993249e9dc6a73
URL: http://source.winehq.org/git/wine.git/?a=commit;h=83c53d855a10474949c64767fe993249e9dc6a73
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Nov 24 14:23:26 2011 +0100
jscript: Use bytecode for null literal.
---
dlls/jscript/compile.c | 2 ++
dlls/jscript/engine.c | 11 +++++++++++
dlls/jscript/engine.h | 1 +
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 85d38da..0f4381a 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -179,6 +179,8 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_expression_t *expr)
return push_instr_double(ctx, OP_double, literal->u.dval);
case LT_INT:
return push_instr_int(ctx, OP_int, literal->u.lval);
+ case LT_NULL:
+ return push_instr(ctx, OP_null);
case LT_STRING:
return push_instr_str(ctx, OP_str, literal->u.wstr);
default:
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index e9dc976..66d10d6 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -1724,6 +1724,17 @@ HRESULT identifier_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
return hres;
}
+/* ECMA-262 3rd Edition 7.8.1 */
+HRESULT interp_null(exec_ctx_t *ctx)
+{
+ VARIANT v;
+
+ TRACE("\n");
+
+ V_VT(&v) = VT_NULL;
+ return stack_push(ctx, &v);
+}
+
/* ECMA-262 3rd Edition 7.8.2 */
HRESULT interp_bool(exec_ctx_t *ctx)
{
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index 2c099e4..b48f04c 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -51,6 +51,7 @@ typedef struct _func_stack {
X(int, 1, ARG_INT) \
X(neg, 1, 0) \
X(neq2, 1, 0) \
+ X(null, 1, 0) \
X(str, 1, 0) \
X(tonum, 1, 0) \
X(tree, 1, ARG_EXPR) \
More information about the wine-cvs
mailing list