[Pkg-javascript-commits] [less.js] 113/285: Fix url import. Fixes #2089.

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:45 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 50e299b8bc2b8100c52c77f37da01e2f81ae4ca5
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Sep 7 14:40:28 2014 +0100

    Fix url import. Fixes #2089.
---
 lib/less/tree/import.js                            | 6 +++++-
 test/css/import.css                                | 3 +++
 test/less/import/deeper/deeper-2/url-import-2.less | 3 +++
 test/less/import/deeper/deeper-2/url-import.less   | 1 +
 test/less/import/deeper/url-import.less            | 1 +
 test/less/import/import-test-a.less                | 1 +
 6 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/less/tree/import.js b/lib/less/tree/import.js
index c0d0459..6b5f26f 100644
--- a/lib/less/tree/import.js
+++ b/lib/less/tree/import.js
@@ -75,7 +75,11 @@ Import.prototype.getPath = function () {
     return null;
 };
 Import.prototype.evalForImport = function (env) {
-    return new(Import)(this.path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
+    var path = this.path;
+    if (path instanceof URL) {
+        path = path.value;
+    }
+    return new(Import)(path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
 };
 Import.prototype.evalPath = function (env) {
     var path = this.path.eval(env);
diff --git a/test/css/import.css b/test/css/import.css
index 4c66eec..f52f908 100644
--- a/test/css/import.css
+++ b/test/css/import.css
@@ -20,6 +20,9 @@
   height: 10px;
   color: red;
 }
+.deep-import-url {
+  color: red;
+}
 @media screen and (max-width: 601px) {
   #css {
     color: yellow;
diff --git a/test/less/import/deeper/deeper-2/url-import-2.less b/test/less/import/deeper/deeper-2/url-import-2.less
new file mode 100644
index 0000000..727ea57
--- /dev/null
+++ b/test/less/import/deeper/deeper-2/url-import-2.less
@@ -0,0 +1,3 @@
+.deep-import-url {
+  color: red;
+}
\ No newline at end of file
diff --git a/test/less/import/deeper/deeper-2/url-import.less b/test/less/import/deeper/deeper-2/url-import.less
new file mode 100644
index 0000000..2ec87bc
--- /dev/null
+++ b/test/less/import/deeper/deeper-2/url-import.less
@@ -0,0 +1 @@
+ at import url("url-import-2.less");
\ No newline at end of file
diff --git a/test/less/import/deeper/url-import.less b/test/less/import/deeper/url-import.less
new file mode 100644
index 0000000..003b077
--- /dev/null
+++ b/test/less/import/deeper/url-import.less
@@ -0,0 +1 @@
+ at import url("deeper-2/url-import.less");
\ No newline at end of file
diff --git a/test/less/import/import-test-a.less b/test/less/import/import-test-a.less
index b3b3b8f..1fa71c6 100644
--- a/test/less/import/import-test-a.less
+++ b/test/less/import/import-test-a.less
@@ -1,3 +1,4 @@
 @import "import-test-b.less";
+ at import url("deeper/url-import.less");
 @a: 20%;
 @import "urls.less";
\ No newline at end of file

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