mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
834 B
32 lines
834 B
=proto
|
|
void duk_to_object(duk_context *ctx, int index);
|
|
|
|
=stack
|
|
[ ... val! ... ] -> [ ... ToObject(val)! ... ]
|
|
|
|
=summary
|
|
<p>Replace the value at <code>index</code> with an Ecmascript
|
|
<a href="http://www.ecma-international.org/ecma-262/5.1/#sec-9.9">ToObject()</a>
|
|
coerced value. There is no return value. Throws an error if value at
|
|
<code>index</code> is not
|
|
<a href="http://www.ecma-international.org/ecma-262/5.1/#sec-9.10">object coercible</a>,
|
|
or if <code>index</code> is invalid.</p>
|
|
|
|
<p>The following types are not object coercible:</p>
|
|
<ul>
|
|
<li><code>undefined</code></li>
|
|
<li><code>null</code></li>
|
|
<li>buffer</li>
|
|
<li>pointer</li>
|
|
</ul>
|
|
|
|
=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).
|
|
|