Skip to content

Commit 4c34884

Browse files
committed
add a fallback for regenerator transform
1 parent 75e66f2 commit 4c34884

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/helpers/qunit-helpers.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import Symbol from '@core-js/pure/es/symbol';
2+
import globalThis from '@core-js/pure/es/global-this';
13
import assign from '@core-js/pure/es/object/assign';
24
import isIterable from '@core-js/pure/es/is-iterable';
3-
import ASYNC_ITERATOR from '@core-js/pure/es/symbol/async-iterator';
45
import { is, arrayFromArrayLike } from './helpers.js';
56

7+
// for Babel / Regenerator runtime
8+
if (!globalThis.Symbol || [][globalThis.Symbol.iterator] !== [][Symbol.iterator]) globalThis.Symbol = Symbol;
9+
610
const { getOwnPropertyDescriptor, getOwnPropertyNames } = Object;
711
const { toString, propertyIsEnumerable } = Object.prototype;
812

@@ -46,7 +50,7 @@ assign(assert, {
4650
},
4751
isAsyncIterable(actual, message = 'The value is async iterable') {
4852
this.pushResult({
49-
result: typeof actual == 'object' && typeof actual[ASYNC_ITERATOR] == 'function',
53+
result: typeof actual == 'object' && typeof actual[Symbol.asyncIterator] == 'function',
5054
actual,
5155
expected: 'The value should be async iterable',
5256
message,

0 commit comments

Comments
 (0)