From ec7f37f314eb834d36eb64dddb8b5fe0934e50b1 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 29 Mar 2017 01:27:24 +0800 Subject: 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 bc763ae0..5189f1ad 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 3d291416..4870873d 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 d83739d5..09acc13e 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; -} -- cgit v1.2.3