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);
|
start = new(Date);
|
||||||
|
|
||||||
less.parser.parse(data, function (err, tree) {
|
new(less.Parser)().parse(data, function (err, tree) {
|
||||||
end = new(Date);
|
end = new(Date);
|
||||||
|
|
||||||
total = end - start;
|
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.open(input, process.O_RDONLY, stats.mode, function (e, fd) {
|
||||||
fs.read(fd, stats.size, 0, "utf8", function (e, data) {
|
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) {
|
if (err) {
|
||||||
process.stdio.writeError(err);
|
process.stdio.writeError(err);
|
||||||
} else {
|
} 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) {
|
read(path, function (e, str) {
|
||||||
if (e) { return callback(e) }
|
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) {
|
if (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user