Skip to content

Commit 6c22d80

Browse files
authored
Enable all Wasm features in Validator (#146)
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`.
1 parent d0eb3d4 commit 6c22d80

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

crates/wac-graph/src/graph.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,12 +1225,9 @@ impl CompositionGraph {
12251225
let bytes = CompositionGraphEncoder::new(self).encode(options)?;
12261226

12271227
if options.validate {
1228-
Validator::new_with_features(WasmFeatures {
1229-
component_model: true,
1230-
..Default::default()
1231-
})
1232-
.validate_all(&bytes)
1233-
.map_err(|e| EncodeError::ValidationFailure { source: e })?;
1228+
Validator::new_with_features(WasmFeatures::all())
1229+
.validate_all(&bytes)
1230+
.map_err(|e| EncodeError::ValidationFailure { source: e })?;
12341231
}
12351232

12361233
Ok(bytes)

crates/wac-types/src/package.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ impl Package {
200200

201201
let mut parser = Parser::new(0);
202202
let mut parsers = Vec::new();
203-
let mut validator = Validator::new_with_features(WasmFeatures {
204-
component_model: true,
205-
..Default::default()
206-
});
203+
let mut validator = Validator::new_with_features(WasmFeatures::all());
207204
let mut imports = Vec::new();
208205
let mut exports = Vec::new();
209206

0 commit comments

Comments
 (0)