diff --git a/dist/carto.js b/dist/carto.js index 68fc973..bac285c 100644 --- a/dist/carto.js +++ b/dist/carto.js @@ -1,4 +1,11 @@ +var assert = { + ok: function(value, message) { + message = message || ''; + if(!value) throw new Error("assertion failed", message); + } +} + var carto_initialize = function(carto, uri, callback) { callback(); }; @@ -2936,9 +2943,7 @@ tree.Comment.prototype = { })(require('../tree')); (function(tree) { -var assert = require('assert') || { - ok: function() { } -}; +var assert = require('assert'); tree.Definition = function Definition(selector, rules) { this.elements = selector.elements; @@ -3842,14 +3847,19 @@ tree.Quoted.prototype = { var _ = require('underscore'); -var mapnik_reference = require('mapnik-reference'); +var reference = require('mapnik-reference'); tree.Reference = { - data: mapnik_reference.version.latest + data: reference.version.latest +}; + +tree.Reference.setReference = function(ref, version) { + reference = ref; + tree.Reference.setVersion(version || 'latest'); }; tree.Reference.setVersion = function(version) { - tree.Reference.data = mapnik_reference.version[version]; + tree.Reference.data = reference.version[version]; }; tree.Reference.required_prop_list_cache = {}; @@ -4872,7 +4882,8 @@ CartoCSS.renderers['canvas-2d'] = { 'line-opacity': 'globalAlpha', // polygon 'polygon-fill': 'fillStyle', - 'polygon-opacity': 'globalAlpha' + 'polygon-opacity': 'globalAlpha', + 'comp-op': 'comp-op' }, transform: function(src) { @@ -4959,6 +4970,9 @@ CartoCSS.prototype = { setStyle: function(style) { var layers = this.parse(style); + if(!layers) { + throw new Error(this.parse_env.errors); + } this.layers = layers.map(function(shader) { return new CartoCSS.Layer(shader); }); @@ -4970,6 +4984,7 @@ CartoCSS.prototype = { _createFn: function(ops) { var body = ops.join('\n'); + console.log(body); return Function("data","ctx", "var _value = null; " + body + "; return _value; "); }, diff --git a/makefile b/makefile index 4a64d24..fb75236 100644 --- a/makefile +++ b/makefile @@ -8,6 +8,8 @@ uglify = ./node_modules/.bin/uglify JS_CLIENT_FILES=browser/*.js lib/carto/parser.js lib/carto/tree.js lib/carto/tree/*.js lib/carto/functions.js lib/carto/renderer_js.js +all: dist + lint: ./node_modules/.bin/jshint lib/carto/*.js lib/carto/tree/*.js @@ -25,8 +27,9 @@ doc: $(docco) lib/carto/*.js lib/carto/tree/*.js dist/carto.js: $(JS_CLIENT_FILES) - cat browser/*.js lib/carto/parser.js lib/carto/tree.js lib/carto/tree/*.js lib/carto/functions.js lib/carto/renderer_js.js > dist/carto.js + cat $(JS_CLIENT_FILES) > dist/carto.js dist: dist/carto.js + .PHONY: test