From 16c892037b0cc2a04b8f9e69087bf4ee6c3bcb8f Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Fri, 29 Jul 2016 23:52:22 -0700 Subject: [PATCH] Require tighter collision checking --- bundler/bundle.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundler/bundle.js b/bundler/bundle.js index 425ea9cc..0656d05d 100644 --- a/bundler/bundle.js +++ b/bundler/bundle.js @@ -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]++