Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves 'compacting' code to 'properties' folder-space.
Why: * All those optimizations are dealing with properties so the new name better reflects its role; Also: * renames `overrideCompactor` to `overrideProperties`; * renames `compactorOptimize` to `optimizeProperties`. * cleans up property optimizing code calling from level 2 optimizations due to removal of aggressive merging, see #290.
- Loading branch information
1 parent
5be24e6
commit 6ff65e5
Showing
32 changed files
with
90 additions
and
115 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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var mergeIntoShorthands = require('./merge-into-shorthands'); | ||
var overrideProperties = require('./override-properties'); | ||
var populateComponents = require('./populate-components'); | ||
|
||
var restoreWithComponents = require('../restore-with-components'); | ||
|
||
var wrapForOptimizing = require('../../wrap-for-optimizing').all; | ||
var removeUnused = require('../../remove-unused'); | ||
var restoreFromOptimizing = require('../../restore-from-optimizing'); | ||
|
||
var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel; | ||
|
||
function optimizeProperties(properties, withOverriding, withMerging, context) { | ||
var _properties = wrapForOptimizing(properties, false); | ||
var _property; | ||
var i, l; | ||
|
||
populateComponents(_properties, context.validator, context.warnings); | ||
|
||
for (i = 0, l = _properties.length; i < l; i++) { | ||
_property = _properties[i]; | ||
if (_property.block) { | ||
optimizeProperties(_property.value[0][1], withOverriding, withMerging, context); | ||
} | ||
} | ||
|
||
if (withOverriding && context.options.level[OptimizationLevel.Two].mergeIntoShorthands) { | ||
overrideProperties(_properties, withMerging, context.options.compatibility, context.validator); | ||
} | ||
|
||
if (withMerging && context.options.level[OptimizationLevel.Two].mergeIntoShorthands) { | ||
mergeIntoShorthands(_properties, context.validator); | ||
} | ||
|
||
restoreFromOptimizing(_properties, restoreWithComponents); | ||
removeUnused(_properties); | ||
} | ||
|
||
module.exports = optimizeProperties; |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.