mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Make the custom build message work with -rc.1 and fix build.
Former-commit-id: 96f31fff906fa978a0d10fad90d9322c761e1d26
This commit is contained in:
23
build.js
23
build.js
@@ -263,7 +263,7 @@
|
|||||||
* @returns {String} Returns the modified source.
|
* @returns {String} Returns the modified source.
|
||||||
*/
|
*/
|
||||||
function addCommandsToHeader(source, commands) {
|
function addCommandsToHeader(source, commands) {
|
||||||
return source.replace(/(\/\*!\n)( \*)?( *Lo-Dash [0-9.]+)(.*)/, function() {
|
return source.replace(/(\/\*!\n)( \*)?( *Lo-Dash [\w.-]+)(.*)/, function() {
|
||||||
// convert unmatched groups to empty strings
|
// convert unmatched groups to empty strings
|
||||||
var parts = _.map(slice.call(arguments, 1), function(part) {
|
var parts = _.map(slice.call(arguments, 1), function(part) {
|
||||||
return part || '';
|
return part || '';
|
||||||
@@ -646,8 +646,9 @@
|
|||||||
*/
|
*/
|
||||||
function removeCreateFunction(source) {
|
function removeCreateFunction(source) {
|
||||||
source = removeVar(source, 'isFirefox');
|
source = removeVar(source, 'isFirefox');
|
||||||
source = removeFunction(source, 'createFunction');
|
return removeFunction(source, 'createFunction')
|
||||||
return source.replace(/(?:\s*\/\/.*)*\s*if *\(isIeOpera[^}]+}\n/, '');
|
.replace(/createFunction/g, 'Function')
|
||||||
|
.replace(/(?:\s*\/\/.*)*\s*if *\(isIeOpera[^}]+}\n/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1556,7 +1557,7 @@
|
|||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (isLegacy) {
|
if (isLegacy) {
|
||||||
_.each(['isBindFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) {
|
_.each(['isBindFast', 'isV8', 'nativeBind', 'nativeIsArray', 'nativeKeys', 'reNative'], function(varName) {
|
||||||
source = removeVar(source, varName);
|
source = removeVar(source, varName);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1588,9 +1589,8 @@
|
|||||||
|
|
||||||
source = removeIsArgumentsFallback(source);
|
source = removeIsArgumentsFallback(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
source = removeVar(source, 'reNative');
|
|
||||||
source = removeFromCreateIterator(source, 'nativeKeys');
|
source = removeFromCreateIterator(source, 'nativeKeys');
|
||||||
|
source = removeCreateFunction(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
@@ -1691,7 +1691,7 @@
|
|||||||
|
|
||||||
// remove `hasDontEnumBug`, `iteratesOwnLast`, and `noArgsEnum` declarations and assignments
|
// remove `hasDontEnumBug`, `iteratesOwnLast`, and `noArgsEnum` declarations and assignments
|
||||||
source = source
|
source = source
|
||||||
.replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/, '')
|
.replace(/^ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/m, '')
|
||||||
.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum).+\n/g, '');
|
.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum).+\n/g, '');
|
||||||
|
|
||||||
// remove `iteratesOwnLast` from `shimIsPlainObject`
|
// remove `iteratesOwnLast` from `shimIsPlainObject`
|
||||||
@@ -1709,11 +1709,6 @@
|
|||||||
return match.replace(/noCharByIndex[^:]+:/, '');
|
return match.replace(/noCharByIndex[^:]+:/, '');
|
||||||
});
|
});
|
||||||
|
|
||||||
// replace `createFunction` with `Function` in `_.template`
|
|
||||||
source = source.replace(matchFunction(source, 'template'), function(match) {
|
|
||||||
return match.replace(/createFunction/g, 'Function');
|
|
||||||
});
|
|
||||||
|
|
||||||
source = removeVar(source, 'iteratorTemplate');
|
source = removeVar(source, 'iteratorTemplate');
|
||||||
source = removeCreateFunction(source);
|
source = removeCreateFunction(source);
|
||||||
source = removeNoArgsClass(source);
|
source = removeNoArgsClass(source);
|
||||||
@@ -1868,11 +1863,11 @@
|
|||||||
source = removeFunction(source, 'createIterator');
|
source = removeFunction(source, 'createIterator');
|
||||||
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var noArgsEnum;|.+?noArgsEnum *=.+/g, '');
|
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var noArgsEnum;|.+?noArgsEnum *=.+/g, '');
|
||||||
}
|
}
|
||||||
if (isRemoved(source, 'createIterator', 'bind')) {
|
if (isRemoved(source, 'createIterator', 'bind', 'keys', 'template')) {
|
||||||
source = removeVar(source, 'isBindFast');
|
source = removeVar(source, 'isBindFast');
|
||||||
source = removeVar(source, 'nativeBind');
|
source = removeVar(source, 'nativeBind');
|
||||||
}
|
}
|
||||||
if (isRemoved(source, 'createIterator', 'bind', 'isArray', 'isPlainObject', 'keys')) {
|
if (isRemoved(source, 'createIterator', 'bind', 'isArray', 'isPlainObject', 'keys', 'template')) {
|
||||||
source = removeVar(source, 'reNative');
|
source = removeVar(source, 'reNative');
|
||||||
}
|
}
|
||||||
if (isRemoved(source, 'createIterator', 'isEqual')) {
|
if (isRemoved(source, 'createIterator', 'isEqual')) {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
stringClass = '[object String]';
|
stringClass = '[object String]';
|
||||||
|
|
||||||
/** Detect various environments */
|
/** Detect various environments */
|
||||||
var isFirefox = !/1/.test(function(){1}),
|
var isFirefox = !/1/.test(Function('1')),
|
||||||
isIeOpera = !!window.attachEvent,
|
isIeOpera = !!window.attachEvent,
|
||||||
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
|
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user