[TS] Drop InternalUtils as they are now called via bindings.
authorMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 05:35:54 +0000 (05:35 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 10 Jan 2022 06:33:14 +0000 (06:33 +0000)
ts/InternalUtils.mts [deleted file]
typescript_strings.py

diff --git a/ts/InternalUtils.mts b/ts/InternalUtils.mts
deleted file mode 100644 (file)
index 33f0235..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-export function check_arr_len(arr: Uint8Array, len: number): Uint8Array {
-       if (arr.length != len) { throw new Error("Expected array of length " + len + "got " + arr.length); }
-       return arr;
-}
\ No newline at end of file
index 03804e5fe1780e719d22922ff6b816dd6215b0e7..462a77fe951a135ab20a8727b5a0b2ebb9d19938 100644 (file)
@@ -290,7 +290,6 @@ void __attribute__((export_name("TS_free"))) TS_free(uint32_t ptr) {
         self.hu_struct_file_prefix = """
 import CommonBase from './CommonBase.mjs';
 import * as bindings from '../bindings.mjs'
-import * as InternalUtils from '../InternalUtils.mjs'
 
 """
         self.util_fn_pfx = self.hu_struct_file_prefix + "\nexport class UtilMethods extends CommonBase {\n"
@@ -304,12 +303,6 @@ import * as InternalUtils from '../InternalUtils.mjs'
         self.is_arr_some_check = ("", " != 0")
         self.get_native_arr_len_call = ("", "->arr_len")
 
-        with open(outdir + "/InternalUtils.mts", "w") as f:
-            f.write("export function check_arr_len(arr: Uint8Array, len: number): Uint8Array {\n")
-            f.write("\tif (arr.length != len) { throw new Error(\"Expected array of length \" + len + \"got \" + arr.length); }\n")
-            f.write("\treturn arr;\n")
-            f.write("}")
-
     def release_native_arr_ptr_call(self, ty_info, arr_var, arr_ptr_var):
         return None
     def create_native_arr_call(self, arr_len, ty_info):