aboutsummaryrefslogtreecommitdiff
path: root/lib/utils.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-27 09:39:33 +0000
committerGitHub <noreply@github.com>2020-10-27 17:39:33 +0800
commit79e5c3f5645b339a98d73cb78e356f61fa618929 (patch)
tree0d27a139c1a5026a3b4b00dfc7c67a77d68f6a2c /lib/utils.js
parent607f87c5cde7f4f66a43e5986ca692e7f7861f57 (diff)
downloadtracifyjs-79e5c3f5645b339a98d73cb78e356f61fa618929.tar.gz
tracifyjs-79e5c3f5645b339a98d73cb78e356f61fa618929.zip
improve warnings (#4247)
closes #4244
Diffstat (limited to 'lib/utils.js')
-rw-r--r--lib/utils.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/utils.js b/lib/utils.js
index 2f5a4866..2a0df8c5 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -143,8 +143,9 @@ function push_uniq(array, el) {
}
function string_template(text, props) {
- return text.replace(/\{(.+?)\}/g, function(str, p) {
- return props && props[p];
+ return text.replace(/\{([^}]+)\}/g, function(str, p) {
+ var value = props[p];
+ return value instanceof AST_Node ? value.print_to_string() : value;
});
}