diff options
Diffstat (limited to 'javascript/duktape/duktape.h')
-rw-r--r-- | javascript/duktape/duktape.h | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/javascript/duktape/duktape.h b/javascript/duktape/duktape.h index 6fba18d8b..d672edeba 100644 --- a/javascript/duktape/duktape.h +++ b/javascript/duktape/duktape.h @@ -5,8 +5,8 @@ * include guard. Other parts of the header are Duktape * internal and related to platform/compiler/feature detection. * - * Git commit 40453939c5a5aa16898d19bbac4d02f77196cc8b (v1.3.0-138-g4045393). - * Git branch regexp-canonicalize-lookup. + * Git commit b7b1c5fd2d1d4550140d57e05a7b32f540082bfa (v1.3.0-383-gb7b1c5f). + * Git branch duk-config-improvements. * * See Duktape AUTHORS.rst and LICENSE.txt for copyright and * licensing information. @@ -218,9 +218,9 @@ struct duk_number_list_entry { * which Duktape snapshot was used. Not available in the Ecmascript * environment. */ -#define DUK_GIT_COMMIT "40453939c5a5aa16898d19bbac4d02f77196cc8b" -#define DUK_GIT_DESCRIBE "v1.3.0-138-g4045393" -#define DUK_GIT_BRANCH "regexp-canonicalize-lookup" +#define DUK_GIT_COMMIT "b7b1c5fd2d1d4550140d57e05a7b32f540082bfa" +#define DUK_GIT_DESCRIBE "v1.3.0-383-gb7b1c5f" +#define DUK_GIT_BRANCH "duk-config-improvements" /* Duktape debug protocol version used by this build. */ #define DUK_DEBUG_PROTOCOL_VERSION 1 @@ -242,6 +242,7 @@ struct duk_number_list_entry { #define DUK_API_ENTRY_STACK 64 /* Value types, used by e.g. duk_get_type() */ +#define DUK_TYPE_MIN 0 #define DUK_TYPE_NONE 0 /* no value, e.g. invalid index */ #define DUK_TYPE_UNDEFINED 1 /* Ecmascript undefined */ #define DUK_TYPE_NULL 2 /* Ecmascript null */ @@ -252,6 +253,7 @@ struct duk_number_list_entry { #define DUK_TYPE_BUFFER 7 /* fixed or dynamic, garbage collected byte buffer */ #define DUK_TYPE_POINTER 8 /* raw void pointer */ #define DUK_TYPE_LIGHTFUNC 9 /* lightweight function pointer */ +#define DUK_TYPE_MAX 9 /* Value mask types, used by e.g. duk_get_type_mask() */ #define DUK_TYPE_MASK_NONE (1 << DUK_TYPE_NONE) @@ -301,6 +303,12 @@ struct duk_number_list_entry { #define DUK_DEFPROP_HAVE_GETTER (1 << 7) /* set getter (given on value stack) */ #define DUK_DEFPROP_HAVE_SETTER (1 << 8) /* set setter (given on value stack) */ #define DUK_DEFPROP_FORCE (1 << 9) /* force change if possible, may still fail for e.g. virtual properties */ +#define DUK_DEFPROP_SET_WRITABLE (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_WRITABLE) +#define DUK_DEFPROP_CLEAR_WRITABLE DUK_DEFPROP_HAVE_WRITABLE +#define DUK_DEFPROP_SET_ENUMERABLE (DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_ENUMERABLE) +#define DUK_DEFPROP_CLEAR_ENUMERABLE DUK_DEFPROP_HAVE_ENUMERABLE +#define DUK_DEFPROP_SET_CONFIGURABLE (DUK_DEFPROP_HAVE_CONFIGURABLE | DUK_DEFPROP_CONFIGURABLE) +#define DUK_DEFPROP_CLEAR_CONFIGURABLE DUK_DEFPROP_HAVE_CONFIGURABLE /* Flags for duk_push_thread_raw() */ #define DUK_THREAD_NEW_GLOBAL_ENV (1 << 0) /* create a new global environment */ @@ -615,7 +623,8 @@ DUK_EXTERNAL_DECL duk_bool_t duk_is_ecmascript_function(duk_context *ctx, duk_id DUK_EXTERNAL_DECL duk_bool_t duk_is_bound_function(duk_context *ctx, duk_idx_t index); DUK_EXTERNAL_DECL duk_bool_t duk_is_thread(duk_context *ctx, duk_idx_t index); -DUK_EXTERNAL_DECL duk_bool_t duk_is_callable(duk_context *ctx, duk_idx_t index); +#define duk_is_callable(ctx,index) \ + duk_is_function((ctx), (index)) DUK_EXTERNAL_DECL duk_bool_t duk_is_dynamic_buffer(duk_context *ctx, duk_idx_t index); DUK_EXTERNAL_DECL duk_bool_t duk_is_fixed_buffer(duk_context *ctx, duk_idx_t index); DUK_EXTERNAL_DECL duk_bool_t duk_is_external_buffer(duk_context *ctx, duk_idx_t index); @@ -642,6 +651,18 @@ DUK_EXTERNAL_DECL duk_bool_t duk_is_external_buffer(duk_context *ctx, duk_idx_t DUK_EXTERNAL_DECL duk_errcode_t duk_get_error_code(duk_context *ctx, duk_idx_t index); #define duk_is_error(ctx,index) \ (duk_get_error_code((ctx), (index)) != 0) +#define duk_is_eval_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_EVAL_ERROR) +#define duk_is_range_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_RANGE_ERROR) +#define duk_is_reference_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_REFERENCE_ERROR) +#define duk_is_syntax_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_SYNTAX_ERROR) +#define duk_is_type_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_TYPE_ERROR) +#define duk_is_uri_error(ctx,index) \ + (duk_get_error_code((ctx), (index)) == DUK_ERR_URI_ERROR) /* * Get operations: no coercion, returns default value for invalid @@ -686,6 +707,9 @@ DUK_EXTERNAL_DECL void *duk_require_buffer_data(duk_context *ctx, duk_idx_t inde DUK_EXTERNAL_DECL void *duk_require_pointer(duk_context *ctx, duk_idx_t index); DUK_EXTERNAL_DECL duk_c_function duk_require_c_function(duk_context *ctx, duk_idx_t index); DUK_EXTERNAL_DECL duk_context *duk_require_context(duk_context *ctx, duk_idx_t index); +DUK_EXTERNAL_DECL void duk_require_function(duk_context *ctx, duk_idx_t index); +#define duk_require_callable(ctx,index) \ + duk_require_function((ctx), (index)) DUK_EXTERNAL_DECL void *duk_require_heapptr(duk_context *ctx, duk_idx_t index); #define duk_require_object_coercible(ctx,index) \ @@ -1207,13 +1231,13 @@ DUK_EXTERNAL_DECL void duk_debugger_cooperate(duk_context *ctx); union duk_double_union { double d; float f[2]; -#ifdef DUK_USE_64BIT_OPS +#if defined(DUK_USE_64BIT_OPS) duk_uint64_t ull[1]; #endif duk_uint32_t ui[2]; duk_uint16_t us[4]; duk_uint8_t uc[8]; -#ifdef DUK_USE_PACKED_TVAL_POSSIBLE +#if defined(DUK_USE_PACKED_TVAL) void *vp[2]; /* used by packed duk_tval, assumes sizeof(void *) == 4 */ #endif }; |