Require tighter collision checking
This commit is contained in:
parent
49c3376db0
commit
16c892037b
1 changed files with 2 additions and 1 deletions
|
|
@ -73,7 +73,8 @@ module.exports = function(input, output, options) {
|
|||
|
||||
function fixCollisions(code) {
|
||||
for (var variable in usedVariables) {
|
||||
var collision = new RegExp("([^\\.])" + variable + "\\b(?![\"'`])", "g")
|
||||
var collision = new RegExp("([^\\.])\\b" + variable + "\\b(?![\"'`])", "g")
|
||||
// var collision = new RegExp("([^\\.])" + variable + "\\b(?![\"'`])", "g")
|
||||
var exported = new RegExp("module\\.exports\\s*=\\s*" + variable)
|
||||
if (collision.test(code) && !exported.test(code) && !globals[variable.match(/[^\.]+/)]) {
|
||||
var fixed = variable + usedVariables[variable]++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue