name: duk_push_proxy proto: | duk_idx_t duk_push_proxy(duk_context *ctx, duk_uint_t proxy_flags); stack: | [ ... target! handler! ] -> [ ... proxy! ] summary: |

Push a new Proxy object for target and handler table given on the value stack, equivalent to new Proxy(target, handler). The proxy_flags argument is currently (Duktape 2.2) unused, calling code must pass in a zero.

example: | duk_idx_t proxy_idx; duk_push_object(ctx); /* target */ duk_push_object(ctx); /* handler */ duk_push_c_function(ctx, my_get, 3); /* 'get' trap */ duk_put_prop_string(ctx, -2, "get"); proxy_idx = duk_push_proxy(ctx, 0); /* [ target handler ] -> [ proxy ] */ tags: - stack - object introduced: 2.2.0