Skip to content
File

Blob: src/workerd/api/tests/streams-circ-ref-regression-test.js

javascript19 lines
1// Copyright (c) 2025 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4import _fs from 'node:fs';
5import { Duplex } from 'node:stream';
6 
7// If the test doesn't crash, it passes. There was a bug carried over from
8// the old original readable-streams module that didn't translate well from
9// the original CommonJS code to the ESM code, leading to a difference in
10// behavior when dealing with a circular reference depending on the order
11// in which the individual modules were imported.
12 
13export const circTest = {
14 test() {
15 const duplex = new Duplex();
16 duplex.destroy();
17 },
18};