Bug Description
Hermes suppresses async generators are unsupported errors in imported files
|
if (compile_ && ESTree::isAsync(node) && ESTree::isGenerator(node)) { |
|
sm_.error(node->getSourceRange(), "async generators are unsupported"); |
|
} |
OS: Android, iOS
Platform : arm64-v8a (macOS, M2)
Steps To Reproduce
npx react-native@latest init RN07119 --version 0.71.19
npx react-native@latest init RN07214 --version 0.72.14
// file.cjs
async function* foo() {
yield await Promise.resolve('a');
yield await Promise.resolve('b');
yield await Promise.resolve('c'); // remove this yield to see error in sim/emu
};
function bar() {}; // remove this fn to see error in sim/emu
// Try this example wrapped in a new Function(String.raw``)() to see error
// Hot reload any change to see error in Metro
// [Error: Exception in HostFunction: Compiling JS failed: 2:3:async generators are unsupported Buffer size 665 starts with: 5f5f642866756e6374696f6e2028676c]
// babel.config.js
module.exports = {
ignore: [/file\.cjs/],
presets: ['module:metro-react-native-babel-preset'],
};
// e.g. index.js, App.tsx, node_modules/react-native/Libraries/Core/InitializeCore.js
require('./file.cjs');
The Expected Behavior
Error async generators are unsupported (Android, iOS)
Bug Description
Hermes suppresses
async generators are unsupportederrors in imported fileshermes/lib/AST/SemanticValidator.cpp
Lines 798 to 800 in 7991309
OS: Android, iOS
Platform : arm64-v8a (macOS, M2)
Steps To Reproduce
npx react-native@latest init RN07119 --version 0.71.19npx react-native@latest init RN07214 --version 0.72.14The Expected Behavior
Error
async generators are unsupported(Android, iOS)