From 06daad87cabecbdf7ca999fca8720ec50824583f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 19 May 2013 11:36:04 -0700 Subject: [PATCH] Remove unnecessary semicolons from compiled strings. Former-commit-id: d4f31dafd3335878469babc5daac45957c6d4e80 --- build/pre-compile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/pre-compile.js b/build/pre-compile.js index 2bbc6af25..235dde777 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -372,6 +372,11 @@ return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; }); + // remove unnecessary semicolons in strings + modified = modified.replace(/;(?:}["']|(?:\\n|\s)*["']\s*\+\s*["'](?:\\n|\s)*})/g, function(match) { + return match.slice(1); + }); + // minify `createIterator` option property names iteratorOptions.forEach(function(property, index) { var minName = minNames[index];