mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-28 10:30:09 +00:00
experimenting...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8d7a8693b9
commit
fc500be1c2
14
diff.js
14
diff.js
@ -457,12 +457,22 @@ object.makeConstructor('NUMBER', Object.assign(new LogicType(), {
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// XXX IN(A) == L iff A in L
|
||||
// XXX add support for other containers...
|
||||
var IN =
|
||||
module.IN =
|
||||
object.makeConstructor('IN', Object.assign(new LogicType(), {
|
||||
__cmp__: function(obj, cmp){
|
||||
// XXX
|
||||
},
|
||||
var p = this.value
|
||||
// XXX the problem here is that we need to both directly test and
|
||||
// deep test (seatch) for the .value in obj...
|
||||
// ...this may get really slow...
|
||||
// XXX add support for other stuff like sets and maps...
|
||||
// XXX make this a break-on-match and not a go-through-the-whole-thing
|
||||
return p in obj
|
||||
|| obj.reduce(function(res, e){
|
||||
return res === false ?
|
||||
cmp(p, e)
|
||||
: res }, false) },
|
||||
__init__: function(value){
|
||||
this.value = value
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user