From 31375f760467096f9747c9596d83b05f4ecbec92 Mon Sep 17 00:00:00 2001 From: Xuan Huang Date: Tue, 6 Apr 2021 12:53:44 -0700 Subject: [PATCH] Move for-of and ?? to hermes stable Summary: Title says it all. Reviewed By: avp Differential Revision: D27580110 fbshipit-source-id: cfee48ea8bfd68476b335194f717f0ae42d10ff3 --- packages/metro-react-native-babel-preset/src/configs/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/metro-react-native-babel-preset/src/configs/main.js b/packages/metro-react-native-babel-preset/src/configs/main.js index d6a3ee66b..5c76d1098 100644 --- a/packages/metro-react-native-babel-preset/src/configs/main.js +++ b/packages/metro-react-native-babel-preset/src/configs/main.js @@ -116,7 +116,7 @@ const getPreset = (src, options) => { if (!isHermes && (isNull || src.indexOf('Object.assign')) !== -1) { extraPlugins.push([require('@babel/plugin-transform-object-assign')]); } - if (hasForOf) { + if (!isHermes && hasForOf) { extraPlugins.push([ require('@babel/plugin-transform-for-of'), {loose: true}, @@ -135,7 +135,7 @@ const getPreset = (src, options) => { {loose: true}, ]); } - if (!isHermesCanary && (isNull || src.indexOf('??') !== -1)) { + if (!isHermes && (isNull || src.indexOf('??') !== -1)) { extraPlugins.push([ require('@babel/plugin-proposal-nullish-coalescing-operator'), {loose: true},