File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
src/debugger/devtools_client
test/debugger/devtools_client Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ module.exports = {
21
21
findScriptFromPartialPath ( path ) {
22
22
if ( ! path ) return null // This shouldn't happen, but better safe than sorry
23
23
24
+ path = path . toLowerCase ( )
25
+
24
26
const bestMatch = new Array ( 3 )
25
27
let maxMatchLength = - 1
26
28
@@ -33,7 +35,7 @@ module.exports = {
33
35
34
36
// Compare characters from the end
35
37
while ( i >= 0 && j >= 0 ) {
36
- const urlChar = url [ i ]
38
+ const urlChar = url [ i ] . toLowerCase ( )
37
39
const pathChar = path [ j ]
38
40
39
41
// Check if both characters is a path boundary
Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ describe('findScriptFromPartialPath', function () {
63
63
it ( 'prefixed with two unknown directories' , testPath ( `prefix1/prefix2/to/${ filename } ` ) )
64
64
} )
65
65
66
+ describe ( 'case insensitive' , function ( ) {
67
+ it ( 'should match if the path is in lowercase' , testPath ( filename . toLowerCase ( ) ) )
68
+
69
+ it ( 'should match if the path is in uppercase' , testPath ( filename . toUpperCase ( ) ) )
70
+ } )
71
+
66
72
describe ( 'non-matching paths' , function ( ) {
67
73
it ( 'should not match if only part of a directory matches (at boundary)' ,
68
74
testPathNoMatch ( `path/o/${ filename } ` ) )
@@ -73,8 +79,6 @@ describe('findScriptFromPartialPath', function () {
73
79
it ( 'should not match if only part of a directory matches (root)' , testPathNoMatch ( `o/${ filename } ` ) )
74
80
75
81
it ( 'should not match if only part of a file matches' , testPathNoMatch ( filename . slice ( 1 ) ) )
76
-
77
- it ( 'should not match if only difference is the letter casing' , testPathNoMatch ( filename . toUpperCase ( ) ) )
78
82
} )
79
83
} )
80
84
You can’t perform that action at this time.
0 commit comments