Update the webpage (#4712)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
+12
-16
@@ -163,7 +163,7 @@ main (void)
|
||||
jerry_init (JERRY_INIT_EMPTY);
|
||||
|
||||
/* Setup Global scope code */
|
||||
jerry_value_t parsed_code = jerry_parse (NULL, 0, script, sizeof (script) - 1, JERRY_PARSE_NO_OPTS);
|
||||
jerry_value_t parsed_code = jerry_parse (script, sizeof (script) - 1, NULL);
|
||||
|
||||
/* Check if there is any JS code parse error */
|
||||
if (!jerry_value_is_error (parsed_code))
|
||||
@@ -224,8 +224,7 @@ The `api-example-4.c` file should contain the following code:
|
||||
#include "jerryscript.h"
|
||||
|
||||
static jerry_value_t
|
||||
print_handler (const jerry_value_t function_object,
|
||||
const jerry_value_t function_this,
|
||||
print_handler (const jerry_call_info_t *call_info_p,
|
||||
const jerry_value_t arguments[],
|
||||
const jerry_length_t argument_count)
|
||||
{
|
||||
@@ -270,7 +269,7 @@ main (void)
|
||||
}
|
||||
|
||||
/* Setup Global scope code */
|
||||
jerry_value_t parsed_code = jerry_parse (NULL, 0, script, script_size, JERRY_PARSE_NO_OPTS);
|
||||
jerry_value_t parsed_code = jerry_parse (script, script_size, NULL);
|
||||
|
||||
if (!jerry_value_is_error (parsed_code))
|
||||
{
|
||||
@@ -326,8 +325,7 @@ The `api-example-5.c` file should contain the following code:
|
||||
#include "jerryscript.h"
|
||||
|
||||
static jerry_value_t
|
||||
print_handler (const jerry_value_t function_object,
|
||||
const jerry_value_t function_this,
|
||||
print_handler (const jerry_call_info_t *call_info_p,
|
||||
const jerry_value_t arguments[],
|
||||
const jerry_length_t arguments_count)
|
||||
{
|
||||
@@ -390,7 +388,7 @@ main (void)
|
||||
}
|
||||
|
||||
/* Setup Global scope code */
|
||||
jerry_value_t parsed_code = jerry_parse (NULL, 0, script, script_size, JERRY_PARSE_NO_OPTS);
|
||||
jerry_value_t parsed_code = jerry_parse (script, script_size, NULL);
|
||||
|
||||
if (!jerry_value_is_error (parsed_code))
|
||||
{
|
||||
@@ -456,7 +454,7 @@ main (void)
|
||||
jerryx_handler_print);
|
||||
|
||||
/* Setup Global scope code */
|
||||
jerry_value_t parsed_code = jerry_parse (NULL, 0, script, script_size, JERRY_PARSE_NO_OPTS);
|
||||
jerry_value_t parsed_code = jerry_parse (script, script_size, NULL);
|
||||
|
||||
if (!jerry_value_is_error (parsed_code))
|
||||
{
|
||||
@@ -627,7 +625,7 @@ print_value (const jerry_value_t jsvalue)
|
||||
}
|
||||
else if (jerry_value_is_boolean (value))
|
||||
{
|
||||
if (jerry_get_boolean_value (value))
|
||||
if (jerry_value_is_true (value))
|
||||
{
|
||||
printf ("true");
|
||||
}
|
||||
@@ -721,7 +719,7 @@ print_value (const jerry_value_t jsvalue)
|
||||
}
|
||||
else if (jerry_value_is_boolean (value))
|
||||
{
|
||||
if (jerry_get_boolean_value (value))
|
||||
if (jerry_value_is_true (value))
|
||||
{
|
||||
printf ("true");
|
||||
}
|
||||
@@ -861,8 +859,7 @@ struct my_struct
|
||||
* Get a string from a native object
|
||||
*/
|
||||
static jerry_value_t
|
||||
get_msg_handler (const jerry_value_t func_value, /**< function object */
|
||||
const jerry_value_t this_value, /**< this arg */
|
||||
get_msg_handler (const jerry_call_info_t *call_info_p, /**< call information */
|
||||
const jerry_value_t *args_p, /**< function arguments */
|
||||
const jerry_length_t args_cnt) /**< number of function arguments */
|
||||
{
|
||||
@@ -965,8 +962,7 @@ Use the following code for `api-example-10.c`:
|
||||
* Add param to 'this.x'
|
||||
*/
|
||||
static jerry_value_t
|
||||
add_handler (const jerry_value_t func_value, /**< function object */
|
||||
const jerry_value_t this_val, /**< this arg */
|
||||
add_handler (const jerry_call_info_t *call_info_p, /**< call information */
|
||||
const jerry_value_t args_p[], /**< function arguments */
|
||||
const jerry_length_t args_cnt) /**< number of function arguments */
|
||||
{
|
||||
@@ -975,7 +971,7 @@ add_handler (const jerry_value_t func_value, /**< function object */
|
||||
|
||||
/* Get 'this.x' */
|
||||
jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "x");
|
||||
jerry_value_t x_val = jerry_get_property (this_val, prop_name);
|
||||
jerry_value_t x_val = jerry_get_property (call_info_p->this_value, prop_name);
|
||||
|
||||
if (!jerry_value_is_error (x_val))
|
||||
{
|
||||
@@ -987,7 +983,7 @@ add_handler (const jerry_value_t func_value, /**< function object */
|
||||
jerry_value_t res_val = jerry_create_number (x + d);
|
||||
|
||||
/* Set the new value of 'this.x' */
|
||||
jerry_release_value (jerry_set_property (this_val, prop_name, res_val));
|
||||
jerry_release_value (jerry_set_property (call_info_p->this_value, prop_name, res_val));
|
||||
jerry_release_value (res_val);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user