From e2a91190c38f494c2666d3362d247f698718d2f8 Mon Sep 17 00:00:00 2001 From: Inteon <42113979+inteon@users.noreply.github.com> Date: Tue, 16 Feb 2021 14:20:21 +0100 Subject: feat: add structured cloning to Deno.core (#9458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds two new "Deno.core" APIs: - "Deno.core.serialize" - "Deno.core.deserialize" These APIs are used to provide structured cloning of values and will be used for further web worker implementation. Co-authored-by: Bartek IwaƄczuk --- core/runtime.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/runtime.rs') diff --git a/core/runtime.rs b/core/runtime.rs index 05d76b4d5..9db1669cd 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -2038,6 +2038,22 @@ pub mod tests { }); } + #[test] + fn test_serialize_deserialize() { + run_in_task(|mut cx| { + let (mut runtime, _dispatch_count) = setup(Mode::Async); + runtime + .execute( + "serialize_deserialize_test.js", + include_str!("serialize_deserialize_test.js"), + ) + .unwrap(); + if let Poll::Ready(Err(_)) = runtime.poll_event_loop(&mut cx) { + unreachable!(); + } + }); + } + #[test] fn will_snapshot() { let snapshot = { -- cgit v1.2.3