Add test try_catch_finally.js. Fix parser and interpreter

This commit is contained in:
Ilmir Usmanov
2014-09-17 18:57:36 +04:00
parent 51b7dc0d69
commit 70cc5128cc
4 changed files with 73 additions and 15 deletions
+6 -6
View File
@@ -40,7 +40,7 @@ opfunc_is_true_jmp_down (opcode_t opdata, /**< operation data */
if (ecma_is_value_true (to_bool_completion.u.value))
{
JERRY_ASSERT (offset != 0 && (int_data->pos + offset < MAX_OPCODES));
JERRY_ASSERT (offset != 0 && ((uint32_t) int_data->pos + offset < MAX_OPCODES));
int_data->pos = (opcode_counter_t) (int_data->pos + offset);
}
else
@@ -73,7 +73,7 @@ opfunc_is_true_jmp_up (opcode_t opdata, /**< operation data */
if (ecma_is_value_true (to_bool_completion.u.value))
{
JERRY_ASSERT (offset != 0 && int_data->pos >= offset);
JERRY_ASSERT (offset != 0 && (uint32_t) int_data->pos >= offset);
int_data->pos = (opcode_counter_t) (int_data->pos - offset);
}
else
@@ -112,7 +112,7 @@ opfunc_is_false_jmp_down (opcode_t opdata, /**< operation data */
if (!ecma_is_value_true (to_bool_completion.u.value))
{
JERRY_ASSERT (offset != 0 && (int_data->pos + offset < MAX_OPCODES));
JERRY_ASSERT (offset != 0 && ((uint32_t) int_data->pos + offset < MAX_OPCODES));
int_data->pos = (opcode_counter_t) (int_data->pos + offset);
}
else
@@ -145,7 +145,7 @@ opfunc_is_false_jmp_up (opcode_t opdata, /**< operation data */
if (!ecma_is_value_true (to_bool_completion.u.value))
{
JERRY_ASSERT (offset != 0 && int_data->pos >= offset);
JERRY_ASSERT (offset != 0 && (uint32_t) int_data->pos >= offset);
int_data->pos = (opcode_counter_t) (int_data->pos - offset);
}
else
@@ -173,7 +173,7 @@ opfunc_jmp_down (opcode_t opdata, /**< operation data */
const opcode_counter_t offset = calc_opcode_counter_from_idx_idx (opdata.data.jmp_down.opcode_1,
opdata.data.jmp_down.opcode_2);
JERRY_ASSERT (offset != 0 && (int_data->pos + offset < MAX_OPCODES));
JERRY_ASSERT (offset != 0 && ((uint32_t) int_data->pos + offset < MAX_OPCODES));
int_data->pos = (opcode_counter_t) (int_data->pos + offset);
@@ -192,7 +192,7 @@ opfunc_jmp_up (opcode_t opdata, /**< operation data */
{
const opcode_counter_t offset = calc_opcode_counter_from_idx_idx (opdata.data.jmp_up.opcode_1,
opdata.data.jmp_up.opcode_2);
JERRY_ASSERT (offset != 0 && int_data->pos >= offset);
JERRY_ASSERT (offset != 0 && (uint32_t) int_data->pos >= offset);
int_data->pos = (opcode_counter_t) (int_data->pos - offset);
@@ -87,10 +87,11 @@ opfunc_try (opcode_t opdata, /**< operation data */
int_data->lex_env_p = old_env_p;
ecma_deref_object (catch_env_p);
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && int_data->pos < catch_end_oc)
|| (ecma_is_completion_value_empty (try_completion) && int_data->pos == catch_end_oc));
}
JERRY_ASSERT ((!ecma_is_completion_value_empty (try_completion) && int_data->pos < catch_end_oc)
|| (ecma_is_completion_value_empty (try_completion) && int_data->pos == catch_end_oc));
int_data->pos = catch_end_oc;
}