Skip to content

Commit 2180d97

Browse files
dbatyairerobika
authored andcommitted
Remove abort-on-fail from the default port (#3182)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
1 parent 6a848a3 commit 2180d97

File tree

3 files changed

+2
-55
lines changed

3 files changed

+2
-55
lines changed

jerry-main/main-unix.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ typedef enum
325325
OPT_EXEC_SNAP,
326326
OPT_EXEC_SNAP_FUNC,
327327
OPT_LOG_LEVEL,
328-
OPT_ABORT_ON_FAIL,
329328
OPT_NO_PROMPT
330329
} main_opt_id_t;
331330

@@ -364,8 +363,6 @@ static const cli_opt_t main_opts[] =
364363
.help = "execute specific function from input snapshot file(s)"),
365364
CLI_OPT_DEF (.id = OPT_LOG_LEVEL, .longopt = "log-level", .meta = "NUM",
366365
.help = "set log level (0-3)"),
367-
CLI_OPT_DEF (.id = OPT_ABORT_ON_FAIL, .longopt = "abort-on-fail",
368-
.help = "segfault on internal failure (instead of non-zero exit code)"),
369366
CLI_OPT_DEF (.id = OPT_NO_PROMPT, .longopt = "no-prompt",
370367
.help = "don't print prompt in REPL mode"),
371368
CLI_OPT_DEF (.id = CLI_OPT_DEFAULT, .meta = "FILE",
@@ -624,11 +621,6 @@ main (int argc,
624621
jerry_port_default_set_log_level ((jerry_log_level_t) log_level);
625622
break;
626623
}
627-
case OPT_ABORT_ON_FAIL:
628-
{
629-
jerry_port_default_set_abort_on_fail (true);
630-
break;
631-
}
632624
case OPT_NO_PROMPT:
633625
{
634626
no_prompt = true;

jerry-port/default/default-fatal.c

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,17 @@
1818
#include "jerryscript-port.h"
1919
#include "jerryscript-port-default.h"
2020

21-
#ifndef DISABLE_EXTRA_API
22-
23-
static bool abort_on_fail = false;
24-
25-
/**
26-
* Sets whether 'abort' should be called instead of 'exit' upon exiting with
27-
* non-zero exit code in the default implementation of jerry_port_fatal.
28-
*
29-
* Note:
30-
* This function is only available if the port implementation library is
31-
* compiled without the DISABLE_EXTRA_API macro.
32-
*/
33-
void jerry_port_default_set_abort_on_fail (bool flag) /**< new value of 'abort on fail' flag */
34-
{
35-
abort_on_fail = flag;
36-
} /* jerry_port_default_set_abort_on_fail */
37-
38-
/**
39-
* Check whether 'abort' should be called instead of 'exit' upon exiting with
40-
* non-zero exit code in the default implementation of jerry_port_fatal.
41-
*
42-
* @return true - if 'abort on fail' flag is set,
43-
* false - otherwise
44-
*
45-
* Note:
46-
* This function is only available if the port implementation library is
47-
* compiled without the DISABLE_EXTRA_API macro.
48-
*/
49-
bool jerry_port_default_is_abort_on_fail (void)
50-
{
51-
return abort_on_fail;
52-
} /* jerry_port_default_is_abort_on_fail */
53-
54-
#endif /* !DISABLE_EXTRA_API */
55-
5621
/**
5722
* Default implementation of jerry_port_fatal. Calls 'abort' if exit code is
58-
* non-zero and "abort-on-fail" behaviour is enabled, 'exit' otherwise.
59-
*
60-
* Note:
61-
* The "abort-on-fail" behaviour is only available if the port
62-
* implementation library is compiled without the DISABLE_EXTRA_API macro.
23+
* non-zero, 'exit' otherwise.
6324
*/
6425
void jerry_port_fatal (jerry_fatal_code_t code) /**< cause of error */
6526
{
66-
#ifndef DISABLE_EXTRA_API
6727
if (code != 0
68-
&& code != ERR_OUT_OF_MEMORY
69-
&& abort_on_fail)
28+
&& code != ERR_OUT_OF_MEMORY)
7029
{
7130
abort ();
7231
}
73-
#endif /* !DISABLE_EXTRA_API */
7432

7533
exit ((int) code);
7634
} /* jerry_port_fatal */

jerry-port/default/include/jerryscript-port-default.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ extern "C"
3131
* @{
3232
*/
3333

34-
void jerry_port_default_set_abort_on_fail (bool flag);
35-
bool jerry_port_default_is_abort_on_fail (void);
36-
3734
jerry_log_level_t jerry_port_default_get_log_level (void);
3835
void jerry_port_default_set_log_level (jerry_log_level_t level);
3936

0 commit comments

Comments
 (0)