Tidy Import Visitor arguments

This commit is contained in:
Luke Page
2014-10-23 21:46:04 +01:00
parent c757befb4f
commit 5913834cc1

View File

@@ -2,24 +2,16 @@ var contexts = require("../contexts"),
Visitor = require("./visitor"),
ImportSequencer = require("./import-sequencer");
var ImportVisitor = function(importer, finish, evalEnv, onceFileDetectionMap, recursionDetector) {
// TODO arguments not all necessary now
var ImportVisitor = function(importer, finish) {
this._visitor = new Visitor(this);
this._importer = importer;
this._finish = finish;
// TODO probably doesnt need to be an array
this.contextStack = [evalEnv || new contexts.Eval()];
this.contextStack = [new contexts.Eval()];
this.importCount = 0;
this.onceFileDetectionMap = onceFileDetectionMap || {};
this.onceFileDetectionMap = {};
this.recursionDetector = {};
if (recursionDetector) {
for(var fullFilename in recursionDetector) {
if (recursionDetector.hasOwnProperty(fullFilename)) {
this.recursionDetector[fullFilename] = true;
}
}
}
this._sequencer = new ImportSequencer();
};