guy 7 years ago
parent
commit
61926a5cd6
  1. 43
      dist/fix/fix.js

43
dist/fix/fix.js vendored

@ -989,6 +989,24 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var fns = exps.slice(); var fns = exps.slice();
var complete = false, var complete = false,
running = false; running = false;
var callback = function callback(index) {
if (complete === true) {
return;
}
fns[index] = true;
if (runBinaryFunction(fns)) {
complete = true;
cb();
}
if (!running) {
running = true;
nextTick(function () {
complete = false;
running = false;
fns = exps.slice();
});
}
};
_.each(exps, function (exp, i) { _.each(exps, function (exp, i) {
if (_.has(operators, exp)) { if (_.has(operators, exp)) {
return; return;
@ -1014,7 +1032,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var w = new Watcher(model, function () { var w = new Watcher(model, function () {
dep.depend(); dep.depend();
return NaN; return NaN;
}, cb); }, function () {
callback(i);
});
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
w.teardown(); w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep); v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
@ -1043,7 +1063,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var _w = new Watcher(model, function () { var _w = new Watcher(model, function () {
_dep.depend(); _dep.depend();
return NaN; return NaN;
}, cb); }, function () {
callback(i);
});
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
_w.teardown(); _w.teardown();
root._globalDeps && delete root._globalDeps[regStr]; root._globalDeps && delete root._globalDeps[regStr];
@ -1051,22 +1073,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return; return;
} }
var watcher = new Watcher(model, exp, function () { var watcher = new Watcher(model, exp, function () {
if (complete === true) { callback(i);
return;
}
fns[i] = true;
if (runBinaryFunction(fns)) {
complete = true;
cb();
}
if (!running) {
running = true;
nextTick(function () {
complete = false;
running = false;
fns = exps.slice();
});
}
}, options); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
watcher.teardown(); watcher.teardown();

Loading…
Cancel
Save