Skip to content

Commit 4e11acb

Browse files
committed
feat: check all barebone engines for fake block-scoping
1 parent 357bd0d commit 4e11acb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bundler/modules/globals.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ if (!Array.prototype.at) {
6969
Object.defineProperty(Array.prototype, 'at', { configurable: true, writable: true, value: at })
7070
}
7171

72-
if (process.env.EXODUS_TEST_PLATFORM === 'hermes') {
72+
if (process.env.EXODUS_TEST_IS_BAREBONE) {
7373
// Refuse to run if block scoped vars are fake
7474
const r = []
7575
for (let i = 0; i < 2; i++) r.push(() => i)
7676
if (r[0]() === r[1]()) {
7777
print('‼ FATAL Fake block-scoped vars support detected')
7878
throw new Error('Refusing to run')
7979
}
80+
}
8081

82+
if (process.env.EXODUS_TEST_PLATFORM === 'hermes') {
8183
// Fixed after 0.12, not present in 0.12
8284
// Refs: https://github.com/facebook/hermes/commit/e8fa81328dd630e39975e6d16ac3e6f47f4cba06
8385
if (!Promise.allSettled) {

0 commit comments

Comments
 (0)