From: Matt Corallo Date: Wed, 27 Jan 2021 23:13:42 +0000 (-0500) Subject: re-fix whitespace bugs X-Git-Tag: v0.0.1~33 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=8bc2f20781c249d8018a52a392cca25b4c98d15d;p=ldk-java re-fix whitespace bugs --- 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 = ""