summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-05-15 15:22:57 +0200
committerGitHub <noreply@github.com>2021-05-15 15:22:57 +0200
commitd059f9b06ef468c7f4a279d0866dd53ea420c845 (patch)
tree54b266ed73e572378d5945719c95996335cbd523
parent808226f1106b31e1a5755a4f66ee1c95589dac90 (diff)
cleanup(core): flatten print's op args (#10643)
-rw-r--r--core/core.js2
-rw-r--r--core/ops_builtin.rs5
2 files changed, 3 insertions, 4 deletions
diff --git a/core/core.js b/core/core.js
index f0933d034..32ff7758e 100644
--- a/core/core.js
+++ b/core/core.js
@@ -129,7 +129,7 @@
}
function print(str, isErr = false) {
- opSync("op_print", [str, isErr]);
+ opSync("op_print", str, isErr);
}
// Provide bootstrap namespace
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index 023edc60e..ea539bc0a 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -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();