Skip to content

parser with unmatched brace doesn't return #183

Closed
@seanshpark

Description

@seanshpark

while testing eval() with throw try-catch (#182) jerry_api_eval() doesn't return with unmatched brace. not sure this is spec or problem. test code:

diff --git a/tests/unit/test-api.cpp b/tests/unit/test-api.cpp
index 9636fd0..7c86780 100644
--- a/tests/unit/test-api.cpp
+++ b/tests/unit/test-api.cpp
@@ -456,6 +456,17 @@ main (void)

   jerry_api_release_value (&val_t);

+  // eval throw
+  const char *eval_code_err_p = "}";
+  status = jerry_api_eval (eval_code_err_p,
+                           strlen (eval_code_err_p),
+                           false,
+                           true,
+                           &val_t);
+  JERRY_ASSERT (status == JERRY_COMPLETION_CODE_OK);
+
+  jerry_api_release_value (&val_t);
+
   // cleanup.
   jerry_api_release_object (global_obj_p);

same with const char *eval_code_err_p = "{";

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourcriticalRaises security concernsnormalparserRelated to the JavaScript parser

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions