Comparing version 3.6.0-rc2 to 3.6.0-rc3
28
clues.js
@@ -12,18 +12,16 @@ (function(self) { | ||
var checked = [],circular; | ||
return (function check(c) { | ||
if (circular || !c || checked.indexOf(c) !== -1) return; | ||
function check(c) { | ||
if (!c || circular || checked.indexOf(c) !== -1) return; | ||
if (c === d) return circular = true; | ||
checked.push(c); | ||
if (c == value) | ||
return (circular = true); | ||
check(c._promise0); | ||
check(c._receiver0); | ||
check(c._promise); | ||
Object.keys(c).forEach(function(key) { | ||
if (!isNaN(key)) check(c[key]); | ||
}); | ||
} | ||
if (c._cancellationParent) | ||
check(c._cancellationParent); | ||
if (c._onCancelField && c._onCancelField._values) | ||
c._onCancelField._values.forEach(check); | ||
if (c._followee && c._followee()) | ||
check(c._followee()); | ||
})(d) || circular; | ||
check(value); | ||
return circular; | ||
} | ||
@@ -113,3 +111,3 @@ | ||
if (typeof fn !== 'function' || (ref && ref[0] === '$')) { | ||
if (fn && fn._cancellationParent && !clues.ignoreCircular && fn.isPending && fn.isPending() && checkCircular(fn,last)) | ||
if (fn && clues.checkCircular && fn.isPending && fn.isPending() && checkCircular(fn,last)) | ||
return clues.Promise.rejected({ref: ref, message: 'circular', fullref:fullref, caller: caller}); | ||
@@ -116,0 +114,0 @@ |
{ | ||
"name": "clues", | ||
"version": "3.6.0-rc2", | ||
"version": "3.6.0-rc3", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
var clues = require('../clues'), | ||
assert = require('assert'); | ||
clues.Promise.config({cancellation:true}); | ||
clues.checkCircular = true; | ||
@@ -6,0 +6,0 @@ var logic = { |
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
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
1868
93380