Mercurial > code
changeset 564:21fa534ce42f
Js: get rid of dukx_enumerate
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 23 Jun 2016 07:37:02 +0200 |
parents | 668975a91fb2 |
children | a1841ba6eb61 |
files | modules/js/duktape.hpp |
diffstat | 1 files changed, 0 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/modules/js/duktape.hpp Tue Jun 21 15:55:57 2016 +0200 +++ b/modules/js/duktape.hpp Thu Jun 23 07:37:02 2016 +0200 @@ -360,28 +360,6 @@ } /** - * Enumerate an object or an array at the specified index. - * - * \param ctx the context - * \param index the object or array index - * \param flags the optional flags to pass to duk_enum - * \param getvalue set to true if you want to extract the value - * \param func the function to call for each properties - */ -template <typename Func> -void dukx_enumerate(duk_context *ctx, int index, duk_uint_t flags, duk_bool_t getvalue, Func &&func) -{ - duk_enum(ctx, index, flags); - - while (duk_next(ctx, -1, getvalue)) { - func(ctx); - duk_pop_n(ctx, 1 + (getvalue ? 1 : 0)); - } - - duk_pop(ctx); -} - -/** * Throw an ECMAScript exception. * * \param ctx the context