From 51718cd9b817553e96a97e7f9fcd1c94aa11e6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Basile=20Cl=C3=A9ment?= Date: Mon, 16 Oct 2023 15:25:18 +0200 Subject: [PATCH] Add ml_z_extract_small JS stub ml_z_extract_small was added as a fast path in ZArith 1.13. It is not (yet) supported by zarith_stubs_js. Since it is a fast path for ml_z_extract, we can simply call ml_z_extract in missing_primitives.js for the time being. Fixes #895 --- src/lib/missing_primitives.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/missing_primitives.js b/src/lib/missing_primitives.js index 7cec671ea..a2437e579 100644 --- a/src/lib/missing_primitives.js +++ b/src/lib/missing_primitives.js @@ -39,3 +39,11 @@ function unix_getpid() { function unix_kill() { return 0; } + +// Fast path in ZArith 1.13, not in zarith_stubs_js +// https://github.com/janestreet/zarith_stubs_js/issues/10 +// Provides: ml_z_extract_small +// Requires: ml_z_extract +function ml_z_extract_small(z1, pos, len) { + return ml_z_extract(z1, pos, len); +}