|
|
@ -280,20 +280,12 @@ export function create_proxy(value, onchanges) {
|
|
|
|
batching = true;
|
|
|
|
batching = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if we are changing the length of the array we batch all the changes
|
|
|
|
|
|
|
|
// to the sources and the original value by calling batch_onchange and immediately
|
|
|
|
|
|
|
|
// invoking it...otherwise we just invoke an identity function
|
|
|
|
|
|
|
|
(is_proxied_array && prop === 'length' ? batch_onchange : identity)(() => {
|
|
|
|
|
|
|
|
// variable.length = value -> clear all signals with index >= value
|
|
|
|
// variable.length = value -> clear all signals with index >= value
|
|
|
|
if (is_proxied_array && prop === 'length') {
|
|
|
|
if (is_proxied_array && prop === 'length') {
|
|
|
|
for (var i = value; i < /** @type {Source<number>} */ (s).v; i += 1) {
|
|
|
|
for (var i = value; i < /** @type {Source<number>} */ (s).v; i += 1) {
|
|
|
|
var other_s = sources.get(i + '');
|
|
|
|
var other_s = sources.get(i + '');
|
|
|
|
if (other_s !== undefined) {
|
|
|
|
if (other_s !== undefined) {
|
|
|
|
if (
|
|
|
|
if (typeof other_s.v === 'object' && other_s.v !== null && STATE_SYMBOL in other_s.v) {
|
|
|
|
typeof other_s.v === 'object' &&
|
|
|
|
|
|
|
|
other_s.v !== null &&
|
|
|
|
|
|
|
|
STATE_SYMBOL in other_s.v
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
other_s.v[PROXY_ONCHANGE_SYMBOL](onchanges, true);
|
|
|
|
other_s.v[PROXY_ONCHANGE_SYMBOL](onchanges, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set(other_s, UNINITIALIZED);
|
|
|
|
set(other_s, UNINITIALIZED);
|
|
|
@ -332,7 +324,6 @@ export function create_proxy(value, onchanges) {
|
|
|
|
with_parent(() => create_proxy(value, onchanges))
|
|
|
|
with_parent(() => create_proxy(value, onchanges))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (is_proxied_array && prop === 'length') {
|
|
|
|
if (is_proxied_array && prop === 'length') {
|
|
|
|
batching = false;
|
|
|
|
batching = false;
|
|
|
|