Open leonidborisenko opened 10 years ago
You're right, those global arrays are rather ugly and may lead to this sort of problems when you're using the API. Your work-around is the best quick fix I could think of. Ideally, we'd want to track source information all the way through the lexer and parser data structures, but that would be quite a big patch I imagine.
I'll keep this issue open, in the hope of resolving it some day...
helpers.scripts
andhelpers.filenames
aren't cleared anywhere in code.This is not a problem for CLI users, but it has some consequences for API users.
When I use BlackCoffee inside Gruntfile with
require('blackcoffee').compile(...)
, BlackCoffee's module is cached andhelpers.scripts
/helpers.filenames
are expanding and expanding with every processed file. For example, source map generator uses these variables and gets redundant information starting from second processed file:I think it's not the only possible edge case.with current implementation. Right now I manually clear these variables before every
compile
invocation. Would there be any other solution?