mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Correct support.nonEnumArgs.
Former-commit-id: 69b09827404bae997846daa681d96d8c9264af78
This commit is contained in:
4
build.js
4
build.js
@@ -2670,11 +2670,11 @@
|
||||
}
|
||||
if (!/support\.(?:enumPrototypes|nonEnumShadows|ownLast)\b/.test(source)) {
|
||||
// remove code used to resolve unneeded `support` properties
|
||||
source = source.replace(/^ *\(function[\s\S]+?\n(( *)var ctor *= *function[\s\S]+?\n *for.+\n)([\s\S]+?)}\(1\)\);\n/m, function(match, setup, indent, body) {
|
||||
source = source.replace(/^ *\(function[\s\S]+?\n(( *)var ctor *= *function[\s\S]+?(?:\n *for.+)+\n)([\s\S]+?)}\(1\)\);\n/m, function(match, setup, indent, body) {
|
||||
if (/support\.spliceObjects\b/.test(match)) {
|
||||
return match.replace(setup, indent + "var object = { '0': 1, 'length': 1 };\n");
|
||||
} else if (/support\.nonEnumArgs\b/.test(match)) {
|
||||
return match.replace(setup, '');
|
||||
return match.replace(setup, indent + 'for (var prop in arguments) { }\n');
|
||||
}
|
||||
return body.replace(RegExp('^' + indent, 'gm'), indent.slice(0, -2));
|
||||
});
|
||||
|
||||
@@ -262,6 +262,7 @@
|
||||
|
||||
ctor.prototype = { 'valueOf': 1, 'y': 1 };
|
||||
for (var prop in new ctor) { props.push(prop); }
|
||||
for (prop in arguments) { }
|
||||
|
||||
/**
|
||||
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5).
|
||||
@@ -324,7 +325,7 @@
|
||||
* @memberOf _.support
|
||||
* @type Boolean
|
||||
*/
|
||||
support.nonEnumArgs = prop == '0';
|
||||
support.nonEnumArgs = prop != 0;
|
||||
|
||||
/**
|
||||
* Detect if properties shadowing those on `Object.prototype` are non-enumerable.
|
||||
|
||||
Reference in New Issue
Block a user