~mdw
/
dep-ui
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dep.js (orelse): Fix typo in the documentation comment.
[dep-ui]
/
dep.js
diff --git
a/dep.js
b/dep.js
index
d5235be
..
f9a9a18
100644
(file)
--- a/
dep.js
+++ b/
dep.js
@@
-235,7
+235,7
@@
Dep.prototype = {
s += ' #' + this._seq;
// The value, or some kind of marker that it doesn't have one.
s += ' #' + this._seq;
// The value, or some kind of marker that it doesn't have one.
- if (!(f & F_VALUE)) s += ' #{
out-of-dat
e}';
+ if (!(f & F_VALUE)) s += ' #{
stal
e}';
else if (v === BAD) s += ' #{bad}';
else s += ' ' + v.toString();
else if (v === BAD) s += ' #{bad}';
else s += ' ' + v.toString();
@@
-255,7
+255,7
@@
Dep.prototype = {
* If the receiver isn't up-to-date then we synthesize the flags.
*/
* If the receiver isn't up-to-date then we synthesize the flags.
*/
- if (
this.state
=== 'ready') return F_VALUE | F_DEPS;
+ if (
STATE
=== 'ready') return F_VALUE | F_DEPS;
else if (this._generation === GENERATION) return this.__flags;
else if (this._value_function === null) return F_VALUE | F_DEPS;
else return 0;
else if (this._generation === GENERATION) return this.__flags;
else if (this._value_function === null) return F_VALUE | F_DEPS;
else return 0;
@@
-394,12
+394,12
@@
Dep.prototype = {
var val;
var val;
- if (state === 'recomputing') {
+ if (STATE === 'recomputing') {
+ this._force();
if (EVALUATING) {
this._dependents[EVALUATING._seq] = EVALUATING;
EVALUATING._dependencies[this._seq] = this;
}
if (EVALUATING) {
this._dependents[EVALUATING._seq] = EVALUATING;
EVALUATING._dependencies[this._seq] = this;
}
- this._force();
}
val = this._value;
if (val === BAD) throw BAD;
}
val = this._value;
if (val === BAD) throw BAD;
@@
-444,7
+444,7
@@
Dep.prototype = {
function orelse(thunk, errthunk) {
/* Call THUNK. If it succeeds, then return its result. If THUNK
function orelse(thunk, errthunk) {
/* Call THUNK. If it succeeds, then return its result. If THUNK
- * reads a bad dep then call ERRTH
I
NK and return its result instead.
+ * reads a bad dep then call ERRTH
U
NK and return its result instead.
*/
var e;
*/
var e;
@@
-469,8
+469,8
@@
function recompute_pending() {
*/
var d, f;
*/
var d, f;
-
-
state
= 'recomputing';
+ var old_state = STATE;
+
STATE
= 'recomputing';
try_finally(function () {
while (PENDING.length) {
d = PENDING.shift();
try_finally(function () {
while (PENDING.length) {
d = PENDING.shift();
@@
-488,6
+488,7
@@
function recompute_pending() {
d = PENDING.shift();
d._value = BAD;
}
d = PENDING.shift();
d._value = BAD;
}
+ STATE = old_state;
});
}
});
}
@@
-503,7
+504,7
@@
function with_frozen(body, delay) {
*/
var op, val;
*/
var op, val;
- var old_delayed, old_pending;
+ var old_delayed, old_pending
, old_state
;
switch (STATE) {
case 'frozen':
switch (STATE) {
case 'frozen':
@@
-516,6
+517,8
@@
function with_frozen(body, delay) {
case 'ready':
old_delayed = DELAYED;
old_pending = PENDING;
case 'ready':
old_delayed = DELAYED;
old_pending = PENDING;
+ old_state = STATE;
+ STATE = "frozen";
try_finally(function () {
DELAYED = [];
PENDING = [];
try_finally(function () {
DELAYED = [];
PENDING = [];
@@
-530,6
+533,7
@@
function with_frozen(body, delay) {
}, function () {
DELAYED = old_delayed;
PENDING = old_pending;
}, function () {
DELAYED = old_delayed;
PENDING = old_pending;
+ STATE = old_state;
});
break;
}
});
break;
}