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 .key can't be a pattern at this point...
|
||||||
// XXX this is a potential problem as with a pattern key we would need to
|
// XXX this is a potential problem as with a pattern key we would need to
|
||||||
// look ahead to pick the correct candidate...
|
// 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 =
|
var AT =
|
||||||
module.AT =
|
module.AT =
|
||||||
object.makeConstructor('AT', Object.assign(new LogicType(), {
|
object.makeConstructor('AT', Object.assign(new LogicType(), {
|
||||||
__cmp__: function(obj, cmp){
|
__cmp__: function(obj, cmp){
|
||||||
if(cmp(obj[this.key], this.value)){
|
if(cmp(obj != null ? obj[this.key] : null, this.value)){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -52,7 +52,8 @@ var DIFF_FORMAT_FLAT =
|
|||||||
module.DIFF_FORMAT_FLAT = ARRAY(CHANGE)
|
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 =
|
var DIFF_FORMAT_TREE =
|
||||||
module.DIFF_FORMAT_TREE = ANY
|
module.DIFF_FORMAT_TREE = ANY
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user