From 23cd5b906b89838dfcff35417864f9bd2505736b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 14 Jul 2013 13:40:17 -0700 Subject: [PATCH] Minify `dependencyObject` properties correctly. Former-commit-id: a0d57812420a347938a438d9ecb13467401bcc96 --- build/pre-compile.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build/pre-compile.js b/build/pre-compile.js index a4ecb3bc8..a73da1271 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -331,6 +331,11 @@ 'sortBy' ]; + var depObjProps = [ + 'isEqual', + 'keys' + ]; + var props = [ 'cache', 'criteria', @@ -339,18 +344,19 @@ ]; // minify `dependencyObject` properties - source = source.replace(/\b(dependencyObject(?:\.|\['))\w+/g, function(match, prelude) { - return prelude + minNames[iteratorOptions.length + props.length]; + depObjProps.forEach(function(prop, index) { + source = source.replace(RegExp("\\b(dependencyObject(?:\\.|\\['))" + prop + '\\b', 'g'), function(match, prelude) { + return prelude + minNames[iteratorOptions.length + props.length + index]; + }); }); + // minify other properties used in functions var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + funcNames.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm')); if (!snippets) { return; } snippets.forEach(function(snippet) { var modified = snippet; - - // minify properties props.forEach(function(prop, index) { // use minified names different than those chosen for `iteratorOptions` var minName = minNames[iteratorOptions.length + index],