Make the error flag more strict

This commit is contained in:
Francisco López 2017-04-17 15:48:55 +02:00
parent 510847a3b2
commit 9b5fb6a408

View File

@ -239,10 +239,11 @@ CartoCSS.prototype = {
for(var i = 0; i < defs.length; ++i) {
var def = defs[i];
def.toXML(parse_env, {});
if (this.options.strict && parse_env.errors.message) {
throw new Error(parse_env.errors.message);
if (this.options.strict) {
def.toXML(parse_env, {});
if (parse_env.errors.message) {
throw new Error(parse_env.errors.message);
}
}
var k = defKey(def);