Skip to content

Commit

Permalink
Fix the issue regarding last two char slice
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal diyora authored and vishal diyora committed Dec 2, 2023
1 parent b195eef commit 80a540e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/16comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ alasql.utils.uncomment = function (str) {
}
} else if (lineComment) {
// One-line comments end with the line-break
if (str[i + 1] === '\n' || str[i + 1] === '\r') {
if (str[i + 1] === '\n' || str[i + 1] === '\r' || str.length - 2 === i) {
lineComment = false;
}
str[i] = '';
Expand Down

0 comments on commit 80a540e

Please sign in to comment.