Add vera rules to check consecutive and trailing empty lines (#3540)

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2020-02-03 16:39:04 +01:00
committed by GitHub
parent 563a5d93e9
commit a78c8d4f16
63 changed files with 68 additions and 87 deletions
-1
View File
@@ -1758,7 +1758,6 @@ jerry_get_literals_from_snapshot (const uint32_t *snapshot_p, /**< input snapsho
#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */
} /* jerry_get_literals_from_snapshot */
/**
* Generate snapshot function from specified source and arguments
*
-1
View File
@@ -2885,7 +2885,6 @@ jerry_objects_foreach_by_native_info (const jerry_object_native_info_t *native_i
ecma_native_pointer_t *native_pointer_p;
jmem_cpointer_t iter_cp = JERRY_CONTEXT (ecma_gc_objects_cp);
while (iter_cp != JMEM_CP_NULL)
-2
View File
@@ -455,7 +455,6 @@
# define JERRY_ATTR_GLOBAL_HEAP
#endif /* !defined (JERRY_ATTR_GLOBAL_HEAP) */
/**
* Sanity check for macros to see if the values are 0 or 1
*
@@ -653,7 +652,6 @@
# error "Invalid value for 'JERRY_VM_EXEC_STOP' macro."
#endif
#define ENABLED(FEATURE) ((FEATURE) == 1)
#define DISABLED(FEATURE) ((FEATURE) != 1)
-2
View File
@@ -1150,7 +1150,6 @@ jerry_debugger_receive (jerry_debugger_uint8_data_t **message_data_p) /**< [out]
}
} /* jerry_debugger_receive */
#undef JERRY_DEBUGGER_CHECK_PACKET_SIZE
/**
@@ -1214,7 +1213,6 @@ jerry_debugger_send_type (jerry_debugger_header_type_t type) /**< message type *
jerry_debugger_send (sizeof (jerry_debugger_send_type_t));
} /* jerry_debugger_send_type */
/**
* Send the type signal to the client.
*
@@ -676,7 +676,6 @@ ecma_append_chars_to_string (ecma_string_t *string1_p, /**< base ecma-string */
cesu8_string2_p,
cesu8_string2_size);
if (magic_string_id != LIT_MAGIC_STRING__COUNT)
{
ecma_deref_ecma_string (string1_p);
-1
View File
@@ -79,7 +79,6 @@ ecma_module_create_normalized_path (const uint8_t *char_p, /**< module specifier
ECMA_MODULE_MAX_PATH,
(char *) module_path_p);
if (normalized_size > 0)
{
/* Convert the normalized path to cesu8. */
@@ -245,7 +245,6 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
uint32_t mask = hashmap_p->max_property_count - 1;
entry_index &= mask;
#ifndef JERRY_NDEBUG
/* See the comment for this variable in ecma_property_hashmap_create. */
uint32_t start_entry_index = entry_index;
@@ -72,7 +72,6 @@ void ecma_property_hashmap_insert (ecma_object_t *object_p, ecma_string_t *name_
ecma_property_hashmap_delete_status ecma_property_hashmap_delete (ecma_object_t *object_p, jmem_cpointer_t name_cp,
ecma_property_t *property_p);
ecma_property_t *ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, ecma_string_t *name_p,
jmem_cpointer_t *property_real_name_cp);
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
@@ -19,7 +19,6 @@
#include "ecma-builtin-helpers-macro-defines.inc.h"
#if ENABLED (JERRY_ES2015)
SIMPLE_VALUE (LIT_MAGIC_STRING_COPY_WITHIN,
@@ -1292,7 +1292,6 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
return get_value;
}
if (ecma_is_value_found (get_value))
{
/* 9.c.ii */
@@ -1944,7 +1943,6 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
mapped_value,
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
ecma_free_value (mapped_value);
ecma_free_value (current_value);
#if ENABLED (JERRY_ES2015)
@@ -183,7 +183,6 @@ ecma_date_parse_month_name (const lit_utf8_byte_t **str_p, /**< pointer to the c
return 0;
} /* ecma_date_parse_month_name */
/**
* Calculate MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli)) for Date constructor and UTC
*
@@ -387,7 +387,6 @@ ecma_builtin_global_object_parse_float (const lit_utf8_byte_t *string_buff, /**<
}
}
/* Set end position to the end of whole part. */
end_p = str_curr_p;
if (str_curr_p < str_end_p)
@@ -425,7 +424,6 @@ ecma_builtin_global_object_parse_float (const lit_utf8_byte_t *string_buff, /**<
}
}
if (str_curr_p < str_end_p)
{
current = *str_curr_p++;
@@ -146,7 +146,6 @@ OBJECT_VALUE (LIT_MAGIC_STRING_REFLECT_UL,
ECMA_PROPERTY_CONFIGURABLE_WRITABLE)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
#if ENABLED (JERRY_BUILTIN_JSON)
/* ECMA-262 v5, 15.1.5.2 */
OBJECT_VALUE (LIT_MAGIC_STRING_JSON_U,
@@ -72,4 +72,3 @@ ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, /**<
* @}
* @}
*/
@@ -220,7 +220,6 @@ ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, /**< th
ecma_value_t index_obj_value = ecma_op_to_object (index_value);
if (ECMA_IS_VALUE_ERROR (index_obj_value))
{
ecma_free_value (index_value);
@@ -265,7 +264,6 @@ cleanup:
return ret_string_p;
} /* ecma_builtin_helper_get_to_locale_string_at_index */
/**
* The Object.keys and Object.getOwnPropertyNames routine's common part.
*
@@ -444,7 +444,6 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
arguments_number);
}
JERRY_ASSERT (builtin_routine_id == ECMA_MATH_OBJECT_RANDOM);
return ecma_builtin_math_object_random ();
@@ -50,7 +50,6 @@ enum
ECMA_OBJECT_PROTOTYPE_PROPERTY_IS_ENUMERABLE,
};
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-object-prototype.inc.h"
#define BUILTIN_UNDERSCORED_ID object_prototype
#include "ecma-builtin-internal-routines-template.inc.h"
@@ -180,7 +180,6 @@ ecma_set_prototype_of (ecma_value_t o_value, /**< O */
ECMA_SET_NON_NULL_POINTER (v_cp, ecma_get_object_from_value (v_value));
}
/* 3., 4. */
if (v_cp == o_p->u2.prototype_cp)
{
@@ -133,7 +133,6 @@ ecma_builtin_promise_perform_race (ecma_value_t iterator, /**< the iterator for
JERRY_ASSERT (ecma_is_value_object (iterator)
&& ecma_is_value_object (capability));
ecma_object_t *capability_obj_p = ecma_get_object_from_value (capability);
/* 1. */
while (true)
@@ -290,7 +289,6 @@ ecma_builtin_promise_all_handler (const ecma_value_t function, /**< the function
argv[0],
false);
/* 9-10. */
ecma_value_t ret = ECMA_VALUE_UNDEFINED;
if (ecma_builtin_promise_remaining_inc_or_dec (remaining, false) == 0)
@@ -77,7 +77,6 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
JERRY_ASSERT (ecma_is_value_string (iterated_value));
ecma_string_t *string_p = ecma_get_string_from_value (iterated_value);
/* 6. */
@@ -715,7 +715,6 @@ ecma_builtin_string_prototype_object_slice (ecma_string_t *get_string_val, /**<
return ecma_make_string_value (new_str_p);
} /* ecma_builtin_string_prototype_object_slice */
/**
* The String.prototype object's 'split' routine
*
@@ -362,7 +362,6 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FLOAT64ARRAY,
float64array)
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
BUILTIN (ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE,
ECMA_OBJECT_TYPE_GENERAL,
ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE,
@@ -332,7 +332,6 @@ ecma_builtin_typedarray_prototype_for_each (ecma_value_t this_arg, /**< this arg
TYPEDARRAY_ROUTINE_FOREACH);
} /* ecma_builtin_typedarray_prototype_for_each */
#if ENABLED (JERRY_ES2015)
/**
@@ -1743,7 +1742,6 @@ ecma_builtin_typedarray_prototype_index_of (ecma_value_t this_arg, /**< this arg
: (uint32_t) (info.length + num_var));
}
ecma_number_t search_num = ecma_get_number_from_value (args[0]);
ecma_typedarray_getter_fn_t getter_cb = ecma_get_typedarray_getter_fn (info.id);
@@ -737,7 +737,6 @@ ecma_op_array_species_create (ecma_object_t *original_array_p, /**< The object f
&len_val,
1);
ecma_deref_object (ctor_object_p);
ecma_free_value (len_val);
return ret_val;
@@ -25,7 +25,6 @@
* @{
*/
/**
* Maximum number of new array holes in a fast mode access array.
* If the number of new holes exceeds this limit, the array is converted back
@@ -92,7 +92,6 @@ ecma_arraybuffer_new_object_external (ecma_length_t length, /**< length of the b
return object_p;
} /* ecma_arraybuffer_new_object_external */
/**
* ArrayBuffer object creation operation.
*
@@ -201,7 +201,6 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
ecma_deref_object (next_object_p);
}
if (ECMA_IS_VALUE_ERROR (result))
{
ecma_op_iterator_close (iter);
@@ -678,7 +677,6 @@ ecma_op_container_delete (ecma_value_t this_arg, /**< this argument */
return ECMA_VALUE_FALSE;
}
ecma_named_data_property_assign_value ((ecma_object_t *) container_p,
ECMA_PROPERTY_VALUE_PTR (property_p),
ECMA_VALUE_EMPTY);
@@ -681,7 +681,6 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
return result;
} /* ecma_op_function_has_instance */
#if ENABLED (JERRY_ES2015)
/**
* Indicates whether the class has been invoked with 'new'.
@@ -289,7 +289,6 @@ ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
&& ecma_is_lexical_environment (lex_env_p));
JERRY_ASSERT (name_p != NULL);
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
{
ecma_property_t *prop_p = ecma_find_named_property (lex_env_p, name_p);
@@ -418,7 +418,6 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
JERRY_ASSERT (property_desc_type == ECMA_PROPERTY_TYPE_GENERIC
|| property_desc_type == ECMA_PROPERTY_TYPE_NAMEDDATA);
ecma_property_value_t *new_prop_value_p = ecma_create_named_data_property (object_p,
property_name_p,
prop_attributes,
@@ -165,7 +165,6 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
return ECMA_PROPERTY_TYPE_NOT_FOUND;
}
break;
}
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
@@ -2339,7 +2338,6 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
JMEM_FINALIZE_LOCAL_ARRAY (names_p);
if (!is_with_prototype_chain || prototype_chain_iter_p->u2.prototype_cp == JMEM_CP_NULL)
{
break;
@@ -34,7 +34,6 @@ ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p,
ecma_collection_t *main_collection_p,
ecma_collection_t *non_enum_collection_p);
/**
* @}
* @}
@@ -123,7 +123,6 @@ ecma_typedarray_get_double_element (lit_utf8_byte_t *src) /**< the location in t
return (ecma_number_t) num;
} /* ecma_typedarray_get_double_element */
/**
* Normalize the given ecma_number_t to an uint32_t value
*/
@@ -169,7 +168,6 @@ ecma_typedarray_set_int8_element (lit_utf8_byte_t *dst_p, /**< the location in t
*dst_p = (lit_utf8_byte_t) num;
} /* ecma_typedarray_set_int8_element */
/**
* Write an uint8_t value into the given arraybuffer
*/
@@ -223,7 +221,6 @@ ecma_typedarray_set_int16_element (lit_utf8_byte_t *dst_p, /**< the location in
memcpy (dst_p, &num, sizeof (int16_t));
} /* ecma_typedarray_set_int16_element */
/**
* Write an uint8_t value into the given arraybuffer
*/
@@ -246,7 +243,6 @@ ecma_typedarray_set_int32_element (lit_utf8_byte_t *dst_p, /**< the location in
memcpy (dst_p, &num, sizeof (int32_t));
} /* ecma_typedarray_set_int32_element */
/**
* Write an uint32_t value into the given arraybuffer
*/
@@ -258,7 +254,6 @@ ecma_typedarray_set_uint32_element (lit_utf8_byte_t *dst_p, /**< the location in
memcpy (dst_p, &num, sizeof (uint32_t));
} /* ecma_typedarray_set_uint32_element */
/**
* Write a float value into the given arraybuffer
*/
@@ -283,7 +278,6 @@ ecma_typedarray_set_double_element (lit_utf8_byte_t *dst_p, /**< the location in
} /* ecma_typedarray_set_double_element */
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
/**
* Builtin id of the first %TypedArray% builtin routine intrinsic object
*/
@@ -666,7 +660,6 @@ ecma_typedarray_create_object_with_typedarray (ecma_object_t *typedarray_p, /**<
ecma_typedarray_getter_fn_t src_typedarray_getter_cb = ecma_get_typedarray_getter_fn (src_id);
ecma_typedarray_setter_fn_t target_typedarray_setter_cb = ecma_get_typedarray_setter_fn (typedarray_id);
for (uint32_t i = 0; i < array_length; i++)
{
/* Convert values from source to destination format. */
@@ -839,7 +832,6 @@ ecma_typedarray_get_element_size_shift (ecma_object_t *typedarray_p) /**< the po
return ecma_typedarray_helper_get_shift_size (ecma_get_typedarray_id (typedarray_p));
} /* ecma_typedarray_get_element_size_shift */
/**
* Get the array length of the typedarray object
*
-1
View File
@@ -666,7 +666,6 @@ typedef enum
JERRY_TYPEDARRAY_FLOAT64,
} jerry_typedarray_type_t;
bool jerry_value_is_typedarray (jerry_value_t value);
jerry_value_t jerry_create_typedarray (jerry_typedarray_type_t type_name, jerry_length_t length);
jerry_value_t jerry_create_typedarray_for_arraybuffer_sz (jerry_typedarray_type_t type_name,
-1
View File
@@ -231,4 +231,3 @@ jmem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompres
return (void *) uint_ptr;
} /* jmem_decompress_pointer */
-1
View File
@@ -409,7 +409,6 @@ jmem_heap_insert_block (jmem_heap_free_t *block_p, /**< block to insert */
JMEM_VALGRIND_DEFINED_SPACE (block_p, sizeof (jmem_heap_free_t));
JMEM_VALGRIND_DEFINED_SPACE (next_p, sizeof (jmem_heap_free_t));
const uint32_t block_offset = JMEM_HEAP_GET_OFFSET_FROM_ADDR (block_p);
/* Update prev. */
-1
View File
@@ -16,7 +16,6 @@
/* This file is automatically generated by the gen-magic-strings.py script
* from lit-magic-strings.ini. Do not edit! */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__EMPTY, "")
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SPACE_CHAR, " ")
#if ENABLED (JERRY_ES2015)
-1
View File
@@ -2692,7 +2692,6 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
pattern_str_p = ecma_new_ecma_string_from_utf8_converted_to_cesu8 (regex_start_p, length);
}
completion_value = re_compile_bytecode (&re_bytecode_p,
pattern_str_p,
current_flags);
-1
View File
@@ -1,4 +1,3 @@
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");