Fix bug in the code review tool when readding a discarded comment
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2011 23:26:58 +0000 (23:26 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2011 23:26:58 +0000 (23:26 +0000)
commitdca5d41a032f1d8fc06de2cf55709ee2e7df05be
tree65eeac74cc77da07f2d0b010627516a5fdf8b502
parent5fc0618720b5206ceab7aaea56c7ca9be6e17082
Fix bug in the code review tool when readding a discarded comment
https://bugs.webkit.org/show_bug.cgi?id=74450

Reviewed by Adam Barth.

If you discard a comment that has a corresponding previousComment,
then we would incorrectly remove the comment baseline. So, the next
time you added a comment by clicking on the previousComment, we
would get undefined as the start line for the new comment.

All of this works fine until you try to restore the comment from
localStorage, at which point we throw an error because the start
line is undefined.

Also added some failsafes to better handle the case of corrupted comments.

* code-review-test.html:
* code-review.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Websites/bugs.webkit.org/ChangeLog
Websites/bugs.webkit.org/code-review-test.html
Websites/bugs.webkit.org/code-review.js