mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Reduce _.forEach and optimize the minified builds for Safari.
Former-commit-id: d4366f1a3c5fd0751558f714384600c3bcf0f49b
This commit is contained in:
6
build.js
6
build.js
@@ -2088,6 +2088,12 @@
|
||||
'isTemplate': isTemplate,
|
||||
'outputPath': outputPath,
|
||||
'onComplete': function(source) {
|
||||
// replace `!1` with `false` and `!0` with `true` to help
|
||||
// optimize Safari when used in a loop
|
||||
source = source
|
||||
.replace(/!1([!=]==?[a-z])/g, 'false$1')
|
||||
.replace(/!0([!=]==?[a-z])/g, 'true$1')
|
||||
|
||||
// inject "use strict" directive
|
||||
if (isStrict) {
|
||||
source = source.replace(/^([\s\S]*?function[^{]+{)([^"'])/, '$1"use strict";$2');
|
||||
|
||||
Reference in New Issue
Block a user