@@ -125,11 +125,6 @@ function tryExtensions(p, exts) {
125
125
}
126
126
127
127
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
-
133
128
Module . _findPath = function ( request , paths ) {
134
129
var exts = Object . keys ( Module . _extensions ) ;
135
130
@@ -174,8 +169,6 @@ Module._findPath = function(request, paths) {
174
169
}
175
170
176
171
if ( filename ) {
177
- // Warn once if '.' resolved outside the module dir
178
- if ( request === '.' && i > 0 ) noopDeprecateRequireDot ( ) ;
179
172
Module . _pathCache [ cacheKey ] = filename ;
180
173
return filename ;
181
174
}
@@ -212,23 +205,13 @@ Module._resolveLookupPaths = function(request, parent) {
212
205
}
213
206
214
207
var start = request . substring ( 0 , 2 ) ;
215
- if ( start !== './' && start !== '..' ) {
208
+ if ( start !== '.' && start !== '. /' && start !== '..' ) {
216
209
var paths = modulePaths ;
217
210
if ( parent ) {
218
211
if ( ! parent . paths ) parent . paths = [ ] ;
219
212
paths = parent . paths . concat ( paths ) ;
220
213
}
221
214
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
-
232
215
return [ request , paths ] ;
233
216
}
234
217
0 commit comments