[Pkg-javascript-commits] [less.js] 24/285: move environment to the less namespace

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:33 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 462b0274b224c994b764a4c12acbd4cd8f44f700
Author: Luke Page <luke.a.page at gmail.com>
Date:   Mon Feb 24 21:28:21 2014 +0000

    move environment to the less namespace
---
 lib/less/browser.js              |  4 ++--
 lib/less/environments/browser.js |  2 +-
 lib/less/functions.js            |  2 +-
 lib/less/index.js                |  2 +-
 lib/less/parser.js               | 10 +++++-----
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/less/browser.js b/lib/less/browser.js
index 93b3f84..a0c65d0 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -340,10 +340,10 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
         env.useFileCache = true;
     }
 
-    less.Parser.environment.loadFile(env, sheet.href, null, function loadInitialFileCallback(e, data, path, webInfo) {
+    less.environment.loadFile(env, sheet.href, null, function loadInitialFileCallback(e, data, path, webInfo) {
     
         var newFileInfo = {
-            currentDirectory: less.Parser.environment.getPath(env, path),
+            currentDirectory: less.environment.getPath(env, path),
             filename: path,
             rootFilename: path,
             relativeUrls: env.relativeUrls};
diff --git a/lib/less/environments/browser.js b/lib/less/environments/browser.js
index ae45d11..216b4c0 100644
--- a/lib/less/environments/browser.js
+++ b/lib/less/environments/browser.js
@@ -19,7 +19,7 @@ function getXMLHttpRequest() {
     }
 }
 
-less.Parser.environment = {
+less.environment = {
     // make generic but overriddable
     warn: function warn(env, msg) {
         console.warn(msg);
diff --git a/lib/less/functions.js b/lib/less/functions.js
index 8fac47a..47cf330 100644
--- a/lib/less/functions.js
+++ b/lib/less/functions.js
@@ -530,7 +530,7 @@ var functions = {
 
         if (useBase64) {
             try {
-                returner = less.Parser.environment.encodeBase64(this.env, returner);
+                returner = less.environment.encodeBase64(this.env, returner);
             } catch(e) {
                 useBase64 = false;
             }
diff --git a/lib/less/index.js b/lib/less/index.js
index a2c6917..ea47acb 100644
--- a/lib/less/index.js
+++ b/lib/less/index.js
@@ -90,6 +90,6 @@ less.writeError = function (ctx, options) {
     console.error(less.formatError(ctx, options));
 };
 
-less.Parser.environment = require("./environments/node");
+less.environment = require("./environments/node");
 
 module.exports = less;
diff --git a/lib/less/parser.js b/lib/less/parser.js
index 8c94f8b..af23116 100644
--- a/lib/less/parser.js
+++ b/lib/less/parser.js
@@ -82,7 +82,7 @@ var Parser = function Parser(env) {
                 rootFilename: currentFileInfo.rootFilename
                 };
             
-            less.Parser.environment.loadFile(env, path, currentFileInfo.currentDirectory, function loadFileCallback(e, contents, resolvedFilename) {
+            less.environment.loadFile(env, path, currentFileInfo.currentDirectory, function loadFileCallback(e, contents, resolvedFilename) {
                 if (e) {
                     fileParsedFunc(e);
                     return;
@@ -96,11 +96,11 @@ var Parser = function Parser(env) {
                 //   then rootpath should become 'less/module/nav/'
                 // - If path of imported file is '../mixins.less' and rootpath is 'less/', 
                 //   then rootpath should become 'less/../'
-                newFileInfo.currentDirectory = less.Parser.environment.getPath(env, resolvedFilename);
+                newFileInfo.currentDirectory = less.environment.getPath(env, resolvedFilename);
                 if(newFileInfo.relativeUrls) {
-                    newFileInfo.rootpath = less.Parser.environment.join((env.rootpath || ""), less.Parser.environment.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));
-                    if (!less.Parser.environment.isPathAbsolute(env, newFileInfo.rootpath) && less.Parser.environment.alwaysMakePathsAbsolute()) {
-                        newFileInfo.rootpath = less.Parser.environment.join(newFileInfo.entryPath, newFileInfo.rootpath);
+                    newFileInfo.rootpath = less.environment.join((env.rootpath || ""), less.environment.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));
+                    if (!less.environment.isPathAbsolute(env, newFileInfo.rootpath) && less.environment.alwaysMakePathsAbsolute()) {
+                        newFileInfo.rootpath = less.environment.join(newFileInfo.entryPath, newFileInfo.rootpath);
                     }
                 }
                 newFileInfo.filename = resolvedFilename;

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