Skip to content

Commit 64f5a0f

Browse files
committed
Use Symbol for closing steps
1 parent 172037a commit 64f5a0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

reference-implementation/lib/abstract-ops/queue-with-sizes.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ exports.PeekQueueValue = container => {
3939
return pair.value;
4040
};
4141

42+
const closingStepsSymbol = Symbol('closing-steps');
43+
4244
exports.ResetQueue = container => {
4345
assert('_queue' in container && '_queueTotalSize' in container);
4446

4547
if (container._isOwning) {
4648
while (container._queue.length > 0) {
4749
const value = exports.DequeueValue(container);
48-
if (typeof value.close === 'function') {
50+
if (typeof value[closingStepsSymbol] === 'function') {
4951
try {
50-
value.close();
52+
value[closingStepsSymbol]();
5153
} catch (closeException) {
5254
// Nothing to do.
5355
}

0 commit comments

Comments
 (0)