a fix, notes and testing...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-09-02 03:46:18 +03:00
parent dfa10ed65e
commit c4263bef74
2 changed files with 9 additions and 2 deletions

View File

@ -527,11 +527,17 @@ object.makeConstructor('IN', Object.assign(new LogicType(), {
// XXX .key can't be a pattern at this point...
// XXX this is a potential problem as with a pattern key we would need to
// look ahead to pick the correct candidate...
// XXX this falls into recursion on:
// X = AT('moo')
// X.value = OR(123, X)
// cmp(X, {'moo', 333})
// ...this would also break on checking a recursive structure against
// a recursive pattern...
var AT =
module.AT =
object.makeConstructor('AT', Object.assign(new LogicType(), {
__cmp__: function(obj, cmp){
if(cmp(obj[this.key], this.value)){
if(cmp(obj != null ? obj[this.key] : null, this.value)){
return true
}
return false

View File

@ -52,7 +52,8 @@ var DIFF_FORMAT_FLAT =
module.DIFF_FORMAT_FLAT = ARRAY(CHANGE)
// XXX
// XXX it makes sense to make this a recursive pattern...
// ...need to check if we stop on a recursive pattern...
var DIFF_FORMAT_TREE =
module.DIFF_FORMAT_TREE = ANY