Skip to content

Conversation

@muhqu
Copy link

@muhqu muhqu commented May 19, 2014

Fix for #310.

  ...
  message = "TypeError: 'undefined' is not an object (evaluating 'ns[ n[i] ].rows.push')";
  sourceURL = "file:///Applications/GitX.app/Contents/Resources/html/lib/diffHighlighter.js";

I turns out that the inlinediff.diff() method had issues caused by the use of Objects as HashMap. That's why @dgreensp added a fix using Object.prototype.hasOwnProperty (see #320). However this solution still fails when the key becomes __proto__, for some reason.

A simpler, saver and yet more efficient fix to the root issue is to just prefix the keys. e.g. '"' + key.

Fix for rowanj#310.
```
  ...
  message = "TypeError: 'undefined' is not an object (evaluating 'ns[ n[i] ].rows.push')";
  sourceURL = "file:///Applications/GitX.app/Contents/Resources/html/lib/diffHighlighter.js";
```

I turns out that the `inlinediff.diff()` method had issues caused by the use of Objects as HashMap. That's why @dgreensp added a fix using `Object.prototype.hasOwnProperty` (see rowanj#320). However this solution still fails when the key becomes `"__proto__"`, for some reason.

A simpler, saver and yet more efficient fix to the root issue is to just prefix the keys. e.g. `'"' + key`.
rowanj added a commit that referenced this pull request Jul 27, 2014
@rowanj rowanj merged commit db37cc7 into rowanj:master Jul 27, 2014
rowanj added a commit that referenced this pull request Jul 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants