mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Fix test fails related to root._.
This commit is contained in:
committed by
John-David Dalton
parent
7862ae6d36
commit
bd98779b3c
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user