fix: pre-existing bug fixes in tree nodes#4414
Merged
matthew-dean merged 5 commits intoless:masterfrom Mar 10, 2026
Merged
Conversation
#0000 and #00000000 parsed alpha as 0 which was treated as falsy by the || operator, causing it to fall back to 1 (opaque). Use typeof check instead so alpha 0 is preserved.
- Capture `this._fileInfo` and `this.parse.imports` into locals before the plain function callback in Selector.getElements(), where `this` is undefined in strict mode (ES modules) - Use explicit block in forEach to avoid implicit return of assignment
The catch block in MixinCall.eval() only copied message and stack, dropping type, extract, callLine, and other LessError fields. This caused all mixin call errors to be reported as SyntaxError regardless of their actual type (e.g. NameError). Use spread to preserve all fields while still overriding index/filename to the call site.
- Container and Media eval() now guard functionRegistry before calling .inherit(), matching mixin-definition.js defensive pattern - AtRule constructor: remove dead setParent(selectors) on orphaned local, parent this.declarations and this.rules with null checks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#0000and#00000000parsed alpha as 0, treated as falsy by||, falling back to 1 (opaque). Fixed withtypeofcheck.thisbinding:getElements()callback used plainfunction()accessingthis._fileInfoandthis.parse.imports, butthisis undefined in strict mode (ES modules). Captured into locals.rules.forEach(rule => rule.merge = false)implicitly returned assignment value. Wrapped in block.MixinCall.eval()catch block only copiedmessage/stack, droppingtype,extract, and other LessError fields. Now uses spread to preserve all error context.Container.eval()andMedia.eval()called.inherit()unconditionally onfunctionRegistry. Added guard to matchmixin-definition.jspattern.setParent()on orphaned localselectorsvariable (dead code). Fixed to parentthis.declarationsandthis.rulesinstead.Test plan
#0000and#00000000test cases toalpha.less/alpha.cssdetached-ruleset-5.txtexpectation fromSyntaxErrortoNameError