mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
dev: add get_proxy_object to util/context
This commit is contained in:
parent
3649dff9aa
commit
c0b109d4d2
@ -75,6 +75,22 @@ class Context {
|
||||
get values () {
|
||||
return this.values_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @untested
|
||||
*/
|
||||
get_proxy_object () {
|
||||
return new Proxy(this.values_, {
|
||||
get: (target, prop) => {
|
||||
return this.get(prop);
|
||||
},
|
||||
set: (target, prop, value) => {
|
||||
this.set(prop, value);
|
||||
return true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
constructor (imm_values, opt_parent, opt_name) {
|
||||
const values = { ...imm_values };
|
||||
imm_values = null;
|
||||
|
Loading…
Reference in New Issue
Block a user