@@ -125,11 +125,6 @@ function tryExtensions(p, exts) {
125125}
126126
127127
128- const noopDeprecateRequireDot = util . deprecate ( function ( ) { } ,
129- "warning: require('.') resolved outside the package directory. " +
130- "This functionality is deprecated and will be removed soon." ) ;
131-
132-
133128Module . _findPath = function ( request , paths ) {
134129 var exts = Object . keys ( Module . _extensions ) ;
135130
@@ -174,8 +169,6 @@ Module._findPath = function(request, paths) {
174169 }
175170
176171 if ( filename ) {
177- // Warn once if '.' resolved outside the module dir
178- if ( request === '.' && i > 0 ) noopDeprecateRequireDot ( ) ;
179172 Module . _pathCache [ cacheKey ] = filename ;
180173 return filename ;
181174 }
@@ -212,23 +205,13 @@ Module._resolveLookupPaths = function(request, parent) {
212205 }
213206
214207 var start = request . substring ( 0 , 2 ) ;
215- if ( start !== './' && start !== '..' ) {
208+ if ( start !== '.' && start !== '. /' && start !== '..' ) {
216209 var paths = modulePaths ;
217210 if ( parent ) {
218211 if ( ! parent . paths ) parent . paths = [ ] ;
219212 paths = parent . paths . concat ( paths ) ;
220213 }
221214
222- // Maintain backwards compat with certain broken uses of require('.')
223- // by putting the module's directory in front of the lookup paths.
224- if ( request === '.' ) {
225- if ( parent && parent . filename ) {
226- paths . splice ( 0 , 0 , path . dirname ( parent . filename ) ) ;
227- } else {
228- paths . splice ( 0 , 0 , path . resolve ( request ) ) ;
229- }
230- }
231-
232215 return [ request , paths ] ;
233216 }
234217
0 commit comments