mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Fix double toCSS calls in unusual situations causing an exception. Fixes #1830
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
},
|
||||
|
||||
visitMixinDefinition: function (mixinNode, visitArgs) {
|
||||
// mixin definitions do not get eval'd - this means they keep state
|
||||
// so we have to clear that state here so it isn't used if toCSS is called twice
|
||||
mixinNode.frames = [];
|
||||
return [];
|
||||
},
|
||||
|
||||
|
||||
@@ -227,6 +227,8 @@ module.exports = function() {
|
||||
} else {
|
||||
try {
|
||||
css = tree.toCSS(options);
|
||||
var css2 = tree.toCSS(options); // integration test that 2nd call gets same output
|
||||
if (css2 !== css) { throw new Error("css not equal to 2nd call"); }
|
||||
callback(null, css);
|
||||
} catch (e) {
|
||||
callback(e);
|
||||
|
||||
Reference in New Issue
Block a user