From 8eb2ac659de59690552c1436e28400cd3a561a27 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Sat, 13 Dec 2014 20:35:05 +0000 Subject: [PATCH] Removes unnecessary variable declarations. --- lib/text/comments-processor.js | 4 ++-- lib/text/escape-store.js | 4 ++-- lib/text/expressions-processor.js | 4 ++-- lib/text/free-text-processor.js | 4 ++-- lib/text/urls-processor.js | 4 ++-- lib/utils/chunker.js | 4 ++-- lib/utils/quote-scanner.js | 4 ++-- lib/utils/splitter.js | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/text/comments-processor.js b/lib/text/comments-processor.js index 4d4f4e65..dd0b07c0 100644 --- a/lib/text/comments-processor.js +++ b/lib/text/comments-processor.js @@ -7,7 +7,7 @@ var COMMENT_SUFFIX = '*/'; var lineBreak = require('os').EOL; -var CommentsProcessor = function CommentsProcessor(context, keepSpecialComments, keepBreaks, saveWaypoints) { +function CommentsProcessor(context, keepSpecialComments, keepBreaks, saveWaypoints) { this.comments = new EscapeStore('COMMENT'); this.specialComments = new EscapeStore('COMMENT_SPECIAL'); @@ -16,7 +16,7 @@ var CommentsProcessor = function CommentsProcessor(context, keepSpecialComments, this.keepOne = keepSpecialComments == '1' || keepSpecialComments === 1; this.keepBreaks = keepBreaks; this.saveWaypoints = saveWaypoints; -}; +} function quoteScannerFor(data) { var quoteMap = []; diff --git a/lib/text/escape-store.js b/lib/text/escape-store.js index 4da28d05..8598d732 100644 --- a/lib/text/escape-store.js +++ b/lib/text/escape-store.js @@ -1,12 +1,12 @@ var placeholderBrace = '__'; -var EscapeStore = function EscapeStore(placeholderRoot) { +function EscapeStore(placeholderRoot) { this.placeholderRoot = 'ESCAPED_' + placeholderRoot + '_CLEAN_CSS'; this.placeholderToData = {}; this.dataToPlaceholder = {}; this.count = 0; this.restoreMatcher = new RegExp(this.placeholderRoot + '(\\d+)'); -}; +} EscapeStore.prototype._nextPlaceholder = function (metadata) { return { diff --git a/lib/text/expressions-processor.js b/lib/text/expressions-processor.js index 5a5139ff..3e22ced8 100644 --- a/lib/text/expressions-processor.js +++ b/lib/text/expressions-processor.js @@ -46,10 +46,10 @@ function findEnd(data, start) { return end; } -var ExpressionsProcessor = function ExpressionsProcessor(saveWaypoints) { +function ExpressionsProcessor(saveWaypoints) { this.expressions = new EscapeStore('EXPRESSION'); this.saveWaypoints = saveWaypoints; -}; +} ExpressionsProcessor.prototype.escape = function (data) { var nextStart = 0; diff --git a/lib/text/free-text-processor.js b/lib/text/free-text-processor.js index 28740ee7..242be400 100644 --- a/lib/text/free-text-processor.js +++ b/lib/text/free-text-processor.js @@ -3,10 +3,10 @@ var QuoteScanner = require('../utils/quote-scanner'); var lineBreak = require('os').EOL; -var FreeTextProcessor = function FreeTextProcessor(saveWaypoints) { +function FreeTextProcessor(saveWaypoints) { this.matches = new EscapeStore('FREE_TEXT'); this.saveWaypoints = saveWaypoints; -}; +} // Strip content tags by replacing them by the a special // marker for further restoring. It's done via string scanning diff --git a/lib/text/urls-processor.js b/lib/text/urls-processor.js index 3c8b3729..e1ab00d1 100644 --- a/lib/text/urls-processor.js +++ b/lib/text/urls-processor.js @@ -4,11 +4,11 @@ var URL_PREFIX = 'url('; var URL_SUFFIX = ')'; var lineBreak = require('os').EOL; -var UrlsProcessor = function UrlsProcessor(context, saveWaypoints) { +function UrlsProcessor(context, saveWaypoints) { this.urls = new EscapeStore('URL'); this.context = context; this.saveWaypoints = saveWaypoints; -}; +} // Strip urls by replacing them by a special // marker for further restoring. It's done via string scanning diff --git a/lib/utils/chunker.js b/lib/utils/chunker.js index 369e1500..438b8ba3 100644 --- a/lib/utils/chunker.js +++ b/lib/utils/chunker.js @@ -1,5 +1,5 @@ // Divides `data` into chunks of `chunkSize` for faster processing -var Chunker = function Chunker(data, breakString, chunkSize) { +function Chunker(data, breakString, chunkSize) { this.chunks = []; for (var cursor = 0, dataSize = data.length; cursor < dataSize;) { @@ -15,7 +15,7 @@ var Chunker = function Chunker(data, breakString, chunkSize) { this.chunks.push(data.substring(cursor, nextCursor + breakString.length)); cursor = nextCursor + breakString.length; } -}; +} Chunker.prototype.isEmpty = function () { return this.chunks.length === 0; diff --git a/lib/utils/quote-scanner.js b/lib/utils/quote-scanner.js index 8981daca..9e2c8dcd 100644 --- a/lib/utils/quote-scanner.js +++ b/lib/utils/quote-scanner.js @@ -1,6 +1,6 @@ -var QuoteScanner = function QuoteScanner(data) { +function QuoteScanner(data) { this.data = data; -}; +} var findQuoteEnd = function (data, matched, cursor, oldCursor) { var commentStartMark = '/*'; diff --git a/lib/utils/splitter.js b/lib/utils/splitter.js index 8823d729..839c6c6e 100644 --- a/lib/utils/splitter.js +++ b/lib/utils/splitter.js @@ -1,6 +1,6 @@ -var Splitter = function Splitter(separator) { +function Splitter(separator) { this.separator = separator; -}; +} Splitter.prototype.split = function (value) { if (value.indexOf(this.separator) === -1) -- 2.34.1