Skip to content

Commit c0b109d

Browse files
committed
dev: add get_proxy_object to util/context
1 parent 3649dff commit c0b109d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/backend/src/util/context.js

+16
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ class Context {
7575
get values () {
7676
return this.values_;
7777
}
78+
79+
/**
80+
* @untested
81+
*/
82+
get_proxy_object () {
83+
return new Proxy(this.values_, {
84+
get: (target, prop) => {
85+
return this.get(prop);
86+
},
87+
set: (target, prop, value) => {
88+
this.set(prop, value);
89+
return true;
90+
},
91+
});
92+
}
93+
7894
constructor (imm_values, opt_parent, opt_name) {
7995
const values = { ...imm_values };
8096
imm_values = null;

0 commit comments

Comments
 (0)