mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-06 02:23:59 +00:00
1. Updated to duktape 2.6.0
2. Added support for execution timeout
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Duktape public API for Duktape 2.3.0.
|
||||
* Duktape public API for Duktape 2.6.0.
|
||||
*
|
||||
* See the API reference for documentation on call semantics. The exposed,
|
||||
* supported API is between the "BEGIN PUBLIC API" and "END PUBLIC API"
|
||||
* comments. Other parts of the header are Duktape internal and related to
|
||||
* e.g. platform/compiler/feature detection.
|
||||
*
|
||||
* Git commit d7fdb67f18561a50e06bafd196c6b423af9ad6fe (v2.3.0).
|
||||
* Git branch master.
|
||||
* Git commit fffa346eff06a8764b02c31d4336f63a773a95c3 (v2.6.0).
|
||||
* Git branch v2-maintenance.
|
||||
*
|
||||
* See Duktape AUTHORS.rst and LICENSE.txt for copyright and
|
||||
* licensing information.
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* (http://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Copyright (c) 2013-2018 by Duktape authors (see AUTHORS.rst)
|
||||
* Copyright (c) 2013-2019 by Duktape authors (see AUTHORS.rst)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -100,6 +100,16 @@
|
||||
* * Michal Kasperek (https://github.com/michalkas)
|
||||
* * Andrew Janke (https://github.com/apjanke)
|
||||
* * Steve Fan (https://github.com/stevefan1999)
|
||||
* * Edward Betts (https://github.com/edwardbetts)
|
||||
* * Ozhan Duz (https://github.com/webfolderio)
|
||||
* * Akos Kiss (https://github.com/akosthekiss)
|
||||
* * TheBrokenRail (https://github.com/TheBrokenRail)
|
||||
* * Jesse Doyle (https://github.com/jessedoyle)
|
||||
* * Gero Kuehn (https://github.com/dc6jgk)
|
||||
* * James Swift (https://github.com/phraemer)
|
||||
* * Luis de Bethencourt (https://github.com/luisbg)
|
||||
* * Ian Whyman (https://github.com/v00d00)
|
||||
* * Rick Sayre (https://github.com/whorfin)
|
||||
*
|
||||
* Other contributions
|
||||
* ===================
|
||||
@@ -140,6 +150,8 @@
|
||||
* * Neil Kolban (https://github.com/nkolban)
|
||||
* * Wilhelm Wanecek (https://github.com/wanecek)
|
||||
* * Andrew Janke (https://github.com/apjanke)
|
||||
* * Unamer (https://github.com/unamer)
|
||||
* * Karl Dahlke (eklhad@gmail.com)
|
||||
*
|
||||
* If you are accidentally missing from this list, send me an e-mail
|
||||
* (``sami.vaarala@iki.fi``) and I'll fix the omission.
|
||||
@@ -164,16 +176,16 @@
|
||||
* development snapshots have 99 for patch level (e.g. 0.10.99 would be a
|
||||
* development version after 0.10.0 but before the next official release).
|
||||
*/
|
||||
#define DUK_VERSION 20300L
|
||||
#define DUK_VERSION 20600L
|
||||
|
||||
/* Git commit, describe, and branch for Duktape build. Useful for
|
||||
* non-official snapshot builds so that application code can easily log
|
||||
* which Duktape snapshot was used. Not available in the ECMAScript
|
||||
* environment.
|
||||
*/
|
||||
#define DUK_GIT_COMMIT "d7fdb67f18561a50e06bafd196c6b423af9ad6fe"
|
||||
#define DUK_GIT_DESCRIBE "v2.3.0"
|
||||
#define DUK_GIT_BRANCH "master"
|
||||
#define DUK_GIT_COMMIT "fffa346eff06a8764b02c31d4336f63a773a95c3"
|
||||
#define DUK_GIT_DESCRIBE "v2.6.0"
|
||||
#define DUK_GIT_BRANCH "v2-maintenance"
|
||||
|
||||
/* External duk_config.h provides platform/compiler/OS dependent
|
||||
* typedefs and macros, and DUK_USE_xxx config options so that
|
||||
@@ -210,6 +222,9 @@ extern "C" {
|
||||
* in Duktape web documentation.
|
||||
*/
|
||||
|
||||
#define DUK_USE_EXEC_TIMEOUT_CHECK ILibDuktape_EXEC_TIMEOUT_CHECK
|
||||
duk_bool_t ILibDuktape_EXEC_TIMEOUT_CHECK(void *udata);
|
||||
|
||||
struct duk_thread_state;
|
||||
struct duk_memory_functions;
|
||||
struct duk_function_list_entry;
|
||||
@@ -383,30 +398,35 @@ struct duk_time_components {
|
||||
#define DUK_DEFPROP_C DUK_DEFPROP_CONFIGURABLE
|
||||
#define DUK_DEFPROP_WE (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE)
|
||||
#define DUK_DEFPROP_WC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_EC (DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_WEC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_HAVE_W DUK_DEFPROP_HAVE_WRITABLE
|
||||
#define DUK_DEFPROP_HAVE_E DUK_DEFPROP_HAVE_ENUMERABLE
|
||||
#define DUK_DEFPROP_HAVE_C DUK_DEFPROP_HAVE_CONFIGURABLE
|
||||
#define DUK_DEFPROP_HAVE_WE (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE)
|
||||
#define DUK_DEFPROP_HAVE_WC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_HAVE_EC (DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_HAVE_WEC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_SET_W DUK_DEFPROP_SET_WRITABLE
|
||||
#define DUK_DEFPROP_SET_E DUK_DEFPROP_SET_ENUMERABLE
|
||||
#define DUK_DEFPROP_SET_C DUK_DEFPROP_SET_CONFIGURABLE
|
||||
#define DUK_DEFPROP_SET_WE (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE)
|
||||
#define DUK_DEFPROP_SET_WC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_SET_EC (DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_SET_WEC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_CLEAR_W DUK_DEFPROP_CLEAR_WRITABLE
|
||||
#define DUK_DEFPROP_CLEAR_E DUK_DEFPROP_CLEAR_ENUMERABLE
|
||||
#define DUK_DEFPROP_CLEAR_C DUK_DEFPROP_CLEAR_CONFIGURABLE
|
||||
#define DUK_DEFPROP_CLEAR_WE (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE)
|
||||
#define DUK_DEFPROP_CLEAR_WC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_CLEAR_EC (DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_CLEAR_WEC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
|
||||
#define DUK_DEFPROP_ATTR_W (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_W)
|
||||
#define DUK_DEFPROP_ATTR_E (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_E)
|
||||
#define DUK_DEFPROP_ATTR_C (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_C)
|
||||
#define DUK_DEFPROP_ATTR_WE (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WE)
|
||||
#define DUK_DEFPROP_ATTR_WC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WC)
|
||||
#define DUK_DEFPROP_ATTR_EC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_EC)
|
||||
#define DUK_DEFPROP_ATTR_WEC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WEC)
|
||||
|
||||
/* Flags for duk_push_thread_raw() */
|
||||
@@ -447,18 +467,24 @@ struct duk_time_components {
|
||||
* Macros to create Symbols as C statically constructed strings.
|
||||
*
|
||||
* Call e.g. as DUK_HIDDEN_SYMBOL("myProperty") <=> ("\xFF" "myProperty").
|
||||
*
|
||||
* Local symbols have a unique suffix, caller should take care to avoid
|
||||
* conflicting with the Duktape internal representation by e.g. prepending
|
||||
* a '!' character: DUK_LOCAL_SYMBOL("myLocal", "!123").
|
||||
*
|
||||
* Note that these can only be used for string constants, not dynamically
|
||||
* created strings.
|
||||
*
|
||||
* You shouldn't normally use DUK_INTERNAL_SYMBOL() at all. It is reserved
|
||||
* for Duktape internal symbols only. There are no versioning guarantees
|
||||
* for internal symbols.
|
||||
*/
|
||||
|
||||
#define DUK_HIDDEN_SYMBOL(x) ("\xFF" x)
|
||||
#define DUK_GLOBAL_SYMBOL(x) ("\x80" x)
|
||||
#define DUK_LOCAL_SYMBOL(x,uniq) ("\x81" x "\xff" uniq)
|
||||
#define DUK_WELLKNOWN_SYMBOL(x) ("\x81" x "\xff")
|
||||
#define DUK_INTERNAL_SYMBOL(x) ("\x82" x)
|
||||
|
||||
/*
|
||||
* If no variadic macros, __FILE__ and __LINE__ are passed through globals
|
||||
@@ -644,6 +670,7 @@ DUK_EXTERNAL_DECL void duk_swap_top(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL void duk_dup(duk_context *ctx, duk_idx_t from_idx);
|
||||
DUK_EXTERNAL_DECL void duk_dup_top(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL void duk_insert(duk_context *ctx, duk_idx_t to_idx);
|
||||
DUK_EXTERNAL_DECL void duk_pull(duk_context *ctx, duk_idx_t from_idx);
|
||||
DUK_EXTERNAL_DECL void duk_replace(duk_context *ctx, duk_idx_t to_idx);
|
||||
DUK_EXTERNAL_DECL void duk_copy(duk_context *ctx, duk_idx_t from_idx, duk_idx_t to_idx);
|
||||
DUK_EXTERNAL_DECL void duk_remove(duk_context *ctx, duk_idx_t idx);
|
||||
@@ -703,6 +730,7 @@ DUK_EXTERNAL_DECL void duk_push_thread_stash(duk_context *ctx, duk_context *targ
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_object(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_bare_object(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_array(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_bare_array(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_c_function(duk_context *ctx, duk_c_function func, duk_idx_t nargs);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_c_lightfunc(duk_context *ctx, duk_c_function func, duk_idx_t nargs, duk_idx_t length, duk_int_t magic);
|
||||
DUK_EXTERNAL_DECL duk_idx_t duk_push_thread_raw(duk_context *ctx, duk_uint_t flags);
|
||||
@@ -937,6 +965,8 @@ DUK_EXTERNAL_DECL duk_context *duk_require_context(duk_context *ctx, duk_idx_t i
|
||||
DUK_EXTERNAL_DECL void duk_require_function(duk_context *ctx, duk_idx_t idx);
|
||||
#define duk_require_callable(ctx,idx) \
|
||||
duk_require_function((ctx), (idx))
|
||||
DUK_EXTERNAL_DECL void duk_require_constructor_call(duk_context *ctx);
|
||||
DUK_EXTERNAL_DECL void duk_require_constructable(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL void *duk_require_heapptr(duk_context *ctx, duk_idx_t idx);
|
||||
|
||||
/* Symbols are object coercible and covered by DUK_TYPE_MASK_STRING. */
|
||||
@@ -986,6 +1016,8 @@ DUK_EXTERNAL_DECL void duk_to_primitive(duk_context *ctx, duk_idx_t idx, duk_int
|
||||
|
||||
/* safe variants of a few coercion operations */
|
||||
DUK_EXTERNAL_DECL const char *duk_safe_to_lstring(duk_context *ctx, duk_idx_t idx, duk_size_t *out_len);
|
||||
DUK_EXTERNAL_DECL const char *duk_to_stacktrace(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL const char *duk_safe_to_stacktrace(duk_context *ctx, duk_idx_t idx);
|
||||
#define duk_safe_to_string(ctx,idx) \
|
||||
duk_safe_to_lstring((ctx), (idx), NULL)
|
||||
|
||||
@@ -1010,6 +1042,8 @@ DUK_EXTERNAL_DECL const char *duk_hex_encode(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL void duk_hex_decode(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL const char *duk_json_encode(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL void duk_json_decode(duk_context *ctx, duk_idx_t idx);
|
||||
DUK_EXTERNAL_DECL void duk_cbor_encode(duk_context *ctx, duk_idx_t idx, duk_uint_t encode_flags);
|
||||
DUK_EXTERNAL_DECL void duk_cbor_decode(duk_context *ctx, duk_idx_t idx, duk_uint_t decode_flags);
|
||||
|
||||
DUK_EXTERNAL_DECL const char *duk_buffer_to_string(duk_context *ctx, duk_idx_t idx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user