-
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.
Parser,Environment: Reduce various internal use of static state
This is not a port of any specific upstream Less.js changes. For many years, whenever we ported upstream changes in Parser or Envirnment, we mapped the logic onto static equivalents, to keep the changes simpler. However, upstream is now for the most part based on instance state and by-reference objects. This hasn't yet caused any obvious bugs, but it does decrease confidence in how things work, and it makes some big changes part of T353133 difficult to port. This patchs should help prevent future bugs as result from upcoming porting commits by re-synchronising the code to match upstream not just in how the code looks, but also in the behaviour (instance vs static). Sync with Less.js: * Manage math state in Less_Environment object, instead of modifying Less_Parser::$options or Less_Environment::$mathOn. * Manage list of imported files in Less_Environment object. In Less.js, this is kept in the ImportVisitor, but we haven't implemented that yet. I'm leaving that for a future change by Hannah, and now only moving it away from static state as first step. Also: * Move SetOptions() in Less_Parser::__construct to Reset(). This was causing a problem because $this->env is not yet defined during that call. Without this, SetOption() can't pass strictMath to Less_Environment. Bug: T353133 Change-Id: If4a0a7ce052fb378f078e767fdb7449bd7e78de2
- Loading branch information
Showing
14 changed files
with
80 additions
and
59 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
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
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
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
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