Skip to content

Commit 7e5a0f6

Browse files
authored
Updated polyfill.js
Signed-off-by: Bhavishy Agrawal <[email protected]>
1 parent a092b94 commit 7e5a0f6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

lib/node_modules/@stdlib/proxy/ctor/lib/polyfill.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,30 @@
4747
*/
4848

4949
// eslint-disable-next-line stdlib/jsdoc-doctest-marker
50+
/**
51+
* A polyfill for the Proxy function.
52+
*
53+
* This function is a placeholder for the Proxy functionality and is intended to be replaced by
54+
* a proper implementation of a Proxy. It is used to demonstrate how a Proxy can be used to intercept
55+
* interactions with an object.
56+
*
57+
* @param {Object} target - The target object to wrap with the Proxy.
58+
* @returns {Object} The target object (polyfill implementation in this case).
59+
*
60+
* @example
61+
* var handler = {
62+
* get: function(target, prop) {
63+
* return prop in target ? target[prop] : 42;
64+
* }
65+
* };
66+
*
67+
* var p = new Proxy({}, handler);
68+
* console.log(p.a); // 42
69+
*/
5070
function Proxy( target ) {
5171
// eslint-disable-next-line no-warning-comments
5272
// TODO: polyfill implementation
5373
return target;
54-
// eslint-enable require-jsdoc
5574
}
5675

5776

0 commit comments

Comments
 (0)