Browse Source

API documentation fixes for error code removal

pull/827/head
Sami Vaarala 9 years ago
parent
commit
a6a07c1889
  1. 17
      website/api/defines.html
  2. 7
      website/api/duk_get_error_code.yaml

17
website/api/defines.html

@ -87,17 +87,7 @@ typedef struct duk_number_list_entry duk_number_list_entry;
<h2>Error codes</h2>
<pre class="c-code">
/* Internal error codes */
#define DUK_ERR_NONE 0 /* no error (e.g. from duk_get_error_code()) */
#define DUK_ERR_UNIMPLEMENTED_ERROR 50 /* UnimplementedError */
#define DUK_ERR_UNSUPPORTED_ERROR 51 /* UnsupportedError */
#define DUK_ERR_INTERNAL_ERROR 52 /* InternalError */
#define DUK_ERR_ALLOC_ERROR 53 /* AllocError */
#define DUK_ERR_ASSERTION_ERROR 54 /* AssertionError */
#define DUK_ERR_API_ERROR 55 /* APIError */
#define DUK_ERR_UNCAUGHT_ERROR 56 /* UncaughtError */
/* Ecmascript E5 specification error codes */
#define DUK_ERR_ERROR 100 /* Error */
#define DUK_ERR_EVAL_ERROR 101 /* EvalError */
#define DUK_ERR_RANGE_ERROR 102 /* RangeError */
@ -110,13 +100,6 @@ typedef struct duk_number_list_entry duk_number_list_entry;
<h2>Return codes from Duktape/C functions</h2>
<pre class="c-code">
/* Return codes for C functions */
#define DUK_RET_UNIMPLEMENTED_ERROR (-DUK_ERR_UNIMPLEMENTED_ERROR)
#define DUK_RET_UNSUPPORTED_ERROR (-DUK_ERR_UNSUPPORTED_ERROR)
#define DUK_RET_INTERNAL_ERROR (-DUK_ERR_INTERNAL_ERROR)
#define DUK_RET_ALLOC_ERROR (-DUK_ERR_ALLOC_ERROR)
#define DUK_RET_ASSERTION_ERROR (-DUK_ERR_ASSERTION_ERROR)
#define DUK_RET_API_ERROR (-DUK_ERR_API_ERROR)
#define DUK_RET_UNCAUGHT_ERROR (-DUK_ERR_UNCAUGHT_ERROR)
#define DUK_RET_ERROR (-DUK_ERR_ERROR)
#define DUK_RET_EVAL_ERROR (-DUK_ERR_EVAL_ERROR)
#define DUK_RET_RANGE_ERROR (-DUK_ERR_RANGE_ERROR)

7
website/api/duk_get_error_code.yaml

@ -11,8 +11,11 @@ summary: |
based on which <code>Error</code> subclass the value inherits from. For example,
if the value at the stack top is an user-defined error which inherits from
<code>ReferenceError</code>, the return value will be <code>DUK_ERR_REFERENCE_ERROR</code>.
If the value is not an object, does not inherit from <code>Error</code>, or <code>idx</code>
is invalid, returns 0 (= <code>DUK_ERR_NONE</code>).</p>
If the value inherits from <code>Error</code> but doesn't inherit from any of
the standard subclasses (EvalError, RangeError, ReferenceError, SyntaxError,
TypeError, URIError) <code>DUK_ERR_ERROR</code> is returned.
If the value is not an object, does not inherit from <code>Error</code>, or
<code>idx</code> is invalid, returns 0 (= <code>DUK_ERR_NONE</code>).</p>
example: |
if (duk_get_error_code(ctx, -3) == DUK_ERR_URI_ERROR) {

Loading…
Cancel
Save