minor clean-ups (#5604)
This commit is contained in:
@@ -127,8 +127,10 @@ function push_uniq(array, el) {
|
||||
|
||||
function string_template(text, props) {
|
||||
return text.replace(/\{([^{}]+)\}/g, function(str, p) {
|
||||
var value = props[p];
|
||||
return value instanceof AST_Node ? value.print_to_string() : value;
|
||||
var value = p == "this" ? props : props[p];
|
||||
if (value instanceof AST_Node) return value.print_to_string();
|
||||
if (value instanceof AST_Token) return value.file + ":" + value.line + "," + value.col;
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user