Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining calls behave differently than separete statements #471

Closed
typeless opened this issue Apr 1, 2024 · 1 comment · Fixed by #472
Closed

Chaining calls behave differently than separete statements #471

typeless opened this issue Apr 1, 2024 · 1 comment · Fixed by #472

Comments

@typeless
Copy link

typeless commented Apr 1, 2024

(async () => {
    console.log('Hello');
    //const proc = tjs.spawn(['/usr/bin/uname', '-a']);
    //const status = await proc.wait();
    const status = await tjs.spawn(['/usr/bin/uname', '-a']).wait();
    console.log(`World! status=${status.exit_status}`);
})();

prints only

Hello
Linux builder 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

But when replacing const status = await tjs.spawn(['/usr/bin/uname', '-a']).wait(); with the commented lines, the last log would be printed as expected.

Not sure if this is a duplicate of #450

@typeless typeless changed the title Chaining calls behave differents than separete call statements Chaining calls behave differently than separete call statements Apr 1, 2024
@typeless typeless changed the title Chaining calls behave differently than separete call statements Chaining calls behave differently than separete statements Apr 1, 2024
@saghul
Copy link
Owner

saghul commented Apr 1, 2024

That's different I think. Thanks for the report, I'll look into it!

saghul added a commit that referenced this issue Apr 2, 2024
Keep the object alive until the process exit callback has been closed,
which is guaranteed.

Fixes: #471
saghul added a commit that referenced this issue Apr 2, 2024
Keep the object alive until the process exit callback has been closed,
which is guaranteed.

Fixes: #471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants