Jacek Caban : jscript: Added '^=' expression implementation.

Alexandre Julliard julliard at winehq.org
Thu Sep 18 07:55:49 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Sep 17 23:32:27 2008 +0200

jscript: Added '^=' expression implementation.

---

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

diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 76e8830..cb2618b 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -2478,8 +2478,12 @@ HRESULT assign_or_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD fl
     return assign_oper_eval(ctx, expr->expression1, expr->expression2, bitor_eval, ei, ret);
 }
 
-HRESULT assign_xor_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
+/* ECMA-262 3rd Edition    11.13.2 */
+HRESULT assign_xor_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    binary_expression_t *expr = (binary_expression_t*)_expr;
+
+    TRACE("\n");
+
+    return assign_oper_eval(ctx, expr->expression1, expr->expression2, xor_eval, ei, ret);
 }
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index dd7c9fd..d57598d 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -297,6 +297,10 @@ tmp = 0xf0f0^0xff00;
 ok(tmp === 0x0ff0, "0xf0f0^0xff00 !== 0x0ff0");
 ok(getVT(tmp) === "VT_I4", "getVT(0xf0f0^0xff00) = " + getVT(tmp));
 
+tmp = 5;
+ok((tmp ^= 3) === 6, "tmp(5) ^= 3 !== 6");
+ok(getVT(tmp) === "VT_I4", "getVT(tmp ^= 3) = " + getVT(tmp));
+
 ok(1 < 3.4, "1 < 3.4 failed");
 ok(!(3.4 < 1), "3.4 < 1");
 ok("abc" < "abcd", "abc < abcd failed");




More information about the wine-cvs mailing list