aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorngld <ngld@tproxy.de>2013-09-16 23:49:19 +0200
committerngld <ngld@tproxy.de>2013-09-16 23:49:19 +0200
commit1600df2e360d0bbfd9195b3523dd3d0b440fe62a (patch)
tree8b6dc4e1f9b79520154025f5adbddc166eb069f7 /src/parseTools.js
parente0cd2c4078c5dbaecda881c9258f01d5069a1d02 (diff)
Integrate the new tool into emscripten
Automatically compile struct_info.json and save the compiled version in the emscripten cache.
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 90c5acab..2ccf0179 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -5,11 +5,12 @@
// Does simple 'macro' substitution, using Django-like syntax,
// {{{ code }}} will be replaced with |eval(code)|.
+// NOTE: Be careful with that ret check. If ret is |0|, |ret ? ret.toString() : ''| would result in ''!
function processMacros(text) {
return text.replace(/{{{([^}]|}(?!}))+}}}/g, function(str) {
str = str.substr(3, str.length-6);
var ret = eval(str);
- return ret ? ret.toString() : '';
+ return ret !== null ? ret.toString() : '';
});
}