Robert Wilhelm : jscript: Cc_parser_parse implement '&&' expression.

Alexandre Julliard julliard at winehq.org
Tue Mar 23 15:07:42 CDT 2021


Module: wine
Branch: oldstable
Commit: 0c1d6a6f174da3f5956ac77b19c842ac1eaa75f5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0c1d6a6f174da3f5956ac77b19c842ac1eaa75f5

Author: Robert Wilhelm <robert.wilhelm at gmx.net>
Date:   Mon Oct 12 22:25:33 2020 +0200

jscript: Cc_parser_parse implement '&&' expression.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49450
Signed-off-by: Robert Wilhelm <robert.wilhelm at gmx.net>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit f586348deb97e8dea5f78ea3e45db39951ee8d30)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/jscript/cc_parser.y |  2 +-
 dlls/jscript/tests/cc.js | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/dlls/jscript/cc_parser.y b/dlls/jscript/cc_parser.y
index 4bc6260f194..dd72f61b03b 100644
--- a/dlls/jscript/cc_parser.y
+++ b/dlls/jscript/cc_parser.y
@@ -161,7 +161,7 @@ CCLogicalORExpression
 CCLogicalANDExpression
     : CCBitwiseORExpression         { $$ = $1; }
     | CCBitwiseANDExpression tAND CCBitwiseORExpression
-                                    { FIXME("'&&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
+                                    { $$ = ccval_bool(get_ccbool($1) && get_ccbool($3)); }
 
 CCBitwiseORExpression
     : CCBitwiseXORExpression        { $$ = $1; }
diff --git a/dlls/jscript/tests/cc.js b/dlls/jscript/tests/cc.js
index 8f45a3dd331..2232d2fb689 100644
--- a/dlls/jscript/tests/cc.js
+++ b/dlls/jscript/tests/cc.js
@@ -180,6 +180,23 @@ expect(@test, true);
 @set @test = (1 >= true-1)
 expect(@test, true);
 
+ at set @test = (true && true)
+expect(@test, true);
+
+ at set @test = (false && true)
+expect(@test, false);
+
+ at set @test = (true && false)
+expect(@test, false);
+
+ at set @test = (false && false)
+expect(@test, false);
+
+if(!isWin64) {
+ at set @test = (@_win32&&@_jscript_version>=5)
+expect(@test, true);
+}
+
 @if (false)
     this wouldn not parse
 "@end




More information about the wine-cvs mailing list