You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ripple.apache.org by gt...@apache.org on 2013/03/22 21:52:40 UTC

[6/8] git commit: `jake btest` was broken.

`jake btest` was broken.

This happened when accounting.js was added to the thirdparty list.

When `jake btest` is run, Ripple's client is bundled and injected
into the HTML test runner as a giant string. The way the JS string was
being injected was to use String.replace. However, it turns out that
something like `'$'` will trigger a regex feature (unexpectedly..),
and the resulting string that is injected ends right after that
character. In this case, it resulted in a "unexpected end of
input" interpreter error.

By not using regex to inject the JS strings, and instead using
Array.split and Array.join, the strings can be concatenated without
random things like this happening.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/ab68639a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/ab68639a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/ab68639a

Branch: refs/heads/master
Commit: ab68639adb2120362b00f3440b878690a38463ab
Parents: 0788f76
Author: Brent Lintner <br...@gmail.com>
Authored: Thu Mar 21 16:49:08 2013 -0400
Committer: Brent Lintner <br...@gmail.com>
Committed: Thu Mar 21 17:00:45 2013 -0400

----------------------------------------------------------------------
 build/btest.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/ab68639a/build/btest.js
----------------------------------------------------------------------
diff --git a/build/btest.js b/build/btest.js
index c78d3d7..3eda660 100644
--- a/build/btest.js
+++ b/build/btest.js
@@ -58,7 +58,8 @@ module.exports = function () {
         return str;
     }, "");
 
-    doc = html.replace(/<!-- SPECS -->/g, specs).replace(/##FILES##/g, modules.js);
+    doc = html.split("<!-- SPECS -->").join(specs)
+              .split("##FILES##").join(modules.js);
 
     app.listen(3000);