diff --git a/src/NodeApi/Interop/JSCollectionExtensions.cs b/src/NodeApi/Interop/JSCollectionExtensions.cs index ab97ab5a..feac8a2d 100644 --- a/src/NodeApi/Interop/JSCollectionExtensions.cs +++ b/src/NodeApi/Interop/JSCollectionExtensions.cs @@ -198,8 +198,8 @@ internal sealed class JSAsyncIterableEnumerator : IAsyncEnumerator, IDispo { private readonly JSValue.To _fromJS; private readonly JSReference _iteratorReference; + private readonly CancellationToken _cancellation; private JSReference? _currentReference; - private CancellationToken _cancellation; internal JSAsyncIterableEnumerator( JSValue iterable, @@ -208,8 +208,8 @@ internal JSAsyncIterableEnumerator( { _fromJS = fromJS; _iteratorReference = new JSReference(iterable.CallMethod(JSSymbol.AsyncIterator)); - _currentReference = null; _cancellation = cancellation; + _currentReference = null; } public async ValueTask MoveNextAsync()