Commit Graph

13 Commits

Author SHA1 Message Date
Tobias Koppers 27cc834a49 evaluate some identifiers to truthy values
fixes #4596
2017-06-02 13:24:47 +02:00
Tim Sebastian d056ba7d40 extract `buildExpression` to ParserHelpers.addParsedVariableToModule
rewrite affected modules
2017-02-25 00:26:07 +11:00
Tim Sebastian 288c7b07f7 add missing semicolons 2017-01-21 13:51:35 +11:00
Tim Sebastian 759f738780 split "ParserHelpers.returnTrue" into two more semnantically appropriate methods
- skipTraversal if a "return true" indicates to break walking
- approve if "return true" means to approve a "parse request" such as "can-rename"
2017-01-21 13:51:35 +11:00
Tim Sebastian 8e896d7cdd improve anonymous function naming
the initial method does not need really another name
2017-01-21 13:51:35 +11:00
Tim Sebastian 58e7a2f30b add simple returnTrue helper, less function definitions 2017-01-21 13:51:35 +11:00
Tim Sebastian b0665075da do not implicitly stringify values for `toConstantDependency`
changes usages of toConstantDependency so far
2017-01-21 13:44:10 +11:00
Tim Sebastian afac22f058 introduce ParserHelper.evaluateToBoolean
convert all usages of new BasicEvaluatedExpression().setBoolean to ParserHelper.evaluateToBoolean
2017-01-21 13:41:19 +11:00
Tim Sebastian d43cbbd499 refactor setTypeOf to more atomic helper methods
- reduces sideeffects as parser is called outside of helper
- allows better reuse
2017-01-21 13:38:54 +11:00
Tim Sebastian 086bd9db79 add ParserHelpers.expressionIsUnsupported method 2017-01-21 13:38:53 +11:00
Tim Sebastian e5c8525fdb introduce setTypeof helper to ParserHelpers 2017-01-21 13:38:53 +11:00
Tim Sebastian b07a82914b rename ModuleParserHelpers to ParserHelpers
- rename module and file from ModuleParserHelpers to ParserHelpers
- change imports and usages
- rename addParsedVariable to addParsedVariableToModule to add module context again
2017-01-21 13:38:53 +11:00
timse 86c00207bd Extract to parser helpers (#3843)
* rename ModuleParserHelpers to ParserHelpers

- rename module and file from ModuleParserHelpers to ParserHelpers
- change imports and usages
- rename addParsedVariable to addParsedVariableToModule to add module context again

* introduce setTypeof helper to ParserHelpers

* switch setTypeof in amdplugin - use ParsersHelpers instead

* switch setTypeof in CommonJsPlugin - use ParsersHelpers instead

* switch setTypeof in SystemPlugin - use ParsersHelpers instead

* add ParserHelpers.expressionIsUnsupported method

* use ParserHelpers.expressionIsUnsupported in SystemPlugin and NodeStuffPlugin

* refactor setTypeOf to more atomic helper methods

- reduces sideeffects as parser is called outside of helper
- allows better reuse

* use ParserHelper on more pieces in CommonJsPlugin making BasicEvaluatedExpression obsolete

* switch new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) in dependencies to ParserHelpers

* switch other new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) to ParserHelpers

* rename wrongly named function - name anonymous functions
2017-01-08 12:11:26 -06:00