aboutsummaryrefslogtreecommitdiff
path: root/lib/module.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2015-01-21 11:36:59 -0500
committercjihrig <cjihrig@gmail.com>2015-01-21 16:21:31 -0500
commit804e7aa9ab0b34fa88709ef0980b960abca5e059 (patch)
tree4e09207abd54e30bd62459e43e2f9219619a7256 /lib/module.js
parent803883bb1a701da12c285fd735233eed7627eada (diff)
downloadandroid-node-v8-804e7aa9ab0b34fa88709ef0980b960abca5e059.tar.gz
android-node-v8-804e7aa9ab0b34fa88709ef0980b960abca5e059.tar.bz2
android-node-v8-804e7aa9ab0b34fa88709ef0980b960abca5e059.zip
lib: use const to define constants
This commit replaces a number of var statements throughout the lib code with const statements. PR-URL: https://github.com/iojs/io.js/pull/541 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/module.js')
-rw-r--r--lib/module.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/module.js b/lib/module.js
index 0a4195cf7b..07c32b7eee 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -1,11 +1,11 @@
'use strict';
-var NativeModule = require('native_module');
-var util = NativeModule.require('util');
-var runInThisContext = require('vm').runInThisContext;
-var runInNewContext = require('vm').runInNewContext;
-var assert = require('assert').ok;
-var fs = NativeModule.require('fs');
+const NativeModule = require('native_module');
+const util = NativeModule.require('util');
+const runInThisContext = require('vm').runInThisContext;
+const runInNewContext = require('vm').runInNewContext;
+const assert = require('assert').ok;
+const fs = NativeModule.require('fs');
// If obj.hasOwnProperty has been overridden, then calling
@@ -42,13 +42,13 @@ Module.globalPaths = [];
Module.wrapper = NativeModule.wrapper;
Module.wrap = NativeModule.wrap;
-var path = NativeModule.require('path');
+const path = NativeModule.require('path');
Module._debug = util.debuglog('module');
// We use this alias for the preprocessor that filters it out
-var debug = Module._debug;
+const debug = Module._debug;
// given a module name, and a list of paths to test, returns the first
@@ -70,7 +70,7 @@ function statPath(path) {
}
// check if the directory is a package.json dir
-var packageMainCache = {};
+const packageMainCache = {};
function readPackage(requestPath) {
if (hasOwnProperty(packageMainCache, requestPath)) {
@@ -490,7 +490,7 @@ Module.runMain = function() {
};
Module._initPaths = function() {
- var isWindows = process.platform === 'win32';
+ const isWindows = process.platform === 'win32';
if (isWindows) {
var homeDir = process.env.USERPROFILE;