Fix unhandled exceptions with unicode error messages (#2994)

Fixes #2993

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-07-30 19:48:56 +02:00
committed by Robert Fancsik
parent a2d242eab9
commit dfafb1aa6b
7 changed files with 28 additions and 13 deletions
+4 -4
View File
@@ -55,7 +55,7 @@ DELCARE_HANDLER(print) {
{
if (jerry_value_is_string (args_p[cc]))
{
jerry_size_t size = jerry_get_string_size (args_p[0]);
jerry_size_t size = jerry_get_utf8_string_size (args_p[0]);
char *buffer;
buffer = (char *) malloc(size + 1);
@@ -66,9 +66,9 @@ DELCARE_HANDLER(print) {
continue;
}
jerry_string_to_char_buffer (args_p[cc],
(jerry_char_t *) buffer,
size);
jerry_string_to_utf8_char_buffer (args_p[cc],
(jerry_char_t *) buffer,
size);
*(buffer + size) = 0;
printf("%s ", buffer);
free (buffer);