flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.
MIT License
2.99k stars 213 forks source link

TypeError: Cannot read property 'options' of undefined #143

Closed sh977218 closed 5 years ago

sh977218 commented 5 years ago

I believe there is bug here. I have two object obj1: { a:{ b:'b' } } obj2: { b:'b' }

The code will throw error: TypeError: Cannot read property 'options' of undefined

because obj2 does not have a when try to compare obj1's a.b

only-cliches commented 5 years ago

When I use your example objects in RunKit I get this result:

[
  {
    "kind": "D",
    "path": [
      "a"
    ],
    "lhs": {
      "b": "b"
    }
  },
  {
    "kind": "N",
    "path": [
      "b"
    ],
    "rhs": "b"
  }
]

Seems like there might be something else going on with your code.

sh977218 commented 5 years ago

I cannot reproduce this, closing it.