Permalink
Browse files

Simpler way to prevent infinite cycles. Not correct, though

  • Loading branch information...
1 parent dfa280f commit a9773c9899f290e6933dc7b248095193338e7c23 @isaacs isaacs committed Mar 27, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 fstream-npm.js
View
@@ -107,19 +107,23 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
if (entry === ".bin") return false
var shouldBundle = false
- if (this.parent.bundled) {
+ if (this.parent && this.parent.bundled) {
// only bundle if the parent doesn't already have it, and it's
// not a devDependency.
var dd = this.package && this.package.devDependencies
shouldBundle = !dd || !dd.hasOwnProperty(entry)
+ shouldBundle = shouldBundle &&
+ this.parent.bundled.indexOf(entry) === -1
} else {
var bd = this.package && this.package.bundleDependencies
var shouldBundle = bd && bd.indexOf(entry) !== -1
}
if (shouldBundle) {
this.bundled = this.bundled || []
- this.bundled.push(entry)
+ if (this.bundled.indexOf(entry) === -1) {
+ this.bundled.push(entry)
+ }
}
return shouldBundle
}

0 comments on commit a9773c9

Please sign in to comment.