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 = {
2121 findScriptFromPartialPath ( path ) {
2222 if ( ! path ) return null // This shouldn't happen, but better safe than sorry
2323
24+ path = path . toLowerCase ( )
25+
2426 const bestMatch = new Array ( 3 )
2527 let maxMatchLength = - 1
2628
@@ -33,7 +35,7 @@ module.exports = {
3335
3436 // Compare characters from the end
3537 while ( i >= 0 && j >= 0 ) {
36- const urlChar = url [ i ]
38+ const urlChar = url [ i ] . toLowerCase ( )
3739 const pathChar = path [ j ]
3840
3941 // 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 () {
6363 it ( 'prefixed with two unknown directories' , testPath ( `prefix1/prefix2/to/${ filename } ` ) )
6464 } )
6565
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+
6672 describe ( 'non-matching paths' , function ( ) {
6773 it ( 'should not match if only part of a directory matches (at boundary)' ,
6874 testPathNoMatch ( `path/o/${ filename } ` ) )
@@ -73,8 +79,6 @@ describe('findScriptFromPartialPath', function () {
7379 it ( 'should not match if only part of a directory matches (root)' , testPathNoMatch ( `o/${ filename } ` ) )
7480
7581 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 ( ) ) )
7882 } )
7983 } )
8084
You can’t perform that action at this time.
0 commit comments