var proxyKeys = helpers.assignEverything(Object.create(null), makeObject.proxyKeys());
typeBindings(proxyKeys);
canReflect.assignSymbols(proxyKeys, {
"can.defineInstanceKey": function(prop, value) {
this[symbols.metaSymbol].definitions[prop] = value;
}
});
var makeFunction = {
observable: function(object, options) {
if(options.shouldRecordObservation === undefined) {
options.shouldRecordObservation = makeObject.shouldRecordObservationOnOwnAndMissingKeys;
}
var proxyKeys = Object.create(makeFunction.proxyKeys());
var meta = {
target: object,
proxyKeys: proxyKeys,
options: options,
definitions: {},
isClass: helpers.isClass(object),
preventSideEffects: 0
};
proxyKeys[symbols.metaSymbol] = meta;
meta.proxy = new Proxy(object, {
get: makeObject.get.bind(meta),
set: makeObject.set.bind(meta),
ownKeys: makeObject.ownKeys.bind(meta),
deleteProperty: makeObject.deleteProperty.bind(meta),
construct: makeFunction.construct.bind(meta),
apply: makeFunction.apply.bind(meta),
meta: meta
});
mapBindings.addHandlers(meta.proxy, meta);
typeBindings.addHandlers(meta.proxy, meta);