Skip to content

Commit

Permalink
Clarify how values test they come from stores
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Feb 28, 2020
1 parent 051196a commit 008a3f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/api/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,15 @@ impl Val {
pub(crate) fn comes_from_same_store(&self, store: &Store) -> bool {
match self {
Val::FuncRef(f) => Store::same(store, f.store()),
_ => true,

// TODO: need to implement this once we actually finalize what
// `anyref` will look like and it's actually implemented to pass it
// to compiled wasm as well.
Val::AnyRef(_) => false,

// Integers have no association with any particular store, so
// they're always considered as "yes I came from that store",
Val::I32(_) | Val::I64(_) | Val::F32(_) | Val::F64(_) | Val::V128(_) => true,
}
}
}
Expand Down

0 comments on commit 008a3f6

Please sign in to comment.