[Pkg-javascript-commits] [less.js] 21/25: do not use util.print since it is deprecated. Fixes #2081

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:01 UTC 2015


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

js pushed a commit to annotated tag v1.7.4
in repository less.js.

commit 1ff24b4c266783823a6971696b5ca5366e626463
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Jul 27 16:56:46 2014 +0100

    do not use util.print since it is deprecated. Fixes #2081
---
 benchmark/less-benchmark.js |  3 +--
 bin/lessc                   | 11 +++++------
 test/less-test.js           | 15 +++++++--------
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/benchmark/less-benchmark.js b/benchmark/less-benchmark.js
index ba789d5..6d67e15 100644
--- a/benchmark/less-benchmark.js
+++ b/benchmark/less-benchmark.js
@@ -1,6 +1,5 @@
 var path = require('path'),
-    fs = require('fs'),
-    sys = require('util');
+    fs = require('fs');
 
 var less = require('../lib/less');
 var file = path.join(__dirname, 'benchmark.less');
diff --git a/bin/lessc b/bin/lessc
index 809741d..59ad5f2 100755
--- a/bin/lessc
+++ b/bin/lessc
@@ -2,7 +2,6 @@
 
 var path = require('path'),
     fs = require('../lib/less/fs'),
-    sys = require('util'),
     os = require('os'),
     mkdirp;
 
@@ -315,10 +314,10 @@ var ensureDirectory = function (filepath) {
 
 if (options.depends) {
     if (!outputbase) {
-        sys.print("option --depends requires an output path to be specified");
+        console.log("option --depends requires an output path to be specified");
         return;
     }
-    sys.print(outputbase + ": ");
+    process.stdout.write(outputbase + ": ");
 }
 
 if (!sourceMapFileInline) {
@@ -349,9 +348,9 @@ var parseLessFile = function (e, data) {
             return;
         } else if (options.depends) {
             for(var file in parser.imports.files) {
-                sys.print(file + " ")
+                process.stdout.write(file + " ")
             }
-            sys.print("\n");
+            console.log("");
         } else {
             try {
 	        if (options.lint) { writeSourceMap = function() {} }
@@ -383,7 +382,7 @@ var parseLessFile = function (e, data) {
                             console.log('lessc: wrote ' + output);
                         }
                     } else {
-                        sys.print(css);
+                        process.stdout.write(css);
 		    }
 		}
             } catch (e) {
diff --git a/test/less-test.js b/test/less-test.js
index 0c1bf4a..4bba05b 100644
--- a/test/less-test.js
+++ b/test/less-test.js
@@ -2,8 +2,7 @@
 
 module.exports = function() {
     var path = require('path'),
-        fs = require('fs'),
-        sys = require('util');
+        fs = require('fs');
 
     var less = require('../lib/less');
     var stylize = require('../lib/less/lessc_helper').stylize;
@@ -31,7 +30,7 @@ module.exports = function() {
 
     function testSourcemap(name, err, compiledLess, doReplacements, sourcemap) {
         fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) {
-            sys.print("- " + name + ": ");
+            process.stdout.write("- " + name + ": ");
             if (sourcemap === expectedSourcemap) {
                 ok('OK');
             } else if (err) {
@@ -48,7 +47,7 @@ module.exports = function() {
 
     function testErrors(name, err, compiledLess, doReplacements) {
         fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) {
-            sys.print("- " + name + ": ");
+            process.stdout.write("- " + name + ": ");
             expectedErr = doReplacements(expectedErr, 'test/less/errors/');
             if (!err) {
                 if (compiledLess) {
@@ -130,7 +129,7 @@ module.exports = function() {
                 var css_name = name;
                 if(nameModifier) { css_name = nameModifier(name); }
                 fs.readFile(path.join('test/css', css_name) + '.css', 'utf8', function (e, css) {
-                    sys.print("- " + css_name + ": ");
+                    process.stdout.write("- " + css_name + ": ");
 
                     css = css && doReplacements(css, 'test/less/' + foldername);
                     if (less === css) { ok('OK'); }
@@ -152,9 +151,9 @@ module.exports = function() {
         require('diff').diffLines(left, right).forEach(function(item) {
           if(item.added || item.removed) {
             var text = item.value.replace("\n", String.fromCharCode(182) + "\n");
-            sys.print(stylize(text, item.added ? 'green' : 'red'));
+              process.stdout.write(stylize(text, item.added ? 'green' : 'red'));
           } else {
-            sys.print(item.value);
+              process.stdout.write(item.value);
           }
         });
         console.log("");
@@ -241,7 +240,7 @@ module.exports = function() {
     function testNoOptions() {
         totalTests++;
         try {
-            sys.print("- Integration - creating parser without options: ");
+            process.stdout.write("- Integration - creating parser without options: ");
             new(less.Parser)();
         } catch(e) {
             fail(stylize("FAIL\n", "red"));

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



More information about the Pkg-javascript-commits mailing list