=proto unsigned int duk_to_uint16(duk_context *ctx, int index); =stack [ ... val! ... ] -> [ ... ToUint16(val)! ... ] =summary
Replace the value at index
with an Ecmascript
ToUint16()
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
otherwiseToUint16()
is an unsigned 16-bit integer and is assumed to
fit into the C unsigned int
type. If the C type is smaller, the value will be
coerced by the C compiler (double
to unsigned int
).