From dfc6f1d1cfdcf156cdf3a73d5bc5d1e34e0fe426 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 28 Jan 2015 18:40:33 +1100 Subject: [PATCH] add comment explaining what the modules-split transformer does --- .../transformation/transformers/internal/modules-split.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/6to5/transformation/transformers/internal/modules-split.js b/lib/6to5/transformation/transformers/internal/modules-split.js index 6c96db105a..d15d189f09 100644 --- a/lib/6to5/transformation/transformers/internal/modules-split.js +++ b/lib/6to5/transformation/transformers/internal/modules-split.js @@ -1,5 +1,11 @@ "use strict"; +// in this transformer we have to split up classes and function declarations +// from their exports. why? because sometimes we need to replace classes with +// nodes that aren't allowed in the same contexts. also, if you're exporting +// a generator function as a default then regenerator will destroy the export +// declaration and leave a variable declaration in it's place... yeah, handy. + var t = require("../../../types"); exports.ExportDeclaration = function (node, parent, scope) {