mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-13 20:37:48 +00:00
Track the dependents of root in build.js.
Former-commit-id: be19143f8741be40419f83b2919c44c2d19bc9ac
This commit is contained in:
18
build.js
18
build.js
@@ -298,7 +298,7 @@
|
|||||||
'createObject': ['reNative'],
|
'createObject': ['reNative'],
|
||||||
'debounce': ['reNative'],
|
'debounce': ['reNative'],
|
||||||
'defaults': ['defaultsIteratorOptions'],
|
'defaults': ['defaultsIteratorOptions'],
|
||||||
'defer': ['objectTypes', 'reNative'],
|
'defer': ['objectTypes', 'reNative', 'root'],
|
||||||
'difference': ['largeArraySize'],
|
'difference': ['largeArraySize'],
|
||||||
'escape': ['reUnescapedHtml'],
|
'escape': ['reUnescapedHtml'],
|
||||||
'escapeHtmlChar': ['htmlEscapes'],
|
'escapeHtmlChar': ['htmlEscapes'],
|
||||||
@@ -310,17 +310,20 @@
|
|||||||
'htmlUnescapes': ['htmlEscapes'],
|
'htmlUnescapes': ['htmlEscapes'],
|
||||||
'intersection': ['largeArraySize'],
|
'intersection': ['largeArraySize'],
|
||||||
'isArray': ['reNative'],
|
'isArray': ['reNative'],
|
||||||
|
'isFinite': ['root'],
|
||||||
'isObject': ['objectTypes'],
|
'isObject': ['objectTypes'],
|
||||||
'isPlainObject': ['reNative'],
|
'isPlainObject': ['reNative'],
|
||||||
'isRegExp': ['objectTypes'],
|
'isRegExp': ['objectTypes'],
|
||||||
'keys': ['reNative'],
|
'keys': ['reNative'],
|
||||||
'memoize': ['keyPrefix'],
|
'memoize': ['keyPrefix'],
|
||||||
|
'parseInt': ['root'],
|
||||||
'reEscapedHtml': ['htmlUnescapes'],
|
'reEscapedHtml': ['htmlUnescapes'],
|
||||||
'releaseArray': ['arrayPool', 'maxPoolSize'],
|
'releaseArray': ['arrayPool', 'maxPoolSize'],
|
||||||
'releaseObject': ['maxPoolSize', 'objectPool'],
|
'releaseObject': ['maxPoolSize', 'objectPool'],
|
||||||
'reUnescapedHtml': ['htmlEscapes'],
|
'reUnescapedHtml': ['htmlEscapes'],
|
||||||
|
'root': ['objectTypes'],
|
||||||
'setBindData': ['reNative'],
|
'setBindData': ['reNative'],
|
||||||
'support': ['reNative'],
|
'support': ['reNative', 'root'],
|
||||||
'template': ['reInterpolate'],
|
'template': ['reInterpolate'],
|
||||||
'templateSettings': ['reInterpolate'],
|
'templateSettings': ['reInterpolate'],
|
||||||
'unescape': ['reEscapedHtml'],
|
'unescape': ['reEscapedHtml'],
|
||||||
@@ -2880,8 +2883,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (isModularize) {
|
if (isModularize) {
|
||||||
|
_.forOwn(varDepMap, function(deps, funcName) {
|
||||||
|
_.pull(deps, 'root');
|
||||||
|
});
|
||||||
|
|
||||||
funcDepMap.lodash.push('support', 'baseEach', 'forOwn', 'mixin');
|
funcDepMap.lodash.push('support', 'baseEach', 'forOwn', 'mixin');
|
||||||
_.pull(funcDepMap.mixin, 'lodash');
|
_.pull(funcDepMap.mixin, 'lodash');
|
||||||
|
delete varDepMap.root;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
funcDepMap.chain.push('wrapperChain');
|
funcDepMap.chain.push('wrapperChain');
|
||||||
@@ -4203,9 +4211,9 @@
|
|||||||
.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove `freeGlobal` and replace `context` with `global`
|
// replace `root` with the appropriate global object for the specified `exports` option
|
||||||
if (isNode) {
|
if (isAMD || isNode) {
|
||||||
source = source.replace(/\bcontext(?=\.)/g, 'global');
|
source = source.replace(/\bcontext(?=\.)/g, isAMD ? 'window' : 'global');
|
||||||
}
|
}
|
||||||
source = removeRunInContext(source);
|
source = removeRunInContext(source);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user