Browse Source

Merge pull request #2074 from svaarala/apidoc-call-method-fix

Fix duk_(p)call_method() API doc example
pull/2078/head
Sami Vaarala 6 years ago
committed by GitHub
parent
commit
3b94b31876
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      website/api/duk_call_method.yaml
  2. 4
      website/api/duk_pcall_method.yaml

4
website/api/duk_call_method.yaml

@ -33,8 +33,8 @@ example: |
* and returns 5. * and returns 5.
*/ */
duk_push_string(ctx, "function(x,y) { print('this:', this); " duk_push_string(ctx, "(function(x,y) { print('this:', this); "
"print(x,y); return x+y; }"); "print(x,y); return x+y; })");
duk_eval(ctx); /* -> [ ... func ] */ duk_eval(ctx); /* -> [ ... func ] */
duk_push_int(ctx, 123); duk_push_int(ctx, 123);
duk_push_int(ctx, 2); duk_push_int(ctx, 2);

4
website/api/duk_pcall_method.yaml

@ -23,8 +23,8 @@ example: |
duk_int_t rc; duk_int_t rc;
duk_push_string(ctx, "function(x,y) { print('this:', this); " duk_push_string(ctx, "(function(x,y) { print('this:', this); "
"print(x,y); return x+y; }"); "print(x,y); return x+y; })");
duk_eval(ctx); /* -> [ ... func ] */ duk_eval(ctx); /* -> [ ... func ] */
duk_push_int(ctx, 123); duk_push_int(ctx, 123);
duk_push_int(ctx, 2); duk_push_int(ctx, 2);

Loading…
Cancel
Save