diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/build.rs | 3 | ||||
-rw-r--r-- | cli/tests/unit/dispatch_json_test.ts | 18 |
2 files changed, 4 insertions, 17 deletions
diff --git a/cli/build.rs b/cli/build.rs index b23035717..ef6e03503 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -8,6 +8,7 @@ use deno_core::JsRuntime; use deno_core::RuntimeOptions; use regex::Regex; use serde::Deserialize; +use serde_json::Value; use std::collections::HashMap; use std::env; use std::path::Path; @@ -142,7 +143,7 @@ fn create_compiler_snapshot( }); js_runtime.register_op( "op_build_info", - json_op_sync(move |_state, _args, _bufs| { + json_op_sync(move |_state, _args: Value, _bufs| { Ok(json!({ "buildSpecifier": build_specifier, "libs": build_libs, diff --git a/cli/tests/unit/dispatch_json_test.ts b/cli/tests/unit/dispatch_json_test.ts index 1288384e3..c283e20c9 100644 --- a/cli/tests/unit/dispatch_json_test.ts +++ b/cli/tests/unit/dispatch_json_test.ts @@ -21,22 +21,8 @@ unitTest(function malformedJsonControlBuffer(): void { unitTest(function invalidPromiseId(): void { const opId = Deno.core.ops()["op_open_async"]; - const argsObj = { - promiseId: "1. NEIN!", - path: "/tmp/P.I.S.C.I.X/yeah", - mode: 0o666, - options: { - read: true, - write: true, - create: true, - truncate: false, - append: false, - createNew: false, - }, - }; - const argsText = JSON.stringify(argsObj); - const argsBuf = new TextEncoder().encode(argsText); - const resBuf = Deno.core.send(opId, argsBuf); + const reqBuf = new Uint8Array([0, 0, 0, 0, 0, 0, 0]); + const resBuf = Deno.core.send(opId, reqBuf); const resText = new TextDecoder().decode(resBuf); const resObj = JSON.parse(resText); console.error(resText); |