From f3bff93e21af43ba353f8dea94b6dccba631391e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 19 Jun 2017 17:55:45 +0200 Subject: [PATCH] tools: change var to const in ./doc/preprocess PR-URL: https://github.com/nodejs/node/pull/13732 Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann --- tools/doc/preprocess.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/doc/preprocess.js b/tools/doc/preprocess.js index 55d90996f71c13..01340d40602ba7 100644 --- a/tools/doc/preprocess.js +++ b/tools/doc/preprocess.js @@ -2,11 +2,11 @@ module.exports = preprocess; -var path = require('path'); -var fs = require('fs'); +const path = require('path'); +const fs = require('fs'); -var includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi; -var includeData = {}; +const includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi; +const includeData = {}; function preprocess(inputFile, input, cb) { input = stripComments(input); @@ -22,7 +22,7 @@ function stripComments(input) { } function processIncludes(inputFile, input, cb) { - var includes = input.match(includeExpr); + const includes = input.match(includeExpr); if (includes === null) return cb(null, input); var errState = null; console.error(includes); @@ -40,7 +40,7 @@ function processIncludes(inputFile, input, cb) { } } - var fullFname = path.resolve(path.dirname(inputFile), fname); + const fullFname = path.resolve(path.dirname(inputFile), fname); fs.readFile(fullFname, 'utf8', function(er, inc) { if (errState) return; if (er) return cb(errState = er);