Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f963a36

Browse filesBrowse files
author
Ben Newman
committed
Use native path.isAbsolute in Node v4.
Part of meteor#6921.
1 parent 36daffc commit f963a36
Copy full SHA for f963a36

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎tools/static-assets/server/mini-files.js

Copy file name to clipboardExpand all lines: tools/static-assets/server/mini-files.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var _ = require("underscore");
22
var os = require("os");
33
var path = require("path");
4+
var assert = require("assert");
45

56
// All of these functions are attached to files.js for the tool;
67
// they live here because we need them in boot.js as well to avoid duplicating
@@ -73,6 +74,8 @@ var convertToStandardLineEndings = function (fileContents) {
7374
// forward slashes)
7475
var wrapPathFunction = function (name, partialPaths) {
7576
var f = path[name];
77+
assert.strictEqual(typeof f, "function");
78+
7679
return function (/* args */) {
7780
if (process.platform === 'win32') {
7881
var args = _.toArray(arguments);
@@ -95,12 +98,11 @@ files.pathResolve = wrapPathFunction("resolve");
9598
files.pathDirname = wrapPathFunction("dirname");
9699
files.pathBasename = wrapPathFunction("basename");
97100
files.pathExtname = wrapPathFunction("extname");
101+
// The path.isAbsolute function is implemented in Node v4.
102+
files.pathIsAbsolute = wrapPathFunction("isAbsolute");
98103
files.pathSep = '/';
99104
files.pathDelimiter = ':';
100105
files.pathOsDelimiter = path.delimiter;
101-
files.pathIsAbsolute = function (path) {
102-
return toPosixPath(path).charAt(0) === '/';
103-
};
104106

105107
files.convertToStandardPath = convertToStandardPath;
106108
files.convertToOSPath = convertToOSPath;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.