0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

fix(core/print): flush stderr (#10480)

This commit is contained in:
Aaron O'Mullan 2021-05-03 14:51:32 +02:00 committed by GitHub
parent 688557e226
commit 3a37444cb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ use crate::resources::ResourceId;
use crate::Extension;
use crate::OpState;
use crate::ZeroCopyBuf;
use std::io::{stdout, Write};
use std::io::{stderr, stdout, Write};
pub(crate) fn init_builtins() -> Extension {
Extension::builder()
@ -64,7 +64,7 @@ pub fn op_print(
let (msg, is_err) = args;
if is_err {
eprint!("{}", msg);
stdout().flush().unwrap();
stderr().flush().unwrap();
} else {
print!("{}", msg);
stdout().flush().unwrap();