|
162 | 162 |
|
163 | 163 | function ctor() { this.x = 1; }
|
164 | 164 | ctor.prototype = { 'valueOf': 1, 'y': 1 };
|
165 |
| - |
166 | 165 | for (var prop in new ctor) { props.push(prop); }
|
167 | 166 | for (prop in arguments) { noArgsEnum = !prop; }
|
168 | 167 |
|
|
417 | 416 | ' } else {' +
|
418 | 417 | ' <% } %>' +
|
419 | 418 |
|
| 419 | + // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 |
| 420 | + // (if the prototype or a property on the prototype has been set) |
| 421 | + // incorrectly sets a function's `prototype` property [[Enumerable]] |
| 422 | + // value to `true`. Because of this Lo-Dash standardizes on skipping |
| 423 | + // the the `prototype` property of functions regardless of its |
| 424 | + // [[Enumerable]] value. |
420 | 425 | ' <% if (!hasDontEnumBug) { %>\n' +
|
421 | 426 | ' var skipProto = typeof iteratee == \'function\' && \n' +
|
422 | 427 | ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' +
|
|
440 | 445 | ' <% } else { %>\n' +
|
441 | 446 | ' <%= objectBranch.beforeLoop %>;\n' +
|
442 | 447 | ' for (index in iteratee) {' +
|
443 |
| - ' <% if (hasDontEnumBug) { %>\n' + |
444 |
| - ' <% if (useHas) { %>if (hasOwnProperty.call(iteratee, index)) {\n <% } %>' + |
| 448 | + ' <% if (!hasDontEnumBug || useHas) { %>\n if (<%' + |
| 449 | + ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + |
| 450 | + ' if (!hasDontEnumBug && useHas) { %> && <% }' + |
| 451 | + ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' + |
| 452 | + ' %>) {' + |
| 453 | + ' <% } %>\n' + |
445 | 454 | ' value = iteratee[index];\n' +
|
446 | 455 | ' <%= objectBranch.inLoop %>;\n' +
|
447 |
| - ' <% if (useHas) { %>}<% } %>' + |
448 |
| - |
449 |
| - // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 |
450 |
| - // (if the prototype or a property on the prototype has been set) |
451 |
| - // incorrectly sets a function's `prototype` property [[Enumerable]] |
452 |
| - // value to `true`. Because of this Lo-Dash standardizes on skipping |
453 |
| - // the the `prototype` property of functions regardless of its |
454 |
| - // [[Enumerable]] value. |
455 |
| - ' <% } else { %>\n' + |
456 |
| - ' if (!(skipProto && index == \'prototype\')<% if (useHas) { %> &&\n' + |
457 |
| - ' hasOwnProperty.call(iteratee, index)<% } %>) {\n' + |
458 |
| - ' value = iteratee[index];\n' + |
459 |
| - ' <%= objectBranch.inLoop %>\n' + |
460 |
| - ' }' + |
461 |
| - ' <% } %>\n' + |
| 456 | + ' <% if (!hasDontEnumBug || useHas) { %>}\n<% } %>' + |
462 | 457 | ' }' +
|
463 | 458 | ' <% } %>' +
|
464 | 459 |
|
|
0 commit comments