fix crash on missing props to string_template() (#1523)

Patched up `make_node()` without `orig`.

There may be other cases where `start` could be missing, so make it print "undefined" instead of crashing.

fixes #1518
This commit is contained in:
Alex Lam S.L
2017-03-01 15:25:26 +08:00
committed by GitHub
parent fb2b6c7c6f
commit c2334baa48
2 changed files with 4 additions and 4 deletions

View File

@@ -185,7 +185,7 @@ function push_uniq(array, el) {
function string_template(text, props) {
return text.replace(/\{(.+?)\}/g, function(str, p){
return props[p];
return props && props[p];
});
};