cleanup(core): flatten print's op args (#10643)

This commit is contained in:
Aaron O'Mullan 2021-05-15 15:22:57 +02:00 committed by GitHub
parent 808226f110
commit d059f9b06e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -129,7 +129,7 @@
}
function print(str, isErr = false) {
opSync("op_print", [str, isErr]);
opSync("op_print", str, isErr);
}
// Provide bootstrap namespace

View file

@ -57,10 +57,9 @@ pub fn op_close(
/// Builtin utility to print to stdout/stderr
pub fn op_print(
_state: &mut OpState,
args: (String, bool),
_: (),
msg: String,
is_err: bool,
) -> Result<(), AnyError> {
let (msg, is_err) = args;
if is_err {
eprint!("{}", msg);
stderr().flush().unwrap();