Refactor JSON builtin methods (#3031)

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
2019-09-05 01:25:19 +02:00
committed by GitHub
parent 1088273bc3
commit 8bccbbf08f
6 changed files with 958 additions and 1284 deletions
@@ -159,20 +159,23 @@ typedef struct
ecma_json_occurence_stack_item_t *occurence_stack_last_p;
/** The actual indentation text. */
ecma_string_t *indent_str_p;
ecma_stringbuilder_t indent_builder;
/** The indentation text. */
ecma_string_t *gap_str_p;
/** The replacer function. */
ecma_object_t *replacer_function_p;
/** Result string builder. */
ecma_stringbuilder_t result_builder;
} ecma_json_stringify_context_t;
ecma_value_t ecma_builtin_json_parse_buffer (const lit_utf8_byte_t * str_start_p,
lit_utf8_size_t string_size);
ecma_value_t ecma_builtin_json_string_from_object (const ecma_value_t arg1);
bool ecma_json_has_object_in_stack (ecma_json_occurence_stack_item_t *stack_p, ecma_object_t *object_p);
bool ecma_has_string_value_in_collection (ecma_collection_header_t *collection_p, ecma_value_t string_value);
bool ecma_has_string_value_in_collection (ecma_collection_header_t *collection_p, ecma_string_t *string_p);
ecma_value_t
ecma_builtin_helper_json_create_formatted_json (lit_utf8_byte_t left_bracket, lit_utf8_byte_t right_bracket,