mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
10 years ago
7 changed files with 96 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||
=proto |
|||
void duk_error_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap); |
|||
|
|||
=stack |
|||
[ ... ] -> [ ... err! ] |
|||
|
|||
=summary |
|||
<p>Vararg variant of |
|||
<code><a href="#duk_error">duk_error()</a></code>.</p> |
|||
|
|||
=example |
|||
void my_range_error(duk_context *ctx, const char *fmt, ...) { |
|||
va_list ap; |
|||
|
|||
va_start(ap, fmt); |
|||
duk_error_va(ctx, DUK_ERR_RANGE_ERROR, fmt, ap); |
|||
va_end(ap); |
|||
} |
|||
|
|||
=tags |
|||
error |
|||
vararg |
|||
|
|||
=seealso |
|||
duk_error |
|||
duk_throw |
|||
duk_push_error_object |
|||
|
|||
=introduced |
|||
1.1.0 |
@ -0,0 +1,25 @@ |
|||
=proto |
|||
void duk_log_va(duk_context *ctx, duk_int_t level, const char *fmt, va_list ap); |
|||
|
|||
=summary |
|||
<p>Vararg variant of |
|||
<code><a href="#duk_log">duk_log()</a></code>.</p> |
|||
|
|||
=example |
|||
void my_log_info(duk_context *ctx, const char *fmt, ...) { |
|||
va_list ap; |
|||
|
|||
va_start(ap, fmt); |
|||
duk_log_va(ctx, DUK_LOG_INFO, fmt, ap); |
|||
va_end(ap); |
|||
} |
|||
|
|||
=tags |
|||
log |
|||
vararg |
|||
|
|||
=seealso |
|||
duk_log |
|||
|
|||
=introduced |
|||
1.1.0 |
@ -0,0 +1,33 @@ |
|||
=proto |
|||
duk_idx_t duk_push_error_object_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap); |
|||
|
|||
=stack |
|||
[ ... ] -> [ ... err! ] |
|||
|
|||
=summary |
|||
<p>Vararg variant of |
|||
<code><a href="#duk_push_error_object">duk_push_error_object()</a></code>.</p> |
|||
|
|||
=example |
|||
duk_idx_t my_type_error(duk_context *ctx, const char *fmt, ...) { |
|||
va_list ap; |
|||
duk_idx_t err_idx; |
|||
|
|||
va_start(ap, fmt); |
|||
err_idx = duk_push_error_object_va(ctx, fmt, ap); |
|||
va_end(ap); |
|||
|
|||
return err_idx; |
|||
} |
|||
|
|||
=tags |
|||
stack |
|||
object |
|||
error |
|||
vararg |
|||
|
|||
=seealso |
|||
duk_push_error_object |
|||
|
|||
=introduced |
|||
1.1.0 |
Loading…
Reference in new issue