Skip to content

Commit

Permalink
fix(file-list): ensure patterns are comparable
Browse files Browse the repository at this point in the history
Thanks to @m-a-r-c-e-l-i-n-o for pointing me in the right direction
Fixes #2194
  • Loading branch information
dignifiedquire committed Jul 25, 2016
1 parent 9622f87 commit 4d1bf3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var File = require('./file')
var Url = require('./url')
var helper = require('./helper')
var log = require('./logger').create('watcher')
var createPatternObject = require('./config').createPatternObject

// Constants
// ---------
Expand Down Expand Up @@ -230,6 +231,13 @@ Object.defineProperty(List.prototype, 'files', {
var lookup = {}
var included = {}
this._patterns.forEach(function (p) {
// This needs to be here sadly, as plugins are modifiying
// the _patterns directly resulting in elements not being
// instantiated properly
if (p.constructor.name !== 'Pattern') {
p = createPatternObject(p)
}

var bucket = expandPattern(p)
bucket.forEach(function (file) {
var other = lookup[file.path]
Expand Down

0 comments on commit 4d1bf3e

Please sign in to comment.