Remove dead code around data URIs
This commit is contained in:
parent
17d569039b
commit
c9129188c7
@ -496,7 +496,7 @@ carto.Parser = function Parser(env) {
|
||||
if (! $(')')) {
|
||||
return new tree.Invalid(value, memo, 'Missing closing ) in URL.');
|
||||
} else {
|
||||
return new tree.URL((value.value || value.data || value instanceof tree.Variable) ?
|
||||
return new tree.URL((value.value || value instanceof tree.Variable) ?
|
||||
value : new tree.Anonymous(value), imports.paths);
|
||||
}
|
||||
},
|
||||
|
@ -1,26 +1,16 @@
|
||||
(function(tree) {
|
||||
|
||||
tree.URL = function URL(val, paths) {
|
||||
if (val.data) {
|
||||
this.attrs = val;
|
||||
} else {
|
||||
// Add the base path if the URL is relative and we are in the browser
|
||||
if (!/^(?:https?:\/|file:\/)?\//.test(val.value) && paths.length > 0 && typeof(process) === 'undefined') {
|
||||
val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
|
||||
}
|
||||
this.value = val;
|
||||
this.paths = paths;
|
||||
this.is = 'uri';
|
||||
}
|
||||
this.value = val;
|
||||
this.paths = paths;
|
||||
this.is = 'uri';
|
||||
};
|
||||
tree.URL.prototype = {
|
||||
toString: function() {
|
||||
return this.value.toString();
|
||||
},
|
||||
eval: function(ctx) {
|
||||
return this.attrs ? this : new tree.URL(this.value.eval(ctx), this.paths);
|
||||
// URL case no longer supported.
|
||||
// @TODO: throw an error?
|
||||
return new tree.URL(this.value.eval(ctx), this.paths);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user