FeatureSet.TYPE_CHECK_SUPPORTED should include OBJECT_PATTERN_REST
Although it is an ES_2018 feature, OBJECT_PATTEN_REST is transpiled
by the same pass that handles ES6 destructuring features,
and the type check passes have been updated to handle it.
This change is needed before we can move the destructuring transpilation
pass after checks.
@@ -74,8 +74,10 @@ public final class FeatureSet implements Serializable {
public static final FeatureSet TYPESCRIPT = ES_NEXT.with(LangVersion.TYPESCRIPT.features());
+ // OBJECT_PATTERN_REST is a 2018 feature, but its transpilation is done by the same pass that
+ // handles the destructuring transpilation done for ES6.
public static final FeatureSet TYPE_CHECK_SUPPORTED =
- ES8.without(Feature.ASYNC_FUNCTIONS).without(Feature.MODULES);
+ ES8.without(Feature.ASYNC_FUNCTIONS).with(Feature.OBJECT_PATTERN_REST);
private enum LangVersion {
ES3,
