[Pkg-javascript-commits] [ltx] 07/25: fix coding style

Jonas Smedegaard dr at jones.dk
Tue Jan 10 18:21:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit f293e982b69bb73d1a8d38bbd824e326039bae9b
Author: Sonny Piers <sonny at fastmail.net>
Date:   Fri Nov 4 23:23:58 2016 +0100

    fix coding style
---
 lib/parsers/ltx.js | 15 +++++++--------
 test/parse-test.js | 10 +++++-----
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/lib/parsers/ltx.js b/lib/parsers/ltx.js
index d264b66..3ee888b 100644
--- a/lib/parsers/ltx.js
+++ b/lib/parsers/ltx.js
@@ -81,7 +81,6 @@ var SaxLtx = module.exports = function SaxLtx () {
             recordStart = undefined
             state = STATE_IGNORE_COMMENT
           } else if (c === 63 /* ? */) {
-              console.log('?')
             recordStart = undefined
             state = STATE_IGNORE_INSTRUCTION
           } else if (c <= 32 || c === 47 /* / */ || c === 62 /* > */) {
@@ -92,18 +91,18 @@ var SaxLtx = module.exports = function SaxLtx () {
           break
         case STATE_IGNORE_COMMENT:
           if (c === 62 /* > */) {
-            var prev_first = data.charCodeAt(pos-1)
-            var prev_second = data.charCodeAt(pos-2)
-            if (prev_first === 45 /* - */ && prev_second === 45 /* - */) {
-                state = STATE_TEXT
+            var prevFirst = data.charCodeAt(pos - 1)
+            var prevSecond = data.charCodeAt(pos - 2)
+            if (prevFirst === 45 /* - */ && prevSecond === 45 /* - */) {
+              state = STATE_TEXT
             }
           }
           break
         case STATE_IGNORE_INSTRUCTION:
           if (c === 62 /* > */) {
-            var prev = data.charCodeAt(pos-1)
-              if (prev === 63 /* ? */) {
-                state = STATE_TEXT
+            var prev = data.charCodeAt(pos - 1)
+            if (prev === 63 /* ? */) {
+              state = STATE_TEXT
             }
           }
           break
diff --git a/test/parse-test.js b/test/parse-test.js
index ba70825..2d65bed 100644
--- a/test/parse-test.js
+++ b/test/parse-test.js
@@ -169,11 +169,11 @@ parsers.forEach(function (Parser) {
         parser.on('comment', function (s) {
           events.push({ comment: s })
         })
-        parser.write("<?xml version='1.0'?><!-- <foo></foo><bar></bar> --><root></root>");
-          assert.deepEqual(events, [
-              { start: 'root' , attrs: {} },
-              { end: 'root' }
-          ]);
+        parser.write("<?xml version='1.0'?><!-- <foo></foo><bar></bar> --><root></root>")
+        assert.deepEqual(events, [
+          { start: 'root', attrs: {} },
+          { end: 'root' }
+        ])
       }
     }
   }).export(module)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list