From 9cad9d8d72caad34ba8e10ae6371382ed18aa126 Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Sat, 15 Jun 2024 22:07:33 -1000 Subject: [PATCH] Readonly field --- src/NodeApi/Interop/JSCollectionExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()