mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 18:40:09 +00:00
a fix, notes and testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
dfa10ed65e
commit
c4263bef74
8
diff.js
8
diff.js
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user