mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 20:37:48 +00:00
Minor test cleanup. [ci skip]
This commit is contained in:
@@ -22,8 +22,6 @@
|
|||||||
var setProperty = (function() {
|
var setProperty = (function() {
|
||||||
var _defineProperty = Object.defineProperty;
|
var _defineProperty = Object.defineProperty;
|
||||||
return function(object, key, value) {
|
return function(object, key, value) {
|
||||||
// avoid a bug where overwriting non-enumerable built-ins makes them enumerable
|
|
||||||
// https://code.google.com/p/v8/issues/detail?id=1623
|
|
||||||
try {
|
try {
|
||||||
_defineProperty(object, key, {
|
_defineProperty(object, key, {
|
||||||
'configurable': true,
|
'configurable': true,
|
||||||
@@ -38,9 +36,6 @@
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
function addBizarroMethods() {
|
function addBizarroMethods() {
|
||||||
// add extensions
|
|
||||||
Function.prototype._method = function() {};
|
|
||||||
|
|
||||||
// allow bypassing native checks
|
// allow bypassing native checks
|
||||||
setProperty(Function.prototype, 'toString', (function() {
|
setProperty(Function.prototype, 'toString', (function() {
|
||||||
function fnToString() {
|
function fnToString() {
|
||||||
@@ -54,6 +49,9 @@
|
|||||||
return fnToString;
|
return fnToString;
|
||||||
}()));
|
}()));
|
||||||
|
|
||||||
|
// add extensions
|
||||||
|
Function.prototype._method = function() {};
|
||||||
|
|
||||||
// set bad shims
|
// set bad shims
|
||||||
setProperty(Array, '_isArray', Array.isArray);
|
setProperty(Array, '_isArray', Array.isArray);
|
||||||
setProperty(Array, 'isArray', function() {});
|
setProperty(Array, 'isArray', function() {});
|
||||||
|
|||||||
@@ -208,14 +208,16 @@
|
|||||||
/**
|
/**
|
||||||
* Sets a non-enumerable property value on `object`.
|
* Sets a non-enumerable property value on `object`.
|
||||||
*
|
*
|
||||||
|
* Note: This function is used to avoid a bug in older versions of V8 where
|
||||||
|
* overwriting non-enumerable built-ins makes them enumerable.
|
||||||
|
* See https://code.google.com/p/v8/issues/detail?id=1623
|
||||||
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object augment.
|
* @param {Object} object The object augment.
|
||||||
* @param {string} key The name of the property to set.
|
* @param {string} key The name of the property to set.
|
||||||
* @param {*} value The property value.
|
* @param {*} value The property value.
|
||||||
*/
|
*/
|
||||||
function setProperty(object, key, value) {
|
function setProperty(object, key, value) {
|
||||||
// avoid a bug where overwriting non-enumerable built-ins makes them enumerable
|
|
||||||
// https://code.google.com/p/v8/issues/detail?id=1623
|
|
||||||
try {
|
try {
|
||||||
defineProperty(object, key, {
|
defineProperty(object, key, {
|
||||||
'configurable': true,
|
'configurable': true,
|
||||||
@@ -273,7 +275,7 @@
|
|||||||
// load ES6 Set shim
|
// load ES6 Set shim
|
||||||
require('./asset/set');
|
require('./asset/set');
|
||||||
|
|
||||||
// expose `baseEach`
|
// expose `baseEach` for better code coverage
|
||||||
if (isModularize && !isNpm) {
|
if (isModularize && !isNpm) {
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
_._baseEach = require(path.join(path.dirname(filePath), 'internals', 'baseEach.js'));
|
_._baseEach = require(path.join(path.dirname(filePath), 'internals', 'baseEach.js'));
|
||||||
|
|||||||
Reference in New Issue
Block a user