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.
30 lines
774 B
30 lines
774 B
name: duk_dump_function
|
|
|
|
proto: |
|
|
void duk_dump_function(duk_context *ctx);
|
|
|
|
stack: |
|
|
[ ... function! ] -> [ ... bytecode! ]
|
|
|
|
summary: |
|
|
<p>Dump an Ecmascript function at stack top into
|
|
<a href="https://github.com/svaarala/duktape/blob/master/doc/bytecode.rst">bytecode</a>,
|
|
replacing the function with a buffer containing the bytecode data.
|
|
The bytecode can be loaded back using
|
|
<code><a href="#duk_load_function">duk_load_function()</a></code>.</p>
|
|
|
|
<p include="bytecode-moreinfo.html" />
|
|
|
|
example: |
|
|
duk_eval_string(ctx, "(function helloWorld() { print('hello world'); })");
|
|
duk_dump_function(ctx);
|
|
/* stack top now contains a buffer containing helloWorld bytecode */
|
|
|
|
tags:
|
|
- stack
|
|
- bytecode
|
|
|
|
seealso:
|
|
- duk_load_function
|
|
|
|
introduced: 1.3.0
|
|
|