Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/03.API-EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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");
}
```

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down