=proto void duk_to_object(duk_context *ctx, int index); =stack [ ... val! ... ] -> [ ... ToObject(val)! ... ] =summary

Replace the value at index with an Ecmascript ToObject() coerced value. There is no return value. Throws an error if value at index is not object coercible, or if index is invalid.

The following types are not object coercible:

=example duk_to_object(ctx, -3); =tags stack object =fixme Buffer and pointer may become object coercible in a future version (they'll then have a prototype object etc, like Number).