Introducing ecma_MakeThrowValue constructor for throw completion values.

This commit is contained in:
Ruben Ayrapetyan
2014-07-15 21:27:25 +04:00
parent cdde0900e3
commit 56f731a3f2
2 changed files with 24 additions and 4 deletions
+17
View File
@@ -114,6 +114,23 @@ ecma_MakeCompletionValue(ecma_CompletionType_t type, /**< type */
return (ecma_CompletionValue_t) { .type = type, .value = value, .target = target };
} /* ecma_MakeCompletionValue */
/**
* Throw completion value constructor.
*/
ecma_CompletionValue_t
ecma_MakeThrowValue( ecma_Object_t *exception_p) /**< an object */
{
JERRY_ASSERT( exception_p != NULL && !exception_p->m_IsLexicalEnvironment );
ecma_Value_t exception;
exception.m_ValueType = ECMA_TYPE_OBJECT;
ecma_SetPointer( exception.m_Value, exception_p);
return ecma_MakeCompletionValue(ECMA_COMPLETION_TYPE_THROW,
exception,
ECMA_TARGET_ID_RESERVED);
} /* ecma_MakeThrowValue */
/**
* @}
* @}