diff --git a/kits/javascript/src/bindings.rs b/kits/javascript/src/bindings.rs index c9a73831..3d777bb5 100644 --- a/kits/javascript/src/bindings.rs +++ b/kits/javascript/src/bindings.rs @@ -107,9 +107,13 @@ pub fn load_bindings_into_global( } } }) - .map_err(|_| RuntimeError::InvalidBinding("send_http_request".to_string()))?, + .map_err(|_| RuntimeError::InvalidBinding { + invalid_export: "send_http_request".to_string(), + })?, ) - .map_err(|_| RuntimeError::InvalidBinding("send_http_request".to_string()))?; + .map_err(|_| RuntimeError::InvalidBinding { + invalid_export: "send_http_request".to_string(), + })?; global .set_property( @@ -122,9 +126,13 @@ pub fn load_bindings_into_global( Ok(JSValue::Null) }) - .map_err(|_| RuntimeError::InvalidBinding("console_log".to_string()))?, + .map_err(|_| RuntimeError::InvalidBinding { + invalid_export: "console_log".to_string(), + })?, ) - .map_err(|_| RuntimeError::InvalidBinding("console_log".to_string()))?; + .map_err(|_| RuntimeError::InvalidBinding { + invalid_export: "console_log".to_string(), + })?; Ok(()) } diff --git a/kits/javascript/src/error.rs b/kits/javascript/src/error.rs index 528037c1..8d234785 100644 --- a/kits/javascript/src/error.rs +++ b/kits/javascript/src/error.rs @@ -3,5 +3,5 @@ /// List of runtime errors pub enum RuntimeError { - InvalidBinding(String), + InvalidBinding { invalid_export: String }, } diff --git a/kits/javascript/src/main.rs b/kits/javascript/src/main.rs index 65579bee..d74c2d4d 100644 --- a/kits/javascript/src/main.rs +++ b/kits/javascript/src/main.rs @@ -43,8 +43,8 @@ fn main() { Ok(_) => {} Err(e) => match e { // In the future we may have more errors. - error::RuntimeError::InvalidBinding(name) => { - eprintln!("There was an error adding the '{name}' binding"); + error::RuntimeError::InvalidBinding { invalid_export } => { + eprintln!("There was an error adding the '{invalid_export}' binding"); } }, } diff --git a/kits/javascript/wasm-workers-quick-js-engine.wasm b/kits/javascript/wasm-workers-quick-js-engine.wasm index 367f112d..26f15970 100755 Binary files a/kits/javascript/wasm-workers-quick-js-engine.wasm and b/kits/javascript/wasm-workers-quick-js-engine.wasm differ