"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/less/src/less/tree/debug-info.js" between
less.js-4.1.2.tar.gz and less.js-4.1.3.tar.gz

About: Less.js (Leaner CSS) is a CSS preprocessor (extension language) adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.

debug-info.js  (less.js-4.1.2):debug-info.js  (less.js-4.1.3)
class debugInfo { function asComment(ctx) {
constructor(context, ctx, lineSeparator) { return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\n`
let result = ''; ;
if (context.dumpLineNumbers && !context.compress) { }
switch (context.dumpLineNumbers) {
case 'comments':
result = debugInfo.asComment(ctx);
break;
case 'mediaquery':
result = debugInfo.asMediaQuery(ctx);
break;
case 'all':
result = debugInfo.asComment(ctx) + (lineSeparator || '') +
debugInfo.asMediaQuery(ctx);
break;
}
}
return result;
}
static asComment(ctx) { function asMediaQuery(ctx) {
return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} * let filenameWithProtocol = ctx.debugInfo.fileName;
/\n`; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
filenameWithProtocol = `file://${filenameWithProtocol}`;
} }
return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.
replace(/([.:\/\\])/g, function (a) {
if (a == '\\') {
a = '\/';
}
return `\\${a}`;
})}}line{font-family:\\00003${ctx.debugInfo.lineNumber}}}\n`;
}
static asMediaQuery(ctx) { function debugInfo(context, ctx, lineSeparator) {
let filenameWithProtocol = ctx.debugInfo.fileName; let result = '';
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { if (context.dumpLineNumbers && !context.compress) {
filenameWithProtocol = `file://${filenameWithProtocol}`; switch (context.dumpLineNumbers) {
case 'comments':
result = asComment(ctx);
break;
case 'mediaquery':
result = asMediaQuery(ctx);
break;
case 'all':
result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(c
tx);
break;
} }
return `@media -sass-debug-info{filename{font-family:${filenameWithProto
col.replace(/([.:\/\\])/g, function (a) {
if (a == '\\') {
a = '\/';
}
return `\\${a}`;
})}}line{font-family:\\00003${ctx.debugInfo.lineNumber}}}\n`;
} }
return result;
} }
export default debugInfo; export default debugInfo;
 End of changes. 6 change blocks. 
33 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)