From d9e8c013c6346a0fec875fdd51b5a85b47191713 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 2 Oct 2014 14:36:35 +0200 Subject: [PATCH] jscript: Added support for '==' CC expression. --- dlls/jscript/cc_parser.y | 2 +- dlls/jscript/tests/cc.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/cc_parser.y b/dlls/jscript/cc_parser.y index 34ee90cd956..b22aef827ba 100644 --- a/dlls/jscript/cc_parser.y +++ b/dlls/jscript/cc_parser.y @@ -181,7 +181,7 @@ CCBitwiseANDExpression CCEqualityExpression : CCRelationalExpression { $$ = $1; } | CCEqualityExpression tEQ CCRelationalExpression - { FIXME("'==' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } + { $$ = ccval_bool(get_ccnum($1) == get_ccnum($3)); } | CCEqualityExpression tNEQ CCRelationalExpression { $$ = ccval_bool(get_ccnum($1) != get_ccnum($3)); } | CCEqualityExpression tEQEQ CCRelationalExpression diff --git a/dlls/jscript/tests/cc.js b/dlls/jscript/tests/cc.js index 7ce3682575f..09ef285b2ce 100644 --- a/dlls/jscript/tests/cc.js +++ b/dlls/jscript/tests/cc.js @@ -146,6 +146,15 @@ ok(@test === -1, "@test = " + @test); @set @test = (true-@_jscript) ok(@test === 0, "@test = " + @test); +@set @test = (true==1) +ok(@test === true, "@test = " + @test); + +@set @test = (1==false+1) +ok(@test === true, "@test = " + @test); + +@set @test = (1+true==false+1) +ok(@test === false, "@test = " + @test); + @if (false) this wouldn not parse "@end