This commit is contained in:
Mihai Bazon
2012-11-24 10:02:08 +02:00
parent 1abde9c8b0
commit 13c4dfcabd

View File

@@ -287,9 +287,9 @@ var AST_Toplevel = DEFNODE("Toplevel", "globals", {
}, },
wrap_commonjs: function(name, export_all) { wrap_commonjs: function(name, export_all) {
var self = this; var self = this;
var to_export = [];
if (export_all) { if (export_all) {
self.figure_out_scope(); self.figure_out_scope();
var to_export = [];
self.walk(new TreeWalker(function(node){ self.walk(new TreeWalker(function(node){
if (node instanceof AST_SymbolDeclaration && node.definition().global) { if (node instanceof AST_SymbolDeclaration && node.definition().global) {
if (!find_if(function(n){ return n.name == node.name }, to_export)) if (!find_if(function(n){ return n.name == node.name }, to_export))