aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
authorOndřej Španěl <OndrejSpanel@users.noreply.github.com>2017-02-24 01:51:24 +0100
committerAlex Lam S.L <alexlamsl@gmail.com>2017-02-24 08:51:24 +0800
commit852f78491a212ba20841847436dab93abb0a8181 (patch)
tree3596deb64069e4569b52580c5ed5a15cfe7a8f2c /lib/ast.js
parent229e42cdee14c384b7a48bd0882bb27d98db040a (diff)
downloadtracifyjs-852f78491a212ba20841847436dab93abb0a8181.tar.gz
tracifyjs-852f78491a212ba20841847436dab93abb0a8181.zip
Avoid using exports when undefined (#1471)
Makes direct usage within web browser easier, even if officially unsupported.
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js4
1 files changed, 3 insertions, 1 deletions
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;
};