Browse Source

print-alert/console extra consistency trivia

pull/746/head
Sami Vaarala 9 years ago
parent
commit
7ececb46cb
  1. 2
      extras/console/README.rst
  2. 1
      extras/console/test.c
  3. 2
      extras/print-alert/README.rst
  4. 5
      extras/print-alert/test.c

2
extras/console/README.rst

@ -11,7 +11,7 @@ contains an example binding:
* Ensure ``duk_console.h`` is in the include path.
* Include the extra header in calling code::
* Include the extra header in calling code and initialize the bindings::
#include "duktape.h"
#include "duk_console.h"

1
extras/console/test.c

@ -12,6 +12,7 @@ int main(int argc, char *argv[]) {
}
duk_console_init(ctx, DUK_CONSOLE_PROXY_WRAPPER /*flags*/);
printf("top after init: %ld\n", (long) duk_get_top(ctx));
for (i = 1; i < argc; i++) {
printf("Evaling: %s\n", argv[i]);

2
extras/print-alert/README.rst

@ -11,7 +11,7 @@ print() and alert() bindings:
* Ensure ``duk_print_alert.h`` is in the include path.
* Include the extra header in calling code::
* Include the extra header in calling code and initialize the bindings::
#include "duktape.h"
#include "duk_print_alert.h"

5
extras/print-alert/test.c

@ -12,10 +12,13 @@ int main(int argc, char *argv[]) {
}
duk_print_alert_init(ctx, 0 /*flags*/);
printf("top after init: %ld\n", (long) duk_get_top(ctx));
for (i = 1; i < argc; i++) {
printf("Evaling: %s\n", argv[i]);
duk_eval_string_noresult(ctx, argv[i]);
(void) duk_peval_string(ctx, argv[i]);
printf("--> %s\n", duk_safe_to_string(ctx, -1));
duk_pop(ctx);
}
printf("Done\n");

Loading…
Cancel
Save