Skip to content

Commit

Permalink
Move markEs6FeaturesNotRequiringTranspilationAsRemoved pass post norm…
Browse files Browse the repository at this point in the history
…alization

PiperOrigin-RevId: 636431354
  • Loading branch information
rishipal authored and Copybara-Service committed May 23, 2024
1 parent c27f4e5 commit 824c0d9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/com/google/javascript/jscomp/TranspilationPasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ public static void addEarlyOptimizationTranspilationPasses(
if (options.needsTranspilationOf(Feature.EXPONENT_OP)) {
passes.maybeAdd(rewriteExponentialOperator);
}
}

/**
* Adds transpilation passes that should not be run until after normalization has been done.
* Passes added in this method either use {@code TranspilationPasses.processTranspile} or
* early-exit by checking their feature in the script's featureset. So they will only get run if
* the feature they're responsible for removing exists in the script.
*/
public static void addPostNormalizationTranspilationPasses(
PassListBuilder passes, CompilerOptions options) {
// TODO(b/197349249): Move passes from `addEarlyOptimizationTranspilationPasses()` to here
// until that method can be deleted as a no-op.

if (options.needsTranspilationFrom(
FeatureSet.BARE_MINIMUM.with(
Expand All @@ -186,18 +198,6 @@ public static void addEarlyOptimizationTranspilationPasses(
Feature.REGEXP_FLAG_U,
Feature.REGEXP_FLAG_Y));
}
}

/**
* Adds transpilation passes that should not be run until after normalization has been done.
* Passes added in this method either use {@code TranspilationPasses.processTranspile} or
* early-exit by checking their feature in the script's featureset. So they will only get run if
* the feature they're responsible for removing exists in the script.
*/
public static void addPostNormalizationTranspilationPasses(
PassListBuilder passes, CompilerOptions options) {
// TODO(b/197349249): Move passes from `addEarlyOptimizationTranspilationPasses()` to here
// until that method can be deleted as a no-op.

// TODO(b/329447979): Merge this with another pass and delete this pass.
if (options.needsTranspilationOf(Feature.EXTENDED_OBJECT_LITERALS)) {
Expand Down

0 comments on commit 824c0d9

Please sign in to comment.