Add support of ReferenceError early error to parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
committed by
Evgeny Gavrin
parent
06d0c1806d
commit
44b7b95781
@@ -72,7 +72,7 @@ main (int __attr_unused___ argc,
|
||||
TEST_INIT ();
|
||||
|
||||
const opcode_t *opcodes_p;
|
||||
bool is_syntax_correct;
|
||||
jsp_status_t parse_status;
|
||||
|
||||
mem_init ();
|
||||
|
||||
@@ -81,9 +81,9 @@ main (int __attr_unused___ argc,
|
||||
|
||||
serializer_init ();
|
||||
parser_set_show_opcodes (true);
|
||||
is_syntax_correct = parser_parse_script ((jerry_api_char_t *) program1, strlen (program1), &opcodes_p);
|
||||
parse_status = parser_parse_script ((jerry_api_char_t *) program1, strlen (program1), &opcodes_p);
|
||||
|
||||
JERRY_ASSERT (is_syntax_correct && opcodes_p != NULL);
|
||||
JERRY_ASSERT (parse_status == JSP_STATUS_OK && opcodes_p != NULL);
|
||||
|
||||
opcode_t opcodes[] =
|
||||
{
|
||||
@@ -107,9 +107,9 @@ main (int __attr_unused___ argc,
|
||||
|
||||
serializer_init ();
|
||||
parser_set_show_opcodes (true);
|
||||
is_syntax_correct = parser_parse_script ((jerry_api_char_t *) program2, strlen (program2), &opcodes_p);
|
||||
parse_status = parser_parse_script ((jerry_api_char_t *) program2, strlen (program2), &opcodes_p);
|
||||
|
||||
JERRY_ASSERT (!is_syntax_correct && opcodes_p == NULL);
|
||||
JERRY_ASSERT (parse_status == JSP_STATUS_SYNTAX_ERROR && opcodes_p == NULL);
|
||||
|
||||
serializer_free ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user