Skip to content

Commit efa78f0

Browse files
bojidaryovchevmbroadst
authored andcommitted
fix(collection): ensure dynamic require of db is wrapped in parentheses
This is a fix for issue webpack/webpack#6191 Needed to surround the require statement with parenthesis to make its priority higher.
1 parent 63b9d62 commit efa78f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/collection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ var mapReduce = function(self, map, reduce, options, callback) {
30013001
if (result.result != null && typeof result.result === 'object') {
30023002
var doc = result.result;
30033003
// Return a collection from another db
3004-
collection = new require('./db')(
3004+
collection = new (require('./db'))(
30053005
doc.db,
30063006
self.s.db.s.topology,
30073007
self.s.db.s.options

0 commit comments

Comments
 (0)