mirror of
https://github.com/flynx/diff.js.git
synced 2025-10-29 02:50:10 +00:00
fix part 2, now AT(..) sees all the attributes that exist...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
97fa4718ae
commit
f36b40cdec
18
diff.js
18
diff.js
@ -58,6 +58,24 @@ var MIN_TEXT_LENGTH = 100
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
// Helpers...
|
// Helpers...
|
||||||
|
|
||||||
|
// getAllKeys(obj)
|
||||||
|
// -> Set([key, ..])
|
||||||
|
//
|
||||||
|
// This is different to Object.keys(..) in that it gets both enumerable
|
||||||
|
// and non-enumerable keys as well as keys defined in prototypes...
|
||||||
|
var getAllKeys = function(obj){
|
||||||
|
var res = new Set()
|
||||||
|
while(obj.__proto__ || obj === obj.__proto__){
|
||||||
|
Object.getOwnPropertyNames(obj)
|
||||||
|
.forEach(function(n){
|
||||||
|
res.add(n)
|
||||||
|
})
|
||||||
|
obj = obj.__proto__
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// zip(array, array, ...)
|
// zip(array, array, ...)
|
||||||
// -> [[item, item, ...], ...]
|
// -> [[item, item, ...], ...]
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user