summaryrefslogtreecommitdiff
path: root/lib/path.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/path.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/path.js')
-rw-r--r--lib/path.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/path.js b/lib/path.js
index 02cdf541b6..f1acb06b45 100644
--- a/lib/path.js
+++ b/lib/path.js
@@ -1,7 +1,7 @@
'use strict';
-var isWindows = process.platform === 'win32';
-var util = require('util');
+const isWindows = process.platform === 'win32';
+const util = require('util');
// resolves . and .. elements in a path array with directory names there
@@ -33,11 +33,11 @@ function normalizeArray(parts, allowAboveRoot) {
// Regex to split a windows path into three parts: [*, device, slash,
// tail] windows-only
-var splitDeviceRe =
+const splitDeviceRe =
/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
// Regex to split the tail part of the above into [*, dir, basename, ext]
-var splitTailRe =
+const splitTailRe =
/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
var win32 = {};
@@ -378,7 +378,7 @@ win32.delimiter = ';';
// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
-var splitPathRe =
+const splitPathRe =
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
var posix = {};