Closed
Description
Consider following code:
var less = require('less');
var src = `
@file: ext();
@import '@{file}';
`;
less.functions.functionRegistry.add('ext', () => new less.tree.Anonymous('file'));
less.render(src, {}, (error, output) => {
if (error) return console.log(error.stack);
console.log(output);
});
Provided "file.less" exists, this code compiles in less 2.4.0 and does include "file.less".
For any newer version however, I'm getting the following:
TypeError: Cannot read property 'get' of undefined
at new functionCaller (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\functions\function-caller.js:9:51)
at Node.Call.eval (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\tree\call.js:32:30)
at Node.Expression.eval (C:\Users\pgarlaud\tmp\less\node_modules\less\lib\less\tree\expression.js:31:37)
…