Rework jerry_parse function. (#2282)

Remove jerry_parse_named_resource, merge its arguments to jerry_parse
and change is_strict argument to an option list for possible future extensions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-04-17 09:51:52 +02:00
committed by GitHub
parent 3f3d4a64f1
commit 96b528a486
19 changed files with 146 additions and 146 deletions
+8 -13
View File
@@ -69,14 +69,9 @@ The debugger can be enabled by calling the `jerry_debugger_init (uint16_t port)`
function after the `jerry_init ()` function. It initializes the debugger
and blocks until a client connects.
When the debugger is enabled it is recommended to use
`jerry_parse_named_resource ()` instead of `jerry_parse ()` because
the resource name (usually a file name) is also passed to this
function. This resource name is used by the client to identify
the corresponding resource. In general it is always recommended to
use `jerry_parse_named_resource ()` when the resource name is
available because it silently ignores the resource name if the
debugger is disabled.
The resource name provided to `jerry_parse ()` is used by the client
to identify the resource name of the source code. This resource name
is usually a file name.
## JerryScript debugger C-API interface
@@ -304,11 +299,11 @@ wait_for_source_callback (const jerry_char_t *resource_name_p, /**< resource nam
size_t source_size, /**< source code size */
void *user_p __attribute__((unused))) /**< user pointer */
{
jerry_value_t ret_val = jerry_parse_named_resource (resource_name_p,
resource_name_size,
source_p,
source_size,
false);
jerry_value_t ret_val = jerry_parse (resource_name_p,
resource_name_size,
source_p,
source_size,
JERRY_PARSE_NO_OPTS);
if (!jerry_value_has_error_flag (ret_val))
{