jscript: Implicitly turn CC on for @if instruction.
This commit is contained in:
parent
8b36388797
commit
fcd9817581
|
@ -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);
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue