Skip to content

Commit

Permalink
fix(ses): commons async gen fn instance catch condition on Hermes VM
Browse files Browse the repository at this point in the history
  • Loading branch information
leotm committed Sep 23, 2024
1 parent 6e1cb49 commit f543b16
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/ses/src/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ const getAsyncGeneratorFunctionInstance = () => {
'return (async function* AsyncGeneratorFunctionInstance() {})',
)();
} catch (e) {
// @ts-expect-error ts(2339) Property 'jsEngine' does not exist on type 'Error'. However it exists on Hermes.
if (Error.prototype.jsEngine === 'hermes' && e.name === 'SyntaxError') {
if (e.name === 'SyntaxError') {
// Swallows Hermes error `async generators are unsupported` at runtime.
// @ts-expect-error ts(2554) Expected 0 arguments, but got 1. It refers to the Web API Window object, but on Hermes we expect 1 argument.
// eslint-disable-next-line no-undef
Expand Down

0 comments on commit f543b16

Please sign in to comment.