Remove jerry_get_boolean_value (#4685)
JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi csgergo92@gmail.com
This commit is contained in:
@@ -35,8 +35,7 @@ NAME ## _handler (const jerry_call_info_t *call_info_p __UNUSED__, \
|
||||
|
||||
DELCARE_HANDLER(assert) {
|
||||
if (args_cnt == 1
|
||||
&& jerry_value_is_boolean (args_p[0])
|
||||
&& jerry_get_boolean_value (args_p[0]))
|
||||
&& jerry_value_is_true (args_p[0]))
|
||||
{
|
||||
printf (">> Jerry assert true\r\n");
|
||||
return jerry_create_boolean (true);
|
||||
|
||||
@@ -131,7 +131,7 @@ DECLARE_CLASS_FUNCTION(I2C, read) {
|
||||
|
||||
bool repeated = false;
|
||||
if (args_count == 4) {
|
||||
repeated = jerry_get_boolean_value(args[3]);
|
||||
repeated = jerry_value_is_true(args[3]);
|
||||
}
|
||||
|
||||
int result = native_ptr->read(address, data, length, repeated);
|
||||
@@ -223,7 +223,7 @@ DECLARE_CLASS_FUNCTION(I2C, write) {
|
||||
int address = jerry_get_number_value(args[0]);
|
||||
const uint32_t data_len = jerry_get_array_length(args[1]);
|
||||
int length = jerry_get_number_value(args[2]);
|
||||
bool repeated = args_count == 4 && jerry_get_boolean_value(args[3]);
|
||||
bool repeated = args_count == 4 && jerry_value_is_true(args[3]);
|
||||
|
||||
// Construct data byte array
|
||||
char *data = new char[data_len];
|
||||
|
||||
@@ -34,7 +34,7 @@ set_led (const jerry_value_t func_value, /**< function object */
|
||||
}
|
||||
|
||||
int ledPin = jerry_get_number_value (args_p[0]);
|
||||
bool value = jerry_get_boolean_value (args_p[1]);
|
||||
bool value = jerry_value_is_true (args_p[1]);
|
||||
|
||||
pinMode (ledPin, OUTPUT);
|
||||
digitalWrite (ledPin, value);
|
||||
|
||||
Reference in New Issue
Block a user