|
|
@ -35,72 +35,74 @@ struct duk_memory_functions { |
|
|
|
<h2>Error codes</h2> |
|
|
|
<pre class="c-code"> |
|
|
|
/* Internal error codes */ |
|
|
|
#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 */ |
|
|
|
#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 */ |
|
|
|
#define DUK_ERR_REFERENCE_ERROR 103 /* ReferenceError */ |
|
|
|
#define DUK_ERR_SYNTAX_ERROR 104 /* SyntaxError */ |
|
|
|
#define DUK_ERR_TYPE_ERROR 105 /* TypeError */ |
|
|
|
#define DUK_ERR_URI_ERROR 106 /* URIError */ |
|
|
|
#define DUK_ERR_ERROR 100 /* Error */ |
|
|
|
#define DUK_ERR_EVAL_ERROR 101 /* EvalError */ |
|
|
|
#define DUK_ERR_RANGE_ERROR 102 /* RangeError */ |
|
|
|
#define DUK_ERR_REFERENCE_ERROR 103 /* ReferenceError */ |
|
|
|
#define DUK_ERR_SYNTAX_ERROR 104 /* SyntaxError */ |
|
|
|
#define DUK_ERR_TYPE_ERROR 105 /* TypeError */ |
|
|
|
#define DUK_ERR_URI_ERROR 106 /* URIError */ |
|
|
|
</pre> |
|
|
|
|
|
|
|
<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) |
|
|
|
#define DUK_RET_REFERENCE_ERROR (-DUK_ERR_REFERENCE_ERROR) |
|
|
|
#define DUK_RET_SYNTAX_ERROR (-DUK_ERR_SYNTAX_ERROR) |
|
|
|
#define DUK_RET_TYPE_ERROR (-DUK_ERR_TYPE_ERROR) |
|
|
|
#define DUK_RET_URI_ERROR (-DUK_ERR_URI_ERROR) |
|
|
|
#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) |
|
|
|
#define DUK_RET_REFERENCE_ERROR (-DUK_ERR_REFERENCE_ERROR) |
|
|
|
#define DUK_RET_SYNTAX_ERROR (-DUK_ERR_SYNTAX_ERROR) |
|
|
|
#define DUK_RET_TYPE_ERROR (-DUK_ERR_TYPE_ERROR) |
|
|
|
#define DUK_RET_URI_ERROR (-DUK_ERR_URI_ERROR) |
|
|
|
</pre> |
|
|
|
|
|
|
|
<h2>Compilation flags for duk_compile()</h2> |
|
|
|
<pre class="c-code"> |
|
|
|
#define DUK_COMPILE_EVAL (1 << 0) /* compile eval code (instead of program) */ |
|
|
|
#define DUK_COMPILE_FUNCTION (1 << 1) /* compile function code (instead of program) */ |
|
|
|
#define DUK_COMPILE_STRICT (1 << 2) /* use strict (outer) context for program, eval, or function */ |
|
|
|
#define DUK_COMPILE_EVAL (1 << 0) /* compile eval code (instead of program) */ |
|
|
|
#define DUK_COMPILE_FUNCTION (1 << 1) /* compile function code (instead of program) */ |
|
|
|
#define DUK_COMPILE_STRICT (1 << 2) /* use strict (outer) context for program, eval, or function */ |
|
|
|
</pre> |
|
|
|
|
|
|
|
<h2>Enumeration flags for duk_enum()</h2> |
|
|
|
<pre class="c-code"> |
|
|
|
/* Enumeration flags for duk_enum() */ |
|
|
|
#define DUK_ENUM_INCLUDE_NONENUMERABLE (1 << 0) /* enumerate non-numerable properties in addition to enumerable */ |
|
|
|
#define DUK_ENUM_INCLUDE_INTERNAL (1 << 1) /* enumerate internal properties (regardless of enumerability) */ |
|
|
|
#define DUK_ENUM_OWN_PROPERTIES_ONLY (1 << 2) /* don't walk prototype chain, only check own properties */ |
|
|
|
#define DUK_ENUM_ARRAY_INDICES_ONLY (1 << 3) /* only enumerate array indices */ |
|
|
|
#define DUK_ENUM_SORT_ARRAY_INDICES (1 << 4) /* sort array indices, use with DUK_ENUM_ARRAY_INDICES_ONLY */ |
|
|
|
#define DUK_ENUM_INCLUDE_NONENUMERABLE (1 << 0) /* enumerate non-numerable properties in addition to enumerable */ |
|
|
|
#define DUK_ENUM_INCLUDE_INTERNAL (1 << 1) /* enumerate internal properties (regardless of enumerability) */ |
|
|
|
#define DUK_ENUM_OWN_PROPERTIES_ONLY (1 << 2) /* don't walk prototype chain, only check own properties */ |
|
|
|
#define DUK_ENUM_ARRAY_INDICES_ONLY (1 << 3) /* only enumerate array indices */ |
|
|
|
#define DUK_ENUM_SORT_ARRAY_INDICES (1 << 4) /* sort array indices, use with DUK_ENUM_ARRAY_INDICES_ONLY */ |
|
|
|
</pre> |
|
|
|
|
|
|
|
<h2>Coercion hints</h2> |
|
|
|
<pre class="c-code"> |
|
|
|
/* Coercion hints */ |
|
|
|
#define DUK_HINT_NONE 0 /* prefer number, unless coercion input is a Date, in which case prefer string (E5 Section 8.12.8) */ |
|
|
|
#define DUK_HINT_STRING 1 /* prefer string */ |
|
|
|
#define DUK_HINT_NUMBER 2 /* prefer number */ |
|
|
|
#define DUK_HINT_NONE 0 /* prefer number, unless coercion input is a Date, in which case prefer string (E5 Section 8.12.8) */ |
|
|
|
#define DUK_HINT_STRING 1 /* prefer string */ |
|
|
|
#define DUK_HINT_NUMBER 2 /* prefer number */ |
|
|
|
</pre> |
|
|
|
|
|
|
|
<h2>Misc defines</h2> |
|
|
|
<pre class="c-code"> |
|
|
|
#define DUK_INVALID_INDEX INT_MIN |
|
|
|
#define DUK_INVALID_INDEX INT_MIN |
|
|
|
|
|
|
|
#define DUK_VARARGS (-1) |
|
|
|
#define DUK_VARARGS (-1) |
|
|
|
|
|
|
|
#define DUK_API_ENTRY_STACK 64 |
|
|
|
</pre> |
|
|
|
|
|
|
|