mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Merge branch 'master' of https://github.com/less/less.js into rhino
Conflicts: .gitattributes README.md test/index.js
This commit is contained in:
@@ -23,14 +23,17 @@ tree.JavaScript.prototype = {
|
||||
index: this.index };
|
||||
}
|
||||
|
||||
for (var k in env.frames[0].variables()) {
|
||||
/*jshint loopfunc:true */
|
||||
context[k.slice(1)] = {
|
||||
value: env.frames[0].variables()[k].value,
|
||||
toJS: function () {
|
||||
return this.value.eval(env).toCSS();
|
||||
}
|
||||
};
|
||||
var variables = env.frames[0].variables();
|
||||
for (var k in variables) {
|
||||
if (variables.hasOwnProperty(k)) {
|
||||
/*jshint loopfunc:true */
|
||||
context[k.slice(1)] = {
|
||||
value: variables[k].value,
|
||||
toJS: function () {
|
||||
return this.value.eval(env).toCSS();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -39,7 +42,9 @@ tree.JavaScript.prototype = {
|
||||
throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message.replace(/["]/g, "'") + "'" ,
|
||||
index: this.index };
|
||||
}
|
||||
if (typeof(result) === 'string') {
|
||||
if (typeof(result) === 'number') {
|
||||
return new(tree.Dimension)(result);
|
||||
} else if (typeof(result) === 'string') {
|
||||
return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
|
||||
} else if (Array.isArray(result)) {
|
||||
return new(tree.Anonymous)(result.join(', '));
|
||||
|
||||
Reference in New Issue
Block a user