Module: wine Branch: master Commit: fcd9817581533a29b540546e9a08e593087740bf URL: http://source.winehq.org/git/wine.git/?a=commit;h=fcd9817581533a29b540546e9a...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Oct 1 10:45:37 2014 +0200
jscript: Implicitly turn CC on for @if instruction.
---
dlls/jscript/lex.c | 3 +++ dlls/jscript/tests/run.c | 6 ++++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c index e541182..b4a3700 100644 --- a/dlls/jscript/lex.c +++ b/dlls/jscript/lex.c @@ -1051,6 +1051,9 @@ static int cc_token(parser_ctx_t *ctx, void *lval) }
if(!check_keyword(ctx, ifW, NULL)) { + if(!init_cc(ctx)) + return -1; + if(!skip_spaces(ctx) || *ctx->ptr != '(') return lex_error(ctx, JS_E_MISSING_LBRACKET);
diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 42336a4..aa1783e 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -2185,6 +2185,12 @@ static BOOL run_tests(void)
parse_script_a("@set @t=2\nok(@t === 2, '@t = ' + @t);");
+ SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + parse_script_a("@if(true)\nif(@_jscript) reportSuccess();\n@end"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + run_from_res("lang.js"); run_from_res("api.js"); run_from_res("regexp.js");