private static HotSwapPassFactory createFeatureRemovalPass ( String passName , final Feature featureToRemove , final Feature ... moreFeaturesToRemove ) { return new HotSwapPassFactory ( passName ) { @ Override protected HotSwapCompilerPass create ( final AbstractCompiler compiler ) { return new HotSwapCompilerPass ( ) { @ Override public void hotSwapScript ( Node scriptRoot , Node originalRoot ) { maybeMarkFeaturesAsTranspiledAway ( compiler , featureToRemove , moreFeaturesToRemove ) ; } @ Override public void process ( Node externs , Node root ) { maybeMarkFeaturesAsTranspiledAway ( compiler , featureToRemove , moreFeaturesToRemove ) ; } } ; } @ Override protected FeatureSet featureSet ( ) { return FeatureSet . latest ( ) ; } } ; }
Returns a pass that just removes features from the AST FeatureSet .