Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other Fix for #310 #333

Merged
merged 1 commit into from
Jul 27, 2014
Merged

Other Fix for #310 #333

merged 1 commit into from
Jul 27, 2014

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