Fix API examples after the IO Port update

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó 2016-07-22 09:05:19 +02:00
parent 15ba287b9e
commit 37f9b475c0

View File

@ -184,27 +184,27 @@ print_value (const jerry_value_t value)
{
if (jerry_value_is_undefined (value))
{
jerry_port_logmsg (stdout, "undefined");
jerry_port_console ("undefined");
}
else if (jerry_value_is_null (value))
{
jerry_port_logmsg (stdout, "null");
jerry_port_console ("null");
}
else if (jerry_value_is_boolean (value))
{
if (jerry_get_boolean_value (value))
{
jerry_port_logmsg (stdout, "true");
jerry_port_console ("true");
}
else
{
jerry_port_logmsg (stdout, "false");
jerry_port_console ("false");
}
}
/* Float value */
else if (jerry_value_is_number (value))
{
jerry_port_logmsg (stdout, "number");
jerry_port_console ("number");
}
/* String value */
else if (jerry_value_is_string (value))
@ -215,15 +215,15 @@ print_value (const jerry_value_t value)
jerry_string_to_char_buffer (value, str_buf_p, req_sz);
jerry_port_logmsg (stdout, "%s", (const char *) str_buf_p);
jerry_port_console ("%s", (const char *) str_buf_p);
}
/* Object reference */
else if (jerry_value_is_object (value))
{
jerry_port_logmsg (stdout, "[JS object]");
jerry_port_console ("[JS object]");
}
jerry_port_logmsg (stdout, "\n");
jerry_port_console ("\n");
}
```
@ -264,7 +264,7 @@ main (int argc, char * argv[])
char *cmd_tail = cmd;
size_t len = 0;
jerry_port_logmsg (stdout, "> ");
jerry_port_console ("> ");
/* Read next command */
while (true)
@ -295,7 +295,7 @@ main (int argc, char * argv[])
{
/* Evaluated JS code thrown an exception
* and didn't handle it with try-catch-finally */
jerry_port_errormsg ("Unhandled JS exception occured: ");
jerry_port_console ("Unhandled JS exception occured: ");
}
print_value (ret_val);