[Pkg-javascript-commits] [less.js] 261/285: IE8/IE9 support

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:24:00 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 4b1a2006862fde15c3fa38924f8ebeb2467e43fb
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Nov 2 13:50:04 2014 +0000

    IE8/IE9 support
---
 lib/less/functions/function-caller.js | 6 +++---
 lib/less/less-error.js                | 9 ++++++++-
 lib/less/tree/call.js                 | 4 +---
 test/browser/common.js                | 8 +++++---
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/lib/less/functions/function-caller.js b/lib/less/functions/function-caller.js
index 22e1e30..c2b6e96 100644
--- a/lib/less/functions/function-caller.js
+++ b/lib/less/functions/function-caller.js
@@ -2,16 +2,16 @@ var functionRegistry = require("./function-registry");
 
 var functionCaller = function(name, context, index, currentFileInfo) {
     this.name = name.toLowerCase();
-    this.function = functionRegistry.get(this.name);
+    this.func = functionRegistry.get(this.name);
     this.index = index;
     this.context = context;
     this.currentFileInfo = currentFileInfo;
 };
 functionCaller.prototype.isValid = function() {
-    return Boolean(this.function);
+    return Boolean(this.func);
 };
 functionCaller.prototype.call = function(args) {
-    return this.function.apply(this, args);
+    return this.func.apply(this, args);
 };
 
 module.exports = functionCaller;
diff --git a/lib/less/less-error.js b/lib/less/less-error.js
index 4332bb3..1ea9d51 100644
--- a/lib/less/less-error.js
+++ b/lib/less/less-error.js
@@ -31,5 +31,12 @@ var LessError = module.exports = function LessError(e, importManager, currentFil
     this.stack = e.stack;
 };
 
-LessError.prototype = Object.create(Error.prototype);
+if (typeof Object.create === 'undefined') {
+    var F = function () {};
+    F.prototype = Error.prototype;
+    LessError.prototype = new F();
+} else {
+    LessError.prototype = Object.create(Error.prototype);
+}
+
 LessError.prototype.constructor = LessError;
diff --git a/lib/less/tree/call.js b/lib/less/tree/call.js
index 34a4e0c..d448c6d 100644
--- a/lib/less/tree/call.js
+++ b/lib/less/tree/call.js
@@ -18,13 +18,11 @@ Call.prototype.accept = function (visitor) {
 };
 //
 // When evaluating a function call,
-// we either find the function in `less.functions` [1],
+// we either find the function in the functionRegistry,
 // in which case we call it, passing the  evaluated arguments,
 // if this returns null or we cannot find the function, we
 // simply print it out as it appeared originally [2].
 //
-// The *functions.js* file contains the built-in functions.
-//
 // The reason why we evaluate the arguments, is in the case where
 // we try to pass a variable to a function, like: `saturate(@color)`.
 // The function should receive the value, not the variable.
diff --git a/test/browser/common.js b/test/browser/common.js
index 386da79..c55d172 100644
--- a/test/browser/common.js
+++ b/test/browser/common.js
@@ -189,10 +189,12 @@ var loadFile = function (href) {
     return new Promise(function (resolve, reject) {
         var request = new XMLHttpRequest();
         request.open('GET', href, true);
-        request.onload = function (e) {
-            resolve(request.response.replace(/\r/g, ""));
+        request.onreadystatechange = function () {
+            if (request.readyState == 4) {
+                resolve(request.responseText.replace(/\r/g, ""));
+            }
         };
-        request.send();
+        request.send(null);
     });
 };
 

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