8000 Fix `_.sortBy` in the mobile build attempt two. · lodash/lodash@9d70d7c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d70d7c

Browse files
committed
Fix _.sortBy in the mobile build attempt two.
Former-commit-id: 8f54b16a901acc4ce91f071c5b36c632334f7dde
1 parent 648a6af commit 9d70d7c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

build/pre-compile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,14 @@
258258
}
259259
snippets.forEach(function(snippet) {
260260
var result = snippet,
261-
isSortBy = /var sortBy\b/.test(result);
261+
isSortBy = /var sortBy\b/.test(result),
262+
isInlined = !/\bcreateIterator\b/.test(result);
262263

263264
// minify properties
264265
properties.forEach(function(property, index) {
265-
// add quotes around properties in the inlined method of the mobile build
266-
// so Closure Compiler won't mung them
267-
if (isSortBy) {
266+
// add quotes around properties in the inlined `sortBy` of the mobile
267+
// build so Closure Compiler won't mung them
268+
if (isSortBy && isInlined) {
268269
result = result
269270
.replace(RegExp('\\.' + property + '\\b', 'g'), "['" + minNames[index] + "']")
270271
.replace(RegExp('\\b' + property + ' *:', 'g'), "'" + minNames[index] + "':");

0 commit comments

Comments
 (0)
0