-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Less_Parser: Remove dead code in getVariables() and improve test cove…
…rage Test: * It doesn't actually return native float or int for whole numbers. The test was fooling itself because it used arrayEquals() instead of arraySame(), which allows '123' to equal 123.0. The number is actually returned as a string in this case. * Add test where the value is really returned as a native number. * Add test for array. Code: * This method is part of our own API, and not ported from Less.js, so we have a bit more freedom over its implementation to make sense for us. * Remove "else if instanceof Less_Tree_Comment" branch, because it is impossible to reach. The in_array check already excludes where get_class() === Less_Tree_Comment. This would also explain the lack of code coverage https://doc.wikimedia.org/cover/mediawiki-libs-less.php/Parser.php.html#285 * Remove redundant "not_variable_type" check because the loop already does `if instanceof Less_Tree_Declaration" which thus excludes all others. None of the entries in not_variable_type where subclasses of Less_Tree_Declaration, so it's not there for that reason, either. Change-Id: I42fc406e64157432e99f822ca15c8d9eb8986e3f
- Loading branch information
Showing
3 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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