mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
758 B
28 lines
758 B
name: duk_push_proxy
|
|
|
|
proto: |
|
|
duk_idx_t duk_push_proxy(duk_context *ctx, duk_uint_t proxy_flags);
|
|
|
|
stack: |
|
|
[ ... target! handler! ] -> [ ... proxy! ]
|
|
|
|
summary: |
|
|
<p>Push a new Proxy object for target and handler table given on the value
|
|
stack, equivalent to <code>new Proxy(target, handler)</code>. The
|
|
<code>proxy_flags</code> argument is currently (Duktape 2.2) unused, calling
|
|
code must pass in a zero.</p>
|
|
|
|
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
|
|
|