Add custom configuration to jerry_parse and its variants (#4620)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -136,11 +136,14 @@ static jerry_value_t
|
||||
run (const char *resource_name_p, /**< resource name */
|
||||
const char *source_p) /**< source code */
|
||||
{
|
||||
jerry_value_t code = jerry_parse ((const jerry_char_t *) resource_name_p,
|
||||
strlen (resource_name_p),
|
||||
(const jerry_char_t *) source_p,
|
||||
jerry_parse_options_t parse_options;
|
||||
parse_options.options = JERRY_PARSE_HAS_RESOURCE;
|
||||
parse_options.resource_name_p = (const jerry_char_t *) resource_name_p;
|
||||
parse_options.resource_name_length = strlen (resource_name_p);
|
||||
|
||||
jerry_value_t code = jerry_parse ((const jerry_char_t *) source_p,
|
||||
strlen (source_p),
|
||||
JERRY_PARSE_NO_OPTS);
|
||||
&parse_options);
|
||||
TEST_ASSERT (!jerry_value_is_error (code));
|
||||
|
||||
jerry_value_t result = jerry_run (code);
|
||||
|
||||
Reference in New Issue
Block a user