From 8bc2f20781c249d8018a52a392cca25b4c98d15d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 27 Jan 2021 18:13:42 -0500 Subject: [PATCH] re-fix whitespace bugs --- typescript_strings.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/typescript_strings.py b/typescript_strings.py index 5e008a73..a8e9acdc 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -238,7 +238,7 @@ import * as bindings from '../bindings' // TODO: figure out location self.c_fn_args_pfx = "void* ctx_TODO" self.file_ext = ".ts" self.ptr_c_ty = "uint32_t" - self.ptr_native_ty = "uint32_t" + self.ptr_native_ty = "number" self.result_c_ty = "uint32_t" self.owned_str_to_c_call = ("conv_owned_string(", ")") self.ptr_arr = "ptrArray" @@ -905,14 +905,13 @@ const decodeString = (stringPointer, free = true) => { return_statement = f"return {converter}(nativeResponseValue);" out_java = f"""\texport function {method_name}({method_argument_string}): {return_type_info.java_ty} {{ - if(!isWasmInitialized){{ - throw new Error("initializeWasm() must be awaited first!"); - }} - const nativeResponseValue = wasm.{method_name}({native_call_argument_string}); - {return_statement}\n\t}} - \n""" - - + if(!isWasmInitialized) {{ + throw new Error("initializeWasm() must be awaited first!"); + }} + const nativeResponseValue = wasm.{method_name}({native_call_argument_string}); + {return_statement} + }} +""" if has_out_java_struct: out_java_struct = "" -- 2.30.2