|
|
@ -103,16 +103,23 @@ const handler = {
|
|
|
|
return delete target[prop];
|
|
|
|
return delete target[prop];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
has(target, prop) {
|
|
|
|
has(target, prop) {
|
|
|
|
|
|
|
|
if (prop === STATE_SYMBOL) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
const metadata = target[STATE_SYMBOL];
|
|
|
|
const metadata = target[STATE_SYMBOL];
|
|
|
|
const has = Reflect.has(target, prop);
|
|
|
|
const has = Reflect.has(target, prop);
|
|
|
|
let s = metadata.s.get(prop);
|
|
|
|
let s = metadata.s.get(prop);
|
|
|
|
if (s === undefined) {
|
|
|
|
if (!has || s !== undefined || get_descriptor(target, prop)?.writable) {
|
|
|
|
s = source(has ? proxy(target[prop]) : UNINITIALIZED);
|
|
|
|
if (s === undefined) {
|
|
|
|
increment(metadata.v);
|
|
|
|
s = source(has ? proxy(target[prop]) : UNINITIALIZED);
|
|
|
|
metadata.s.set(prop, s);
|
|
|
|
metadata.s.set(prop, s);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const value = get(s);
|
|
|
|
|
|
|
|
if (value === UNINITIALIZED) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const value = get(s);
|
|
|
|
return has;
|
|
|
|
return value === UNINITIALIZED ? false : has;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ownKeys(target) {
|
|
|
|
ownKeys(target) {
|
|
|
|
const metadata = target[STATE_SYMBOL];
|
|
|
|
const metadata = target[STATE_SYMBOL];
|
|
|
|