[Pkg-javascript-commits] [less.js] 34/38: Fix #2242 - detect if less does not parse final character
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:27:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v2.2.0
in repository less.js.
commit 10ea76770889edba8a11a427606a563f447208ce
Author: Luke Page <luke.a.page at gmail.com>
Date: Sun Jan 4 08:45:31 2015 +0000
Fix #2242 - detect if less does not parse final character
---
lib/less/parser/parser-input.js | 2 +-
test/less/errors/single-character.less | 1 +
test/less/errors/single-character.txt | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/less/parser/parser-input.js b/lib/less/parser/parser-input.js
index 267ef8e..ad799e8 100644
--- a/lib/less/parser/parser-input.js
+++ b/lib/less/parser/parser-input.js
@@ -239,7 +239,7 @@ module.exports = function() {
parserInput.end = function() {
var message,
- isFinished = parserInput.i >= input.length - 1;
+ isFinished = parserInput.i >= input.length;
if (parserInput.i < furthest) {
message = furthestPossibleErrorMessage;
diff --git a/test/less/errors/single-character.less b/test/less/errors/single-character.less
new file mode 100644
index 0000000..c1b0730
--- /dev/null
+++ b/test/less/errors/single-character.less
@@ -0,0 +1 @@
+x
\ No newline at end of file
diff --git a/test/less/errors/single-character.txt b/test/less/errors/single-character.txt
new file mode 100644
index 0000000..b9e49a5
--- /dev/null
+++ b/test/less/errors/single-character.txt
@@ -0,0 +1,2 @@
+ParseError: Unrecognised input. Possibly missing something in {path}single-character.less on line 1, column 2:
+1 x
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list