From f66d6e37f27d551467f0608178b79dd960ed7446 Mon Sep 17 00:00:00 2001 From: Xuan Huang Date: Fri, 26 Mar 2021 14:05:55 -0700 Subject: [PATCH] Canary Hermes for-of Summary: This diff canary Hermes for-of by conditionalizing the `babel/plugin-transform-for-of` transform Reviewed By: motiz88 Differential Revision: D27351717 fbshipit-source-id: 5758b6b578a864e189c533d8e1a874709c884514 --- packages/metro-react-native-babel-preset/src/configs/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bb4198fd58..be4246cf2c 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 (!isHermesCanary && hasForOf) { extraPlugins.push([ require('@babel/plugin-transform-for-of'), {loose: true},