forked from TypeStrong/ts-node-repros
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add reproducer for TypeStrong/ts-node#1380
- Loading branch information
1 parent
7d52acc
commit dd8c11c
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
console.log('Some .ts code reproducing a bug'); | ||
// Note: the segfault is random, so we have to run this multiple time | ||
import { AsyncLocalStorage } from 'async_hooks'; | ||
const asyncStore = new AsyncLocalStorage; | ||
function sleep(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)) } | ||
for(let i = 0; i < 1000; ++i) { | ||
asyncStore.run(() => {}, async() => { | ||
// may need to vary the delay depending on where this is running | ||
await sleep(Math.random() * 100); | ||
process.exit(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters