From 4bddd5c5a282ec9a528687323cbed1df45c8daba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0pan=C4=9Bl?= Date: Wed, 8 Feb 2017 09:22:39 +0100 Subject: [PATCH] Avoid using exports when they are not defined (like running in a browser). --- lib/ast.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; };