[Pkg-javascript-commits] [uglifyjs] 169/228: remove UGLIFY_DEBUG (#1720)

Jonas Smedegaard dr at jones.dk
Sat Apr 15 14:25:27 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 ec7f37f314eb834d36eb64dddb8b5fe0934e50b1
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Wed Mar 29 01:27:24 2017 +0800

    remove UGLIFY_DEBUG (#1720)
    
    fixes #1719
---
 test/mocha/directives.js | 13 +++++++------
 test/run-tests.js        |  2 --
 tools/exports.js         |  4 ----
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/test/mocha/directives.js b/test/mocha/directives.js
index bc763ae..5189f1a 100644
--- a/test/mocha/directives.js
+++ b/test/mocha/directives.js
@@ -176,7 +176,7 @@ describe("Directives", function() {
     });
 
     it("Should test EXPECT_DIRECTIVE RegExp", function() {
-        var tests = [
+        [
             ["", true],
             ["'test';", true],
             ["'test';;", true],
@@ -185,11 +185,12 @@ describe("Directives", function() {
             ["'tests';   \n\t", true],
             ["'tests';\n\n", true],
             ["\n\n\"use strict\";\n\n", true]
-        ];
-
-        for (var i = 0; i < tests.length; i++) {
-            assert.strictEqual(uglify.EXPECT_DIRECTIVE.test(tests[i][0]), tests[i][1], tests[i][0]);
-        }
+        ].forEach(function(test) {
+            var out = uglify.OutputStream();
+            out.print(test[0]);
+            out.print_string("", null, true);
+            assert.strictEqual(out.get() === test[0] + ';""', test[1], test[0]);
+        });
     });
 
     it("Should only print 2 semicolons spread over 2 lines in beautify mode", function() {
diff --git a/test/run-tests.js b/test/run-tests.js
index 3d29141..4870873 100755
--- a/test/run-tests.js
+++ b/test/run-tests.js
@@ -1,7 +1,5 @@
 #! /usr/bin/env node
 
-global.UGLIFY_DEBUG = true;
-
 var U = require("../tools/node");
 var path = require("path");
 var fs = require("fs");
diff --git a/tools/exports.js b/tools/exports.js
index d83739d..09acc13 100644
--- a/tools/exports.js
+++ b/tools/exports.js
@@ -17,7 +17,3 @@ exports["string_template"] = string_template;
 exports["tokenizer"] = tokenizer;
 exports["is_identifier"] = is_identifier;
 exports["SymbolDef"] = SymbolDef;
-
-if (global.UGLIFY_DEBUG) {
-    exports["EXPECT_DIRECTIVE"] = EXPECT_DIRECTIVE;
-}

-- 
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