mirror of
https://github.com/less/less.js.git
synced 2026-02-11 15:34:57 -05:00
pull out the input processing out of the parser class and a few small improvements - the no js option now applies to all js, including that within quotes. The Javascript node now also returns the right index.
This commit is contained in:
@@ -10,6 +10,11 @@ jsEvalNode.prototype.evaluateJavaScript = function (expression, env) {
|
||||
that = this,
|
||||
context = {};
|
||||
|
||||
if (env.javascriptEnabled !== undefined && !env.javascriptEnabled) {
|
||||
throw { message: "You are using JavaScript, which has been disabled." ,
|
||||
index: this.index };
|
||||
}
|
||||
|
||||
expression = expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
|
||||
return that.jsify(new(Variable)('@' + name, that.index).eval(env));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user