=proto int duk_to_int32(duk_context *ctx, int index); =stack [ ... val! ... ] -> [ ... ToInt32(val)! ... ] =summary
Replace the value at index
with an Ecmascript
ToInt32()
coerced value. Returns the coerced value. If index
is invalid, throws
an error.
Custom type coercion:
0
for zero-size buffer, 1
otherwise0
for NULL
pointer, 1
otherwiseToInt32()
is a signed 32-bit integer and is assumed to
fit into the C int
type. If the C type is smaller, the value will be
coerced by the C compiler (double
to int
).