Fix parser's use of underscore's template method to work with modern use of it.

This commit is contained in:
nobuti 2016-05-30 14:05:42 +02:00
parent 176886f1ad
commit d3e23dcb5d

View File

@ -114,8 +114,9 @@ carto.Parser = function Parser(env) {
// - `index`: Char. index where the error occurred.
function makeError(err) {
var einput;
var errorTemplate;
_(err).defaults({
_.defaults(err, {
index: furthest,
filename: env.filename,
message: 'Parse error.',
@ -133,8 +134,8 @@ carto.Parser = function Parser(env) {
for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
err.column++;
}
return new Error(_('<%=filename%>:<%=line%>:<%=column%> <%=message%>').template(err));
errorTemplate = _.template('<%=filename%>:<%=line%>:<%=column%> <%=message%>');
return new Error(errorTemplate(err));
}
this.env = env = env || {};