Fix test fails related to root._.

This commit is contained in:
jdalton
2015-07-01 21:17:28 -07:00
committed by John-David Dalton
parent 7862ae6d36
commit bd98779b3c

View File

@@ -236,6 +236,9 @@
(_.runInContext ? _.runInContext(root) : _)
));
/** Used to restore the `_` reference. */
var oldDash = root._;
/** List of latin-1 supplementary letters to basic latin letters. */
var burredLetters = [
'\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce',
@@ -457,6 +460,7 @@
// Load lodash and expose it to the bad extensions/shims.
lodashBizarro = (lodashBizarro = require(filePath))._ || lodashBizarro['default'] || lodashBizarro;
root._ = oldDash;
// Restore built-in methods.
setProperty(Array, 'isArray', _isArray);
@@ -11545,7 +11549,6 @@
(function() {
test('should return the `lodash` function', 2, function() {
if (!isModularize) {
var oldDash = root._;
strictEqual(_.noConflict(), oldDash);
if (!(isRhino && typeof require == 'function')) {
@@ -18141,8 +18144,7 @@
var acceptFalsey = _.difference(allMethods, rejectFalsey);
test('should accept falsey arguments', 229, function() {
var emptyArrays = _.map(falsey, _.constant([])),
oldDash = root._;
var emptyArrays = _.map(falsey, _.constant([]));
_.each(acceptFalsey, function(methodName) {
var expected = emptyArrays,