Skip to content

Commit

Permalink
Fixes less#3574
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-dean committed Dec 17, 2020
1 parent 5423802 commit 458cf99
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/less/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/less/src/less/import-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default function(environment) {
} else if (importOptions.inline) {
fileParsedFunc(null, contents, resolvedFilename);
} else {

// import (multiple) parse trees apparently get altered and can't be cached.
// TODO: investigate why this is
if (importManager.files[resolvedFilename]
Expand Down
1 change: 0 additions & 1 deletion packages/less/src/less/parse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
let PromiseConstructor;
import contexts from './contexts';
import Parser from './parser/parser';
import PluginManager from './plugin-manager';
Expand Down
1 change: 0 additions & 1 deletion packages/less/src/less/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
let PromiseConstructor;
import * as utils from './utils';

export default (environment, ParseTree, ImportManager) => {
Expand Down
6 changes: 5 additions & 1 deletion packages/less/src/less/source-map-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ export default environment => {
inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
}

// ignore empty content
/**
* ignore empty content, or failsafe
* if contents map is incorrect
*/
if (inputSource === undefined) {
this._css.push(chunk);
return;
}

Expand Down
5 changes: 3 additions & 2 deletions packages/less/src/less/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* jshint proto: true */
import * as Constants from './constants';
import { copy } from 'copy-anything';

export function getLocation(index, inputStream) {
let n = index + 1;
Expand Down Expand Up @@ -45,9 +46,9 @@ export function defaults(obj1, obj2) {
let newObj = obj2 || {};
if (!obj2._defaults) {
newObj = {};
const defaults = {...obj1};
const defaults = copy(obj1);
newObj._defaults = defaults;
const cloned = obj2 ? {...obj2} : {};
const cloned = obj2 ? copy(obj2) : {};
Object.assign(newObj, defaults, cloned);
}
return newObj;
Expand Down

0 comments on commit 458cf99

Please sign in to comment.