Typo fixes related to jerry_json_stringify (#2611)

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2018-11-22 01:05:34 +00:00
committed by Akos Kiss
parent c87aa83b0d
commit f9e21540d6
4 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -5991,7 +5991,7 @@ jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t strin
} }
``` ```
## jerry_stringify ## jerry_json_stringify
**Summary** **Summary**
@@ -6000,7 +6000,7 @@ jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t strin
**Prototype** **Prototype**
```c ```c
jerry_value_t jerry_json_stringfy (const jerry_value_t object_to_stringify) jerry_value_t jerry_json_stringify (const jerry_value_t object_to_stringify)
``` ```
- `object_to_stringify` - a jerry_value_t object to stringify - `object_to_stringify` - a jerry_value_t object to stringify
@@ -6016,7 +6016,7 @@ jerry_value_t jerry_json_stringfy (const jerry_value_t object_to_stringify)
jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name"); jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name");
jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John"); jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John");
jerry_set_property (obj, key, value); jerry_set_property (obj, key, value);
jerry_value_t stringified = jerry_json_stringfy (obj); jerry_value_t stringified = jerry_json_stringify (obj);
//stringified now contains a json formated string //stringified now contains a json formated string
+2 -2
View File
@@ -3406,7 +3406,7 @@ jerry_json_parse (const jerry_char_t *string_p, /**< json string */
* @return json formated jerry_value_t or an error massage * @return json formated jerry_value_t or an error massage
*/ */
jerry_value_t jerry_value_t
jerry_json_stringfy (const jerry_value_t object_to_stringify) /**< a jerry_object_t to stringify */ jerry_json_stringify (const jerry_value_t object_to_stringify) /**< a jerry_object_t to stringify */
{ {
jerry_assert_api_available (); jerry_assert_api_available ();
#ifndef CONFIG_DISABLE_JSON_BUILTIN #ifndef CONFIG_DISABLE_JSON_BUILTIN
@@ -3423,7 +3423,7 @@ jerry_json_stringfy (const jerry_value_t object_to_stringify) /**< a jerry_objec
return jerry_throw (ecma_raise_syntax_error (ECMA_ERR_MSG ("The JSON has been disabled."))); return jerry_throw (ecma_raise_syntax_error (ECMA_ERR_MSG ("The JSON has been disabled.")));
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */ #endif /* !CONFIG_DISABLE_JSON_BUILTIN */
} /* jerry_json_stringfy */ } /* jerry_json_stringify */
/** /**
* @} * @}
+1 -1
View File
@@ -601,7 +601,7 @@ jerry_value_t jerry_get_typedarray_buffer (jerry_value_t value,
jerry_length_t *byte_offset, jerry_length_t *byte_offset,
jerry_length_t *byte_length); jerry_length_t *byte_length);
jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t string_size); jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t string_size);
jerry_value_t jerry_json_stringfy (const jerry_value_t object_to_stringify); jerry_value_t jerry_json_stringify (const jerry_value_t object_to_stringify);
/** /**
* @} * @}
+1 -1
View File
@@ -937,7 +937,7 @@ main (void)
jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name"); jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name");
jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John"); jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John");
jerry_set_property (obj, key, value); jerry_set_property (obj, key, value);
jerry_value_t stringified = jerry_json_stringfy (obj); jerry_value_t stringified = jerry_json_stringify (obj);
TEST_ASSERT (jerry_value_is_string (stringified)); TEST_ASSERT (jerry_value_is_string (stringified));
char buff[jerry_get_string_length (stringified)]; char buff[jerry_get_string_length (stringified)];
jerry_string_to_char_buffer (stringified, (jerry_char_t *) buff, jerry_string_to_char_buffer (stringified, (jerry_char_t *) buff,