Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
// A retargetable proxy
function retargetableProxy(target) {
function setTarget(obj) {
target = obj;
}
var handler = {
get: function (_, name) {
return target[name];
},
set: function (_, name, value) {
target[name] = value;
},
getOwnPropertyDescriptor: function (_, name) {
var desc = Object.getOwnPropertyDescriptor(target, name);
if (desc)
desc.configurable = true;
return desc;
},
isExtensible: function (_) {
return true;
}
// ...
};
return [new Proxy({}, handler), setTarget];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.