diff --git a/src/asherah.cc b/src/asherah.cc index 95a3856..04ad56f 100644 --- a/src/asherah.cc +++ b/src/asherah.cc @@ -416,7 +416,7 @@ class Asherah : public Napi::Addon { try { NapiUtils::RequireParameterCount(info, 1); CobhanBufferNapi env_json(env, info[0]); - GoInt32 Result = ::SetEnv(env_json); + ::SetEnv(env_json); } catch (Napi::Error &e) { e.ThrowAsJavaScriptException(); return; diff --git a/src/asherah.d.ts b/src/asherah.d.ts index 2437ead..52b28f7 100644 --- a/src/asherah.d.ts +++ b/src/asherah.d.ts @@ -60,3 +60,4 @@ export declare function set_max_stack_alloc_item_size(max_item_size: number): vo export declare function set_safety_padding_overhead(safety_padding_overhead: number): void; export declare function set_log_hook(logHook: LogHookCallback): void; export declare function get_setup_status(): boolean; +export declare function setenv(environment: string): void; diff --git a/test/asherah.ts b/test/asherah.ts index 7023b40..ef00155 100644 --- a/test/asherah.ts +++ b/test/asherah.ts @@ -14,7 +14,8 @@ import { shutdown_async, get_setup_status, set_max_stack_alloc_item_size, - set_log_hook + set_log_hook, + setenv } from '../dist/asherah' import { assert } from 'chai'; @@ -92,6 +93,11 @@ export async function asherah_setup_static_memory_async(verbose = false, session } } +export async function asherah_set_env(): Promise { + const myString = '{"VAR": "VAL"}'; + setenv(myString); +} + export function asherah_shutdown(): void { shutdown(); }