From 73913f450b2d193dce686398da3dec85cc7915e4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 19 Jun 2013 22:43:30 -0700 Subject: [PATCH] Make `removeVar` punt to `removeSupport` when removing the `support` variable. Former-commit-id: 8a961673173f60669282a7ebb9ad142e13af078e --- build.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.js b/build.js index 5bbe84798..ea084a108 100755 --- a/build.js +++ b/build.js @@ -1756,9 +1756,13 @@ * @returns {String} Returns the modified source. */ function removeVar(source, varName) { + // defer to specialized removal functions + if (varName == 'support') { + return removeSupport(source); + } // simplify complex variable assignments if (/^(?:cloneableClasses|contextProps|ctorByClass|freeGlobal|nonEnumProps|shadowedProps|whitespace)$/.test(varName)) { - source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?[;}]\\n\\n'), '$1 null;\n\n'); + source = source.replace(RegExp('(var ' + varName + ') *=[\\s\\S]+?[;}]\\n\\n'), '$1 = null;\n\n'); } source = removeFunction(source, varName); @@ -3535,8 +3539,8 @@ }); }); + // remove all horizontal rule comment separators source = source.replace(/^ *\/\*-+\*\/\n/gm, ''); - source = removeSupport(source); } else { if (isExcluded('bind')) {