Ariel, the function you provide would be error prone.
You can read why here: http://philrathe.com/articles/equiv
Qunit has now the same assertion function that is based on the code in
this article.
Philippe Rathé
On Oct 6, 4:19 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Wouldn't this be en
Wouldn't this be enough ?
http://codedumper.com/object
Could be prolly optimized.
--
Ariel Flesler
http://flesler.blogspot.com
On Oct 5, 5:35 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> it shouldn't be that hard, but I'm struggling implementing a recursive
> comparsion of object
You might want to take a look at my JavaScript utilities library,
which includes a function to test equality of most data types
recursively. The library can be found at:
http://www.bramstein.com/projects/jfun/core.js
It does however extend the prototypes of built-in types (except for
Object) so
I've put it up here :
http://gist.github.com/15009
Behaviour :
//diff([1,2,3],[1,2,4]) => {2:3}
//diff([1,2,3],[1,2,3]) => null
//diff({a:1,b:2},{a:1}) => {b:2}
//diff({a:1},{a:2}) => {a:1}
//diff({a:1, b: {c:2,d:4} },{a:1 , b : {c:2} }) => { "[object Object]"
=> {d:4} }
On 5 Oct, 22:41, wee
I once wrote a recursive diff that would return the difference between
2 objects.
I'll dig it out tomorrow.
On 5 Oct, 21:35, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> it shouldn't be that hard, but I'm struggling implementing a recursive
> comparsion of object structures in JavaScri