mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
11 years ago
8 changed files with 123 additions and 1 deletions
@ -0,0 +1,16 @@ |
|||
=proto |
|||
void duk_compile_file(duk_context *ctx, int flags, const char *path); |
|||
|
|||
=stack |
|||
[ ... ] -> [ ... function! ] |
|||
|
|||
=summary |
|||
<p>Like |
|||
<tt><a href="#duk_compile">duk_compile()</a></tt>, but the compile input |
|||
is given as a filename.</p> |
|||
|
|||
=example |
|||
duk_compile_file(ctx, 0, "test.js"); |
|||
|
|||
=tags |
|||
compile |
@ -0,0 +1,20 @@ |
|||
=proto |
|||
void duk_eval_file(duk_context *ctx, const char *path); |
|||
|
|||
=stack |
|||
[ ... ] -> [ ... result! ] |
|||
|
|||
=summary |
|||
<p>Like |
|||
<tt><a href="#duk_eval">duk_eval()</a></tt>, but the eval input |
|||
is given as a filename.</p> |
|||
|
|||
=example |
|||
duk_eval_string(ctx, "test.js"); |
|||
printf("result is: '%s'\n", duk_get_string(ctx, -1)); |
|||
duk_pop(ctx); |
|||
|
|||
=tags |
|||
compile |
|||
|
|||
=macro |
@ -0,0 +1,20 @@ |
|||
=proto |
|||
const char *duk_push_string_file(duk_context *ctx, const char *path); |
|||
|
|||
=stack |
|||
[ ... ] -> [ ... data! ] |
|||
|
|||
=summary |
|||
<p>Push the contents of a file <tt>path</tt> into the stack as string data. |
|||
The file should be CESU-8 formatted if Ecmascript string compatibility is |
|||
necessary. A pointer to the interned string data is returned. If the |
|||
operation fails, throws an error.</p> |
|||
|
|||
<p>If <tt>path</tt> is NULL, throws an error.</p> |
|||
|
|||
=example |
|||
duk_push_string_file(ctx, "test.js"); |
|||
|
|||
=tags |
|||
stack |
|||
string |
Loading…
Reference in new issue