Skip to content

Commit 37f9b47

Browse files
committed
Fix API examples after the IO Port update
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
1 parent 15ba287 commit 37f9b47

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/03.API-EXAMPLE.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,27 +184,27 @@ print_value (const jerry_value_t value)
184184
{
185185
if (jerry_value_is_undefined (value))
186186
{
187-
jerry_port_logmsg (stdout, "undefined");
187+
jerry_port_console ("undefined");
188188
}
189189
else if (jerry_value_is_null (value))
190190
{
191-
jerry_port_logmsg (stdout, "null");
191+
jerry_port_console ("null");
192192
}
193193
else if (jerry_value_is_boolean (value))
194194
{
195195
if (jerry_get_boolean_value (value))
196196
{
197-
jerry_port_logmsg (stdout, "true");
197+
jerry_port_console ("true");
198198
}
199199
else
200200
{
201-
jerry_port_logmsg (stdout, "false");
201+
jerry_port_console ("false");
202202
}
203203
}
204204
/* Float value */
205205
else if (jerry_value_is_number (value))
206206
{
207-
jerry_port_logmsg (stdout, "number");
207+
jerry_port_console ("number");
208208
}
209209
/* String value */
210210
else if (jerry_value_is_string (value))
@@ -215,15 +215,15 @@ print_value (const jerry_value_t value)
215215
216216
jerry_string_to_char_buffer (value, str_buf_p, req_sz);
217217
218-
jerry_port_logmsg (stdout, "%s", (const char *) str_buf_p);
218+
jerry_port_console ("%s", (const char *) str_buf_p);
219219
}
220220
/* Object reference */
221221
else if (jerry_value_is_object (value))
222222
{
223-
jerry_port_logmsg (stdout, "[JS object]");
223+
jerry_port_console ("[JS object]");
224224
}
225225
226-
jerry_port_logmsg (stdout, "\n");
226+
jerry_port_console ("\n");
227227
}
228228
```
229229

@@ -264,7 +264,7 @@ main (int argc, char * argv[])
264264
char *cmd_tail = cmd;
265265
size_t len = 0;
266266

267-
jerry_port_logmsg (stdout, "> ");
267+
jerry_port_console ("> ");
268268

269269
/* Read next command */
270270
while (true)
@@ -295,7 +295,7 @@ main (int argc, char * argv[])
295295
{
296296
/* Evaluated JS code thrown an exception
297297
* and didn't handle it with try-catch-finally */
298-
jerry_port_errormsg ("Unhandled JS exception occured: ");
298+
jerry_port_console ("Unhandled JS exception occured: ");
299299
}
300300

301301
print_value (ret_val);

0 commit comments

Comments
 (0)