-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Milestone
Description
This is a bug introduced in v1.3.2, with the extractUrlParts
function. When the path does not have a protocol / host part (local path) then the result of the regular expression inside that function would be undefined
, and that would be prepended to the path, thus making it unable to be loaded.
Reproduction steps:
- Include the latest less.js inside your WebKit application (this was discovered in matthewdl/Crunch)
- Manually invoke the parser and the compiler:
var parser = new(less.Parser);
parser.parse('@import "files/demo.less";', function (err, tree) {
if (err) { return console.error(err) }
console.log(tree.toCSS());
});
The href
variable inside loadStyleSheet
function would be prepended with undefined
, and the file would not be loaded (404).