Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 31, 2024
1 parent ff1c5a4 commit 1098a57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use rquickjs::{Context, Function, Module, Object, Runtime};

use crate::{
error::{handle_promise_error, quickjs_call_with_error_handling},
ic, quickjs_with_ctx,
ic::register,
quickjs_with_ctx,
wasm_binary_manipulation::get_js_code,
CONTEXT_REF_CELL, MODULE_NAME,
};
Expand Down Expand Up @@ -39,7 +40,7 @@ fn initialize_and_get_candid() -> Result<CCharPtr, Box<dyn Error>> {

globals.set("_azleExperimental", false)?;

ic::register(ctx.clone())?;
register(ctx.clone())?;

let js = get_js_code();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Display;

use rquickjs::{Ctx, Error, Result, String};
use rquickjs::{Ctx, Error, Object, Result, String};

mod accept_message;
mod arg_data_raw;
Expand Down Expand Up @@ -46,7 +46,7 @@ mod trap;

#[allow(unused)]
pub fn register(ctx: Ctx) -> Result<()> {
let ic = rquickjs::Object::new(ctx.clone())?;
let ic = Object::new(ctx.clone())?;

ic.set("acceptMessage", accept_message::get_function(ctx.clone()))?;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{error::Error, str};
use std::{env, error::Error, str};

use ic_cdk::trap;
use ic_stable_structures::memory_manager::MemoryId;
Expand All @@ -8,7 +8,8 @@ use rquickjs::{Context, Module, Object, Runtime};
use crate::{
error::handle_promise_error,
execute_method_js::execute_method_js,
ic, quickjs_with_ctx,
ic::register,
quickjs_with_ctx,
wasm_binary_manipulation::{get_js_code, get_wasm_data},
CONTEXT_REF_CELL, MEMORY_MANAGER_REF_CELL, MODULE_NAME, WASM_DATA_REF_CELL,
};
Expand Down Expand Up @@ -77,7 +78,7 @@ pub fn initialize_js(

let env = Object::new(ctx.clone())?;

for (key, value) in std::env::vars() {
for (key, value) in env::vars() {
env.set(key, value)?;
}

Expand Down Expand Up @@ -109,7 +110,7 @@ pub fn initialize_js(

globals.set("_azleRecordBenchmarks", record_benchmarks)?;

ic::register(ctx.clone())?;
register(ctx.clone())?;

let promise = Module::evaluate(ctx.clone(), MODULE_NAME, js)?;

Expand Down

0 comments on commit 1098a57

Please sign in to comment.