[Pkg-javascript-commits] [less.js] 163/285: Remove unused warn function (replaced with logger) and allow null environments

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


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

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit a3442404237096881e245e40cb6cde167b5c092f
Author: Luke Page <luke.a.page at gmail.com>
Date:   Thu Oct 9 17:48:56 2014 +0100

    Remove unused warn function (replaced with logger) and allow null environments
---
 lib/less-browser/environment.js     | 5 -----
 lib/less-browser/index.js           | 2 +-
 lib/less/environment/environment.js | 7 +++----
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/less-browser/environment.js b/lib/less-browser/environment.js
deleted file mode 100644
index 6adc7d6..0000000
--- a/lib/less-browser/environment.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
-    warn: function warn(msg) {
-        console.warn(msg);
-    }
-};
diff --git a/lib/less-browser/index.js b/lib/less-browser/index.js
index 801c5bd..656ee9e 100644
--- a/lib/less-browser/index.js
+++ b/lib/less-browser/index.js
@@ -14,7 +14,7 @@ var less;
 var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(window.location.protocol),
     options = window.less || {};
 
-window.less = less = require('../less')(require("./environment"));
+window.less = less = require('../less')();
 var environment = less.environment,
     browserImport = require("./browser-import")(options, isFileProtocol, less.logger);
 environment.addFileManager(browserImport);
diff --git a/lib/less/environment/environment.js b/lib/less/environment/environment.js
index c0e3f50..be654da 100644
--- a/lib/less/environment/environment.js
+++ b/lib/less/environment/environment.js
@@ -1,7 +1,9 @@
 var environment = function(externalEnvironment, fileManagers) {
     this.fileManagers = fileManagers || [];
+    externalEnvironment = externalEnvironment || {};
+
     var optionalFunctions = ["encodeBase64", "mimeLookup", "charsetLookup", "getSourceMapGenerator"],
-        requiredFunctions = ["warn"],
+        requiredFunctions = [],
         functions = requiredFunctions.concat(optionalFunctions);
 
     for(var i = 0; i < functions.length; i++) {
@@ -15,9 +17,6 @@ var environment = function(externalEnvironment, fileManagers) {
     }
 };
 
-environment.prototype.warn = function (msg) {
-};
-
 environment.prototype.getFileManager = function (filename, currentDirectory, options, environment, isSync) {
     var fileManagers = this.fileManagers;
     if (options.pluginManager) {

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