made parser reentrant for import support
This commit is contained in:
parent
35649b320f
commit
ef97105ce3
@ -17,7 +17,7 @@ fs.stat(file, function (e, stats) {
|
||||
|
||||
start = new(Date);
|
||||
|
||||
less.parser.parse(data, function (err, tree) {
|
||||
new(less.Parser)().parse(data, function (err, tree) {
|
||||
end = new(Date);
|
||||
|
||||
total = end - start;
|
||||
|
@ -42,7 +42,9 @@ fs.stat(input, function (e, stats) {
|
||||
}
|
||||
fs.open(input, process.O_RDONLY, stats.mode, function (e, fd) {
|
||||
fs.read(fd, stats.size, 0, "utf8", function (e, data) {
|
||||
less.parser.parse(data, function (err, tree) {
|
||||
new(less.Parser)({
|
||||
paths: [path.dirname(input)]
|
||||
}).parse(data, function (err, tree) {
|
||||
if (err) {
|
||||
process.stdio.writeError(err);
|
||||
} else {
|
||||
|
1450
lib/less/parser.js
1450
lib/less/parser.js
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,9 @@ function toCSS(path, callback) {
|
||||
read(path, function (e, str) {
|
||||
if (e) { return callback(e) }
|
||||
|
||||
less.parser.parse(str, function (err, tree) {
|
||||
new(less.Parser)({
|
||||
paths: [require('path').dirname(path)]
|
||||
}).parse(str, function (err, tree) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user