Comparing version 0.37.0 to 0.38.0
@@ -729,3 +729,3 @@ | ||
for (var i = 1, len = arguments.length; i < len; ++i) { | ||
expr.nodes.push(utils.unwrap(arguments[i])); | ||
expr.nodes.push(utils.unwrap(arguments[i]).clone()); | ||
} | ||
@@ -732,0 +732,0 @@ return expr.nodes.length; |
@@ -49,2 +49,3 @@ /** | ||
, paths = _paths.concat(this.paths) | ||
, tail = '' | ||
, found; | ||
@@ -56,3 +57,3 @@ | ||
// Lookup | ||
var found = utils.lookup(url.pathname, paths); | ||
var found = utils.lookup(url.pathname, paths, '', true); | ||
@@ -62,6 +63,9 @@ // Failed to lookup | ||
if (url.search) tail += url.search; | ||
if (url.hash) tail += url.hash; | ||
if (this.includeCSS && extname(found) == '.css') { | ||
return new nodes.Literal(found); | ||
return new nodes.Literal(found + tail); | ||
} else { | ||
return new nodes.Literal('url("' + relative(dirname(this.filename), found) +'")'); | ||
return new nodes.Literal('url("' + relative(dirname(this.filename), found) + tail + '")'); | ||
} | ||
@@ -68,0 +72,0 @@ }; |
@@ -32,3 +32,3 @@ | ||
, '.eot': 'application/vnd.ms-fontobject' | ||
, '.woff': 'application/x-font-woff' | ||
, '.woff': 'application/font-woff' | ||
}; | ||
@@ -35,0 +35,0 @@ |
@@ -114,5 +114,7 @@ /*! | ||
// check for dest-path overlap | ||
var overlap = compare(dest, path); | ||
path = path.slice(overlap.length); | ||
if (typeof dest == 'string' || typeof dest == 'function') { | ||
// check for dest-path overlap | ||
var overlap = compare((typeof dest == 'function' ? dest(path) : dest), path); | ||
path = path.slice(overlap.length); | ||
} | ||
@@ -119,0 +121,0 @@ var cssPath, stylusPath; |
@@ -49,3 +49,3 @@ | ||
/** | ||
* Return <name>(). | ||
* Return <name>(param1, param2, ...). | ||
* | ||
@@ -57,3 +57,8 @@ * @return {String} | ||
Call.prototype.toString = function(){ | ||
return this.name + '()'; | ||
}; | ||
var args = this.args.nodes.map(function(node) { | ||
var str = node.toString(); | ||
return str.slice(1, str.length - 1); | ||
}).join(', '); | ||
return this.name + '(' + args + ')'; | ||
}; |
@@ -1,2 +0,1 @@ | ||
/*! | ||
@@ -83,3 +82,3 @@ * Stylus | ||
if ('function' == typeof options) fn = options, options = {}; | ||
new Renderer(str, options).render(fn); | ||
return new Renderer(str, options).render(fn); | ||
}; | ||
@@ -86,0 +85,0 @@ |
@@ -13,2 +13,3 @@ | ||
var nodes = require('./nodes') | ||
, join = require('path').join | ||
, resolve = require('path').resolve | ||
@@ -37,2 +38,3 @@ , fs = require('fs'); | ||
* @param {String} ignore | ||
* @param {Boolean} resolveURL | ||
* @return {String} | ||
@@ -42,4 +44,5 @@ * @api private | ||
exports.lookup = function(path, paths, ignore){ | ||
exports.lookup = function(path, paths, ignore, resolveURL){ | ||
var lookup | ||
, method = resolveURL ? resolve : join | ||
, i = paths.length; | ||
@@ -63,3 +66,3 @@ | ||
try { | ||
lookup = resolve(paths[i], path); | ||
lookup = method(paths[i], path); | ||
if (ignore == lookup) continue; | ||
@@ -66,0 +69,0 @@ fs.statSync(lookup); |
@@ -527,6 +527,4 @@ | ||
if (call && !literal && !prop.literal) { | ||
this.calling.push(name); | ||
var args = nodes.Arguments.fromExpression(utils.unwrap(prop.expr)); | ||
var ret = this.visit(new nodes.Call(name, args)); | ||
this.calling.pop(); | ||
return ret; | ||
@@ -1002,2 +1000,3 @@ // Regular property | ||
, block | ||
, len | ||
, other; | ||
@@ -1020,6 +1019,7 @@ | ||
} else { | ||
for (var j = 0, len = nodes.length; j < len; ++j) { | ||
if ('property' != nodes[j].nodeName) continue; | ||
other = this.interpolate(nodes[j]); | ||
if (name == other) return nodes[j].clone(); | ||
len = nodes.length; | ||
while (len--) { | ||
if ('property' != nodes[len].nodeName) continue; | ||
other = this.interpolate(nodes[len]); | ||
if (name == other) return nodes[len].clone(); | ||
} | ||
@@ -1026,0 +1026,0 @@ } |
{ "name": "stylus" | ||
, "description": "Robust, expressive, and feature-rich CSS superset" | ||
, "version": "0.37.0" | ||
, "version": "0.38.0" | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
@@ -5,0 +5,0 @@ , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"] |
242708
9179