void jsp_early_error_emit_error_on_eval_and_arguments (literal_t lit, /**< literal to check */ locus loc) /**< location of the literal in source code */ { if (lit_literal_equal_type_utf8 (lit, lit_get_magic_string_utf8 (LIT_MAGIC_STRING_ARGUMENTS), lit_get_magic_string_size (LIT_MAGIC_STRING_ARGUMENTS)) || lit_literal_equal_type_utf8 (lit, lit_get_magic_string_utf8 (LIT_MAGIC_STRING_EVAL), lit_get_magic_string_size (LIT_MAGIC_STRING_EVAL))) { PARSE_ERROR (JSP_EARLY_ERROR_SYNTAX, "'eval' and 'arguments' are not allowed here in strict mode", loc); } }
static void emit_error_on_eval_and_arguments (operand op, locus loc __attr_unused___) { if (op.type == OPERAND_LITERAL) { if (lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.data.lit_id), lit_get_magic_string_utf8 (LIT_MAGIC_STRING_ARGUMENTS), lit_get_magic_string_size (LIT_MAGIC_STRING_ARGUMENTS)) || lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.data.lit_id), lit_get_magic_string_utf8 (LIT_MAGIC_STRING_EVAL), lit_get_magic_string_size (LIT_MAGIC_STRING_EVAL))) { PARSE_ERROR ("'eval' and 'arguments' are not allowed here in strict mode", loc); } } }
static void emit_error_on_eval_and_arguments (jsp_operand_t op, locus loc __attr_unused___) { if (op.is_literal_operand ()) { if (lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.get_literal ()), lit_get_magic_string_utf8 (LIT_MAGIC_STRING_ARGUMENTS), lit_get_magic_string_size (LIT_MAGIC_STRING_ARGUMENTS)) || lit_literal_equal_type_utf8 (lit_get_literal_by_cp (op.get_literal ()), lit_get_magic_string_utf8 (LIT_MAGIC_STRING_EVAL), lit_get_magic_string_size (LIT_MAGIC_STRING_EVAL))) { PARSE_ERROR (JSP_EARLY_ERROR_SYNTAX, "'eval' and 'arguments' are not allowed here in strict mode", loc); } } }
/** * Check if literal equals to C string. * Check that literal is a string literal before performing detailed comparison. * * @return true if equal * false otherwise */ bool lit_literal_equal_type_cstr (lit_literal_t lit, /**< literal to compare */ const char *c_str_p) /**< zero-terminated C-string */ { return lit_literal_equal_type_utf8 (lit, (const lit_utf8_byte_t *) c_str_p, (lit_utf8_size_t) strlen (c_str_p)); } /* lit_literal_equal_type_cstr */