[Pkg-javascript-commits] [uglifyjs] 41/228: Avoid using exports when undefined (#1471)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository uglifyjs.

commit 852f78491a212ba20841847436dab93abb0a8181
Author: Ondřej Španěl <OndrejSpanel at users.noreply.github.com>
Date:   Fri Feb 24 01:51:24 2017 +0100

    Avoid using exports when undefined (#1471)
    
    Makes direct usage within web browser easier, even if officially unsupported.
---
 lib/ast.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/ast.js b/lib/ast.js
index 42506cb..61643ae 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;
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list