|
18 | 18 | #include "jerryscript-port.h" |
19 | 19 | #include "jerryscript-port-default.h" |
20 | 20 |
|
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 | | - |
56 | 21 | /** |
57 | 22 | * 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. |
63 | 24 | */ |
64 | 25 | void jerry_port_fatal (jerry_fatal_code_t code) /**< cause of error */ |
65 | 26 | { |
66 | | -#ifndef DISABLE_EXTRA_API |
67 | 27 | if (code != 0 |
68 | | - && code != ERR_OUT_OF_MEMORY |
69 | | - && abort_on_fail) |
| 28 | + && code != ERR_OUT_OF_MEMORY) |
70 | 29 | { |
71 | 30 | abort (); |
72 | 31 | } |
73 | | -#endif /* !DISABLE_EXTRA_API */ |
74 | 32 |
|
75 | 33 | exit ((int) code); |
76 | 34 | } /* jerry_port_fatal */ |
0 commit comments