Skip to content

Commit 4d1bf3e

Browse files
fix(file-list): ensure patterns are comparable
Thanks to @m-a-r-c-e-l-i-n-o for pointing me in the right direction Fixes #2194
1 parent 9622f87 commit 4d1bf3e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/file-list.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var File = require('./file')
2020
var Url = require('./url')
2121
var helper = require('./helper')
2222
var log = require('./logger').create('watcher')
23+
var createPatternObject = require('./config').createPatternObject
2324

2425
// Constants
2526
// ---------
@@ -230,6 +231,13 @@ Object.defineProperty(List.prototype, 'files', {
230231
var lookup = {}
231232
var included = {}
232233
this._patterns.forEach(function (p) {
234+
// This needs to be here sadly, as plugins are modifiying
235+
// the _patterns directly resulting in elements not being
236+
// instantiated properly
237+
if (p.constructor.name !== 'Pattern') {
238+
p = createPatternObject(p)
239+
}
240+
233241
var bucket = expandPattern(p)
234242
bucket.forEach(function (file) {
235243
var other = lookup[file.path]

0 commit comments

Comments
 (0)