diff --git a/lib/ast.js b/lib/ast.js index 42506cb2..61643aed 100644 --- a/lib/ast.js +++ b/lib/ast.js @@ -81,7 +81,9 @@ function DEFNODE(type, props, methods, base) { ctor.DEFMETHOD = function(name, method) { this.prototype[name] = method; }; - exports["AST_" + type] = ctor; + if (typeof exports !== "undefined") { + exports["AST_" + type] = ctor; + } return ctor; };