Merge pull request #33 from CartoDB/SMOKES-reference-errors
Smokes reference errors
This commit is contained in:
commit
f2e49864d9
2
dist/carto.js
vendored
2
dist/carto.js
vendored
File diff suppressed because one or more lines are too long
5
dist/carto.uncompressed.js
vendored
5
dist/carto.uncompressed.js
vendored
@ -1779,11 +1779,12 @@ CartoCSS.prototype = {
|
||||
for(var i = 0; i < defs.length; ++i) {
|
||||
var def = defs[i];
|
||||
|
||||
if (this.options.strict) {
|
||||
def.toXML(parse_env, {});
|
||||
|
||||
if (this.options.strict && parse_env.errors.message) {
|
||||
if (parse_env.errors.message) {
|
||||
throw new Error(parse_env.errors.message);
|
||||
}
|
||||
}
|
||||
|
||||
var k = defKey(def);
|
||||
var layer = layers[k];
|
||||
|
@ -239,11 +239,12 @@ CartoCSS.prototype = {
|
||||
for(var i = 0; i < defs.length; ++i) {
|
||||
var def = defs[i];
|
||||
|
||||
if (this.options.strict) {
|
||||
def.toXML(parse_env, {});
|
||||
|
||||
if (this.options.strict && parse_env.errors.message) {
|
||||
if (parse_env.errors.message) {
|
||||
throw new Error(parse_env.errors.message);
|
||||
}
|
||||
}
|
||||
|
||||
var k = defKey(def);
|
||||
var layer = layers[k];
|
||||
|
8
test/editor/editor.test.js
Normal file
8
test/editor/editor.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
var ref = require('./reference.json');
|
||||
var carto = require('../../lib/carto/index.js');
|
||||
|
||||
|
||||
var ccss = new carto.RendererJS({
|
||||
reference: ref,
|
||||
strict: true
|
||||
}).render("#layer { polygon-fill: #abcdef; }");
|
@ -124,9 +124,6 @@ describe('RendererJS Strict Mode', function() {
|
||||
function rendererStrictModeOffTest(RendererJS) {
|
||||
return function () {
|
||||
var shader = RendererJS.render(style);
|
||||
assert.ok(shader.parse_env);
|
||||
assert.ok(shader.parse_env.errors);
|
||||
assert.ok(shader.parse_env.errors.message.match(expectedErrorMessageRegex));
|
||||
|
||||
assert.ok(shader.layers);
|
||||
assert.equal(shader.layers.length, 2);
|
||||
|
Loading…
Reference in New Issue
Block a user