Use logical operators for bool converions. (#2620)

The explicit boolean type conversion (introduced by #2575) desn't work
with TizenRT if custom boolean representation is used. Of course,
TizenRT gives an opportunity to use the C99 standard boolean (that works
well if that is set).

I've replaced all the explicit boolean type conversions with double
negations that helps to work JerryScript well with custom boolean types.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.uszeged@partner.samsung.com
This commit is contained in:
Roland Takacs
2018-11-28 11:35:12 +01:00
committed by Zoltan Herczeg
parent 17178ec185
commit 5151f9161f
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -2194,7 +2194,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
current_flags);
ecma_deref_ecma_string (pattern_str_p);
bool is_throw = (bool) ECMA_IS_VALUE_ERROR (completion_value);
bool is_throw = ECMA_IS_VALUE_ERROR (completion_value) != 0;
ecma_free_value (completion_value);
+2 -2
View File
@@ -418,7 +418,7 @@ parser_parse_class_literal (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->last_cbc_opcode == CBC_PUSH_LITERAL);
cbc_ext_opcode_t opcode;
bool is_static = (bool) (status_flags & PARSER_CLASS_STATIC_FUNCTION);
bool is_static = (status_flags & PARSER_CLASS_STATIC_FUNCTION) != 0;
if (is_computed)
{
@@ -1366,7 +1366,7 @@ parser_parse_unary_expression (parser_context_t *context_p, /**< context */
break;
}
bool is_static = (bool) (context_p->status_flags & PARSER_CLASS_STATIC_FUNCTION);
bool is_static = (context_p->status_flags & PARSER_CLASS_STATIC_FUNCTION) != 0;
parser_emit_cbc_ext (context_p, is_static ? CBC_EXT_PUSH_STATIC_SUPER : CBC_EXT_PUSH_SUPER);
break;
}