diff --git a/website/api/defines.html b/website/api/defines.html
index f3d33214..8389d159 100644
--- a/website/api/defines.html
+++ b/website/api/defines.html
@@ -52,7 +52,7 @@ typedef duk_ret_t (*duk_c_function)(duk_context *ctx);
typedef void *(*duk_alloc_function) (void *udata, duk_size_t size);
typedef void *(*duk_realloc_function) (void *udata, void *ptr, duk_size_t size);
typedef void (*duk_free_function) (void *udata, void *ptr);
-typedef void (*duk_fatal_function) (duk_context *ctx, duk_errcode_t code, const char *msg);
+typedef void (*duk_fatal_function) (void *udata, const char *msg);
typedef void (*duk_decode_char_function) (void *udata, duk_codepoint_t codepoint);
typedef duk_codepoint_t (*duk_map_char_function) (void *udata, duk_codepoint_t codepoint);
typedef duk_ret_t (*duk_safe_call_function) (duk_context *ctx, void *udata);
diff --git a/website/api/duk_create_heap.yaml b/website/api/duk_create_heap.yaml
index 0a1bbc65..c427559c 100644
--- a/website/api/duk_create_heap.yaml
+++ b/website/api/duk_create_heap.yaml
@@ -19,16 +19,19 @@ summary: |
memory management functions (ANSI C malloc()
, realloc()
, and free()
) are used. The memory management functions
share the same opaque userdata pointer, heap_udata
. This
- userdata pointer is also used for other Duktape features (like low memory
- pointer compression macros).
A fatal error handler is provided in fatal_handler
. This
handler is called in unrecoverable error situations such as uncaught
- errors, out-of-memory errors not resolved by garbage collection, etc.
- A caller SHOULD implement a fatal error handler in most applications.
- If not given, a default fatal error handler is used. The default
- handler ultimately calls ANSI C abort()
, which may not always
- be the preferred action.
duk_config.h
) causes an intentional segfault to
+ exit a process to avoid relying on platform API calls like abort(). See
+ How to handle fatal errors
+ for more detail and examples.
To create a Duktape heap with default settings, use
duk_create_heap_default()
.
Call fatal error handler with a specified error code and an optional
- message (err_msg
may be NULL
). The valid range
- for user error codes is [1,16777215].
Call fatal error handler with an optional message (err_msg
+ may be NULL
). Like all strings in Duktape, the error message
+ should be an UTF-8 string, although pure ASCII is strongly recommended.
A fatal error handler never returns and may e.g. exit the current
process. Error catching points (like try-catch
statements
@@ -15,7 +15,7 @@ summary: |
has occurred.