From f5ab24b8d2e305b2acf2a0eaade3299cb9bd9ac2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 5 Feb 2013 01:05:45 -0800 Subject: [PATCH] Fix `legacy` build. Former-commit-id: 27bbe3ec6e025185daf73f9589e034e82097c313 --- build.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 9c4faf530..9878ccfe5 100755 --- a/build.js +++ b/build.js @@ -898,9 +898,13 @@ var modified = snippet.replace(RegExp("^ *'" + varName + "': *" + varName + '.+\\n', 'm'), ''); source = source.replace(snippet, modified); - // clip the snippet at the `factory` assignment + // clip at the `factory` assignment snippet = modified.match(/Function\([\s\S]+$/)[0]; - modified = snippet.replace(RegExp('\\b' + varName + '\\b,? *', 'g'), ''); + + modified = snippet + .replace(RegExp('\\b' + varName + '\\b,? *', 'g'), '') + .replace(/, *',/, "',") + .replace(/,\s*\)/, ')') source = source.replace(snippet, modified); }