pass scope to transformers

This commit is contained in:
Sebastian McKenzie
2014-11-04 12:48:08 +11:00
parent 89fbb06658
commit 56271efada

View File

@@ -35,7 +35,7 @@ Transformer.prototype.transform = function (file) {
var self = this;
var build = function (exit) {
return function (node, parent) {
return function (node, parent, opts) {
// add any node type aliases that exist
var types = [node.type].concat(t.ALIAS_KEYS[node.type] || []);
@@ -52,7 +52,7 @@ Transformer.prototype.transform = function (file) {
if (exit) fn = fns.exit;
if (!fn) return;
return fn(node, parent, file);
return fn(node, parent, file, opts.scope);
};
};