File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Filter options
tools/static-assets/server Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Original file line number Diff line number Diff line change 1
1
var _ = require ( "underscore" ) ;
2
2
var os = require ( "os" ) ;
3
3
var path = require ( "path" ) ;
4
+ var assert = require ( "assert" ) ;
4
5
5
6
// All of these functions are attached to files.js for the tool;
6
7
// they live here because we need them in boot.js as well to avoid duplicating
@@ -73,6 +74,8 @@ var convertToStandardLineEndings = function (fileContents) {
73
74
// forward slashes)
74
75
var wrapPathFunction = function ( name , partialPaths ) {
75
76
var f = path [ name ] ;
77
+ assert . strictEqual ( typeof f , "function" ) ;
78
+
76
79
return function ( /* args */ ) {
77
80
if ( process . platform === 'win32' ) {
78
81
var args = _ . toArray ( arguments ) ;
@@ -95,12 +98,11 @@ files.pathResolve = wrapPathFunction("resolve");
95
98
files . pathDirname = wrapPathFunction ( "dirname" ) ;
96
99
files . pathBasename = wrapPathFunction ( "basename" ) ;
97
100
files . pathExtname = wrapPathFunction ( "extname" ) ;
101
+ // The path.isAbsolute function is implemented in Node v4.
102
+ files . pathIsAbsolute = wrapPathFunction ( "isAbsolute" ) ;
98
103
files . pathSep = '/' ;
99
104
files . pathDelimiter = ':' ;
100
105
files . pathOsDelimiter = path . delimiter ;
101
- files . pathIsAbsolute = function ( path ) {
102
- return toPosixPath ( path ) . charAt ( 0 ) === '/' ;
103
- } ;
104
106
105
107
files . convertToStandardPath = convertToStandardPath ;
106
108
files . convertToOSPath = convertToOSPath ;
You can’t perform that action at this time.
0 commit comments