Comparing version 3.1.6 to 3.2.0
@@ -59,3 +59,3 @@ (function(self) { | ||
fn = Object.getPrototypeOf(logic)[ref]; | ||
else if ($global[ref]) | ||
else if ($global[ref] && caller && caller !== '__user__') | ||
return clues($global,ref,$global,caller,fullref); | ||
@@ -102,3 +102,3 @@ else if (logic && logic.$property && typeof logic.$property === 'function') | ||
return res || clues(logic,arg,$global,ref,fullref) | ||
return res || clues(logic,arg,$global,ref || 'fn',fullref) | ||
.then(null,function(e) { | ||
@@ -105,0 +105,0 @@ if (optional) return (showError) ? e : undefined; |
{ | ||
"name": "clues", | ||
"version": "3.1.6", | ||
"version": "3.2.0", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -58,3 +58,12 @@ var clues = require('../clues'), | ||
it('should be applied inside a function',function() { | ||
it('can not be applied directly',function() { | ||
return clues(facts,'$input',global) | ||
.then(function() { | ||
throw 'Should Error'; | ||
},function(e) { | ||
assert.equal(e.message,'$input not defined'); | ||
}); | ||
}); | ||
it('can not be applied as part of dot notation',function() { | ||
return clues(facts,'d.c',global) | ||
@@ -61,0 +70,0 @@ .then(function(d) { |
@@ -30,3 +30,3 @@ var clues = require('../clues'), | ||
it ('should return a function',function() { | ||
clues(Object.create(logic),'$logic_service',Object.create(global)) | ||
return clues(Object.create(logic),'$logic_service',Object.create(global)) | ||
.then(function($logic_service) { | ||
@@ -42,3 +42,3 @@ assert.equal(typeof $logic_service,'function'); | ||
it ('should return a function',function() { | ||
clues(Object.create(logic),'top.$nested_service',Object.create(global)) | ||
return clues(Object.create(logic),'top.$nested_service',Object.create(global)) | ||
.then(function($nested_service) { | ||
@@ -53,7 +53,6 @@ assert.equal(typeof $nested_service,'function'); | ||
it('should return a function',function() { | ||
clues(Object.create(logic),'$global_service',Object.create(global)) | ||
.then(function($logic_service) { | ||
return clues(Object.create(logic),function($logic_service) { | ||
assert.equal(typeof $logic_service,'function'); | ||
assert.equal($logic_service(20),20); | ||
}); | ||
},Object.create(global)); | ||
}); | ||
@@ -60,0 +59,0 @@ }); |
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
69674
1301