diff --git a/browser/assert.js b/browser/assert.js index 7fcb879..7a47f56 100644 --- a/browser/assert.js +++ b/browser/assert.js @@ -4,4 +4,10 @@ var assert = { message = message || ''; if(!value) throw new Error("assertion failed", message); } +}; + +if (navigator.userAgent.indexOf('MSIE 8.0') !== -1 || navigator.userAgent.indexOf('MSIE 7.0') !== -1) { + Object.defineProperty = function(o, p, fn) { o[p] = fn.value; }; } + + diff --git a/lib/carto/parser.js b/lib/carto/parser.js index 239df08..1803e6d 100644 --- a/lib/carto/parser.js +++ b/lib/carto/parser.js @@ -1,4 +1,3 @@ -var carto, tree, _; if (typeof(exports) !== 'undefined') { carto = exports; @@ -8,6 +7,7 @@ if (typeof(exports) !== 'undefined') { if (typeof(window.carto) === 'undefined') { window.carto = {}; } carto = window.carto; tree = window.carto.tree = {}; + _ = window._; } // carto.js - parser @@ -624,7 +624,7 @@ carto.Parser = function Parser(env) { var e, elements = []; var f, filters = new tree.Filterset(); var z, zoom = tree.Zoom.all; - var fo, frame_offset = tree.FrameOffset.null; + var fo, frame_offset = tree.FrameOffset.none; var segments = 0, conditions = 0; while ( diff --git a/lib/carto/tree/frame_offset.js b/lib/carto/tree/frame_offset.js index 06ae985..902a887 100644 --- a/lib/carto/tree/frame_offset.js +++ b/lib/carto/tree/frame_offset.js @@ -23,5 +23,5 @@ tree.FrameOffset = function(op, value, index) { }; tree.FrameOffset.max = 32; -tree.FrameOffset.null = 0; +tree.FrameOffset.none = 0;