Permalink
Browse files

Merge pull request #5 from NV/make_headers_optional

Make oldHeader and newHeader optional
  • Loading branch information...
2 parents 70f37f8 + 645e868 commit 835f5bdcef8e1c36855062d710455b68cf9f858e @kpdecker kpdecker committed Dec 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 diff.js
View
4 diff.js
@@ -179,8 +179,8 @@ var JsDiff = (function() {
ret.push("Index: " + fileName);
ret.push("===================================================================");
- ret.push("--- " + fileName + "\t" + oldHeader);
- ret.push("+++ " + fileName + "\t" + newHeader);
+ ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader));
+ ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader));
var diff = LineDiff.diff(oldStr, newStr);
diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier

0 comments on commit 835f5bd

Please sign in to comment.