public
/
UglifyJS.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
229e42c
)
Avoid using exports when undefined (#1471)
author
Ondřej Španěl
<OndrejSpanel@users.noreply.github.com>
Fri, 24 Feb 2017 00:51:24 +0000
(
01:51
+0100)
committer
Alex Lam S.L
<alexlamsl@gmail.com>
Fri, 24 Feb 2017 00:51:24 +0000
(08:51 +0800)
Makes direct usage within web browser easier, even if officially unsupported.
lib/ast.js
patch
|
blob
|
history
diff --git
a/lib/ast.js
b/lib/ast.js
index
42506cb
..
61643ae
100644
(file)
--- 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;
};