Add arithmetic operations support for the API (#3249)
This patch extends the jerry_binary_operation_t list with arithmetic operations. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -54,7 +54,7 @@ do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case NUMBER_ARITHMETIC_SUBSTRACTION:
|
||||
case NUMBER_ARITHMETIC_SUBTRACTION:
|
||||
{
|
||||
result = num_left - num_right;
|
||||
break;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NUMBER_ARITHMETIC_SUBSTRACTION, /**< substraction */
|
||||
NUMBER_ARITHMETIC_SUBTRACTION, /**< subtraction */
|
||||
NUMBER_ARITHMETIC_MULTIPLICATION, /**< multiplication */
|
||||
NUMBER_ARITHMETIC_DIVISION, /**< division */
|
||||
NUMBER_ARITHMETIC_REMAINDER, /**< remainder calculation */
|
||||
|
||||
+1
-1
@@ -2393,7 +2393,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
continue;
|
||||
}
|
||||
|
||||
result = do_number_arithmetic (NUMBER_ARITHMETIC_SUBSTRACTION,
|
||||
result = do_number_arithmetic (NUMBER_ARITHMETIC_SUBTRACTION,
|
||||
left_value,
|
||||
right_value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user