Exclude Lo-Dash methods from getVars results and correct varMap check.

Former-commit-id: 793bc5294ada8f765928aa9e78e83bc535eb44df
This commit is contained in:
John-David Dalton
2013-06-16 00:59:04 -07:00
parent 9c0f4822bc
commit 545cc1074c

View File

@@ -1005,7 +1005,7 @@
} }
/** /**
* Gets all variables defined outside of Lo-Dash methods. * Creates a sorted array of all variables defined outside of Lo-Dash methods.
* *
* @private * @private
* @param {String} source The source to process. * @param {String} source The source to process.
@@ -1025,7 +1025,7 @@
result.push(varA || varB || varC); result.push(varA || varB || varC);
}); });
return _.uniq(result).sort(); return _.without.apply(_, [_.uniq(result)].concat(allMethods)).sort();
} }
/** /**
@@ -3477,7 +3477,7 @@
}); });
var varName = varNames[0]; var varName = varNames[0];
if (varMap[varName] < 2) { if (!varMap[varName]) {
source = removeVar(source, varName); source = removeVar(source, varName);
} }
varNames.shift(); varNames.shift();