=proto int duk_pcall_prop(duk_context *ctx, int obj_index, int nargs); =stack [ ... obj! ... key! arg1! ...! argN! ] -> [ ... obj! ... retval! ] (if success, return value == 0) [ ... obj! ... key! arg1! ...! argN! ] -> [ ... obj! ... err! ] (if failure, return value != 0) =summary

Like duk_pcall(), but the target function is looked up from obj.key and obj is used as the function's this binding.

=example /* obj.myAdderMethod(2,3) -> 5 */ int obj_idx; int rc; duk_push_string(ctx, "myAdderMethod"); duk_push_int(ctx, 2); duk_push_int(ctx, 3); rc = duk_pcall_prop(ctx, obj_idx, 2); /* [ ... "myAdderMethod" 2 3 ] -> [ ... 5 ] */ if (rc == DUK_EXEC_SUCCESS) { printf("2+3=%d\n", duk_get_int(ctx, -1)); } else { printf("error: %s\n", duk_to_string(ctx, -1)); } duk_pop(ctx); =tags property call