Comparing version 0.2.1 to 0.2.2
@@ -118,16 +118,32 @@ "use strict"; | ||
var currentParentEntry; | ||
var getLocal = require("./local.js").get; | ||
Ep.recompute = function recompute() { | ||
this.forgetChildren(); | ||
var local = getLocal(); | ||
var oldParentEntry = local.currentParentEntry; | ||
local.currentParentEntry = this; | ||
// Set this.dirty = true so that we can tell if the try block threw an | ||
// exception below, even though we aren't catching the exception. | ||
this.dirty = true; | ||
var oldParentEntry = currentParentEntry; | ||
currentParentEntry = this; | ||
try { | ||
this.value = this.fn.apply(null, this.args); | ||
this.dirty = false; | ||
} finally { | ||
currentParentEntry = oldParentEntry; | ||
assert.strictEqual(local.currentParentEntry, this); | ||
local.currentParentEntry = oldParentEntry; | ||
if (! this.dirty) { | ||
this.updateParents(); | ||
if (oldParentEntry) { | ||
this.parents.add(oldParentEntry); | ||
} | ||
this.parents.forEach(function (parent) { | ||
parent.reportCleanChild(this); | ||
}, this); | ||
return this.value; | ||
@@ -152,11 +168,1 @@ } | ||
}; | ||
Ep.updateParents = function updateParents() { | ||
if (currentParentEntry) { | ||
this.parents.add(currentParentEntry); | ||
} | ||
this.parents.forEach(function (parent) { | ||
parent.reportCleanChild(this); | ||
}, this); | ||
}; |
{ | ||
"name": "optimism", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "Ben Newman <ben@benjamn.com>", | ||
@@ -34,4 +34,8 @@ "description": "Composable reactive caching with efficient invalidation.", | ||
"devDependencies": { | ||
"fibers": "^1.0.14", | ||
"mocha": "^3.1.0" | ||
}, | ||
"optionalDependencies": { | ||
"fibers": "^1.0.14" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9106
8
212
2
2
1