Skip to content

Commit

Permalink
Rename assert_uncaught_exception (#324)
Browse files Browse the repository at this point in the history
The assert_uncaught_exception assertion used for exception handling
was renamed to assert_exception in the final version of

  WebAssembly/exception-handling#160

but was out-of-date in the wast crate.
  • Loading branch information
takikawa committed Aug 21, 2021
1 parent 9f6c3aa commit 9b219d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/wast/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ pub mod kw {
custom_keyword!(anyref);
custom_keyword!(arg);
custom_keyword!(array);
custom_keyword!(assert_exception);
custom_keyword!(assert_exhaustion);
custom_keyword!(assert_invalid);
custom_keyword!(assert_malformed);
Expand All @@ -343,7 +344,6 @@ pub mod kw {
custom_keyword!(assert_return_func);
custom_keyword!(assert_trap);
custom_keyword!(assert_unlinkable);
custom_keyword!(assert_uncaught_exception);
custom_keyword!(before);
custom_keyword!(binary);
custom_keyword!(block);
Expand Down
10 changes: 5 additions & 5 deletions crates/wast/src/ast/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub enum WastDirective<'a> {
module: ast::Module<'a>,
message: &'a str,
},
AssertUncaughtException {
AssertException {
span: ast::Span,
exec: WastExecute<'a>,
},
Expand All @@ -112,7 +112,7 @@ impl WastDirective<'_> {
| WastDirective::AssertExhaustion { span, .. }
| WastDirective::AssertUnlinkable { span, .. }
| WastDirective::AssertInvalid { span, .. }
| WastDirective::AssertUncaughtException { span, .. } => *span,
| WastDirective::AssertException { span, .. } => *span,
WastDirective::Invoke(i) => i.span,
}
}
Expand Down Expand Up @@ -252,9 +252,9 @@ impl<'a> Parse<'a> for WastDirective<'a> {
module: parser.parens(|p| p.parse())?,
message: parser.parse()?,
})
} else if l.peek::<kw::assert_uncaught_exception>() {
let span = parser.parse::<kw::assert_uncaught_exception>()?.0;
Ok(WastDirective::AssertUncaughtException {
} else if l.peek::<kw::assert_exception>() {
let span = parser.parse::<kw::assert_exception>()?.0;
Ok(WastDirective::AssertException {
span,
exec: parser.parens(|p| p.parse())?,
})
Expand Down

0 comments on commit 9b219d5

Please sign in to comment.