Skip to content

Commit

Permalink
Make everything multi-word
Browse files Browse the repository at this point in the history
  • Loading branch information
kajacx committed Jul 20, 2023
1 parent 839ae20 commit e373971
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
5 changes: 0 additions & 5 deletions crates/wasm-bridge-js/src/component/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,9 @@ impl<T> Linker<T> {
closures.push(drop_handler);
}

// let import_key = format!("imports.{instance_name}");

Reflect::set(&import_object, &instance_name.into(), &instance_obj).unwrap();
}

//helpers::console_log(&self.instances.keys());
crate::helpers::log_js_value("IMPORTS", &import_object);

let closures = Rc::from(closures);
component.instantiate(store, &import_object, closures)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/wit_components/enums/protocol.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:protocol
package component-test:wit-protocol

world enums {
// Variant enums
Expand Down
2 changes: 1 addition & 1 deletion tests/wit_components/errors/protocol.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:protocol
package component-test:wit-protocol

world errors {
enum where-fail {
Expand Down
8 changes: 4 additions & 4 deletions tests/wit_components/hello_wit/guest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ impl TestWorld for GuestImpl {
}
}

impl exports::test::protocol::guest::Guest for GuestImpl {
impl exports::component_test::wit_protocol::guest_add::GuestAdd for GuestImpl {
fn add_three(num: i32) -> i32 {
let num = test::protocol::host::add_one(num);
let num = test::protocol::host::add_one(num);
let num = test::protocol::host::add_one(num);
let num = component_test::wit_protocol::host_add::add_one(num);
let num = component_test::wit_protocol::host_add::add_one(num);
let num = component_test::wit_protocol::host_add::add_one(num);
num
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/wit_components/hello_wit/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl TestWorldImports for HostData {
}
}

impl test::protocol::host::Host for HostData {
impl component_test::wit_protocol::host_add::Host for HostData {
fn add_one(&mut self, num: i32) -> Result<i32> {
Ok(num + 1)
}
Expand Down Expand Up @@ -130,7 +130,7 @@ fn run_with_component(mut store: &mut Store<HostData>, component: &Component) ->
assert_eq!(result, (25, -15));

let result = instance
.test_protocol_guest()
.component_test_wit_protocol_guest_add()
.call_add_three(&mut store, 5)?;
assert_eq!(result, 8);

Expand Down
10 changes: 5 additions & 5 deletions tests/wit_components/hello_wit/protocol.wit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package test:protocol
package component-test:wit-protocol

interface host {
interface host-add {
add-one: func(num: s32) -> s32
}

interface guest {
interface guest-add {
add-three: func(num: s32) -> s32
}

Expand All @@ -18,8 +18,8 @@ world test-world {
import set-salary: func(emloyee: person, amount: u32) -> person
export promote-person: func(emloyee: person, raise: u32) -> person

import host
export guest
import host-add
export guest-add

import increment: func()
export increment-twice: func()
Expand Down
2 changes: 1 addition & 1 deletion tests/wit_components/lists/protocol.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:protocol
package component-test:wit-protocol

world lists {
import push-bool: func(bools: list<bool>, a: bool) -> list<bool>
Expand Down
2 changes: 1 addition & 1 deletion tests/wit_components/primitives/protocol.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test:protocol
package component-test:wit-protocol

world primitives {
import negate: func(value: bool) -> bool
Expand Down

0 comments on commit e373971

Please sign in to comment.