Skip to content

Commit

Permalink
Revert "refactor(ses): update AsyncGeneratorFunctionInstance export"
Browse files Browse the repository at this point in the history
This reverts commit e4af84a.
  • Loading branch information
leotm committed Aug 21, 2024
1 parent a6c0300 commit bea3ad4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/ses/src/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,14 @@ export const FERAL_STACK_GETTER = feralStackGetter;
export const FERAL_STACK_SETTER = feralStackSetter;

// Test for async generator function syntax support.
// eslint-disable-next-line import/no-mutable-exports
let AsyncGeneratorFunctionInstance;
let AsyncGeneratorNewFunctionInstance;
try {
// Wrapping one in an new Function lets the `hermesc` binary file
// parse the Metro js bundle without SyntaxError, to generate the
// optimised Hermes bytecode bundle, when `gradlew` is called to
// assemble the release build APK for React Native prod Android apps.
// Delaying the error until runtime lets us customise lockdown behaviour.
AsyncGeneratorFunctionInstance = new FERAL_FUNCTION(
AsyncGeneratorNewFunctionInstance = new FERAL_FUNCTION(
'return (async function* AsyncGeneratorFunctionInstance() {})',
)();
} catch (e) {
Expand All @@ -382,4 +381,4 @@ try {
throw e;
}
}
export { AsyncGeneratorFunctionInstance };
export const AsyncGeneratorFunctionInstance = AsyncGeneratorNewFunctionInstance;

0 comments on commit bea3ad4

Please sign in to comment.