Improve error messages

* Print location on parser errors.
 * Do not print messages on parse error if FEATURE_ERROR_MESSAGES is not set.
 * Minor style fixes

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-09-05 09:39:03 +02:00
parent cf94a25753
commit 5c330d7f8e
6 changed files with 98 additions and 21 deletions
+5 -5
View File
@@ -639,8 +639,9 @@ parser_set_continues_to_current_position (parser_context_t *context_p, /**< cont
}
} /* parser_set_continues_to_current_position */
#if JERRY_ENABLE_ERROR_MESSAGES
/**
* Returns with the striong representation of the error
* Returns with the string representation of the error
*/
const char *
parser_error_to_string (parser_error_t error) /**< error code */
@@ -925,13 +926,12 @@ parser_error_to_string (parser_error_t error) /**< error code */
}
default:
{
break;
JERRY_ASSERT (error == PARSER_ERR_NO_ERROR);
return "No error.";
}
}
JERRY_ASSERT (error == PARSER_ERR_NO_ERROR);
return "No error.";
} /* parser_error_to_string */
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
/**
* @}