Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(file-list): ensure patterns are comparable #2277

Merged
merged 1 commit into from
Jul 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dignifiedquire for my own edification, can you give an example of a plugin doing this? Specifically, is karm-jspm doing this?

// 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