1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05: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::Extension;
use crate::OpState; use crate::OpState;
use crate::ZeroCopyBuf; use crate::ZeroCopyBuf;
use std::io::{stdout, Write}; use std::io::{stderr, stdout, Write};
pub(crate) fn init_builtins() -> Extension { pub(crate) fn init_builtins() -> Extension {
Extension::builder() Extension::builder()
@ -64,7 +64,7 @@ pub fn op_print(
let (msg, is_err) = args; let (msg, is_err) = args;
if is_err { if is_err {
eprint!("{}", msg); eprint!("{}", msg);
stdout().flush().unwrap(); stderr().flush().unwrap();
} else { } else {
print!("{}", msg); print!("{}", msg);
stdout().flush().unwrap(); stdout().flush().unwrap();