Skip to content

Commit

Permalink
fix(ses): update console to print for Hermes VM
Browse files Browse the repository at this point in the history
  • Loading branch information
leotm committed Sep 9, 2024
1 parent e4a4f8c commit 63645cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/ses/src/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,14 @@ try {
} catch (e) {
if (e.name === 'SyntaxError') {
// Swallows Hermes error `async generators are unsupported` at runtime.
// eslint-disable-next-line @endo/no-polymorphic-call
console.info('skipping async generators');
// @ts-ignore
// eslint-disable-next-line no-undef
print('SES: Skipping async generators, unsupported on Hermes');
// Note: `console` is not a JS built-in, so Hermes engine throws:
// Uncaught ReferenceError: Property 'console' doesn't exist
// See: https://github.com/facebook/hermes/issues/675
// However React Native provides a `console` implementation:
// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/InitializeCore.js
} else {
throw e;
}
Expand Down

0 comments on commit 63645cf

Please sign in to comment.