Skip to content

Commit

Permalink
Enable all Wasm features in Validator
Browse files Browse the repository at this point in the history
fix #145

Enable all Wasm features in the `Validator` so we can use components
that rely on Wasm features that isn't enabled by default, such as `gc`.
  • Loading branch information
tanishiking committed Jan 6, 2025
1 parent d0eb3d4 commit 5309517
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions crates/wac-graph/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,10 +1225,7 @@ impl CompositionGraph {
let bytes = CompositionGraphEncoder::new(self).encode(options)?;

if options.validate {
Validator::new_with_features(WasmFeatures {
component_model: true,
..Default::default()
})
Validator::new_with_features(WasmFeatures::all())
.validate_all(&bytes)
.map_err(|e| EncodeError::ValidationFailure { source: e })?;
}
Expand Down
5 changes: 1 addition & 4 deletions crates/wac-types/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ impl Package {

let mut parser = Parser::new(0);
let mut parsers = Vec::new();
let mut validator = Validator::new_with_features(WasmFeatures {
component_model: true,
..Default::default()
});
let mut validator = Validator::new_with_features(WasmFeatures::all());
let mut imports = Vec::new();
let mut exports = Vec::new();

Expand Down

0 comments on commit 5309517

Please sign in to comment.