/** Returns a feature set combining all the features from {@code this} and {@code newFeatures}. */ @VisibleForTesting public FeatureSet with(Set<Feature> newFeatures) { return new FeatureSet(union(features, newFeatures)); }
/** Returns a feature set combining all the features from {@code this} and {@code newFeatures}. */ @VisibleForTesting public FeatureSet with(Feature... newFeatures) { return new FeatureSet(union(features, ImmutableSet.copyOf(newFeatures))); }
/** * Returns a new {@link FeatureSet} including all features of both {@code this} and {@code other}. */ public FeatureSet union(FeatureSet other) { return new FeatureSet(union(features, other.features)); }
/** Returns a feature set combining all the features from {@code this} and {@code newFeatures}. */ @VisibleForTesting public FeatureSet with(FeatureSet newFeatures) { return new FeatureSet(union(features, newFeatures.features)); }
IRFactory.transformTree(tree, sourceFile, sourceString, config, errorReporter); root = factory.getResultNode(); features = features.union(factory.getFeatures()); root.putProp(Node.FEATURE_SET, features);
newFeatures = behaviors.get(0).features; for (int i = 1; i < behaviors.size(); i++) { newFeatures = newFeatures.union(behaviors.get(i).features);
Node scriptNode = NodeUtil.getEnclosingScript(parent); FeatureSet oldFeatures = (FeatureSet) scriptNode.getProp(Node.FEATURE_SET); FeatureSet newFeatures = oldFeatures.union(cls.features); if (!newFeatures.equals(oldFeatures)) { scriptNode.putProp(Node.FEATURE_SET, newFeatures);