Skip to content

Commit 80d837a

Browse files
committed
Rename assert_uncaught_exception
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.
1 parent 9f6c3aa commit 80d837a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/wast/src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ pub mod kw {
330330
custom_keyword!(anyref);
331331
custom_keyword!(arg);
332332
custom_keyword!(array);
333+
custom_keyword!(assert_exception);
333334
custom_keyword!(assert_exhaustion);
334335
custom_keyword!(assert_invalid);
335336
custom_keyword!(assert_malformed);
@@ -343,7 +344,6 @@ pub mod kw {
343344
custom_keyword!(assert_return_func);
344345
custom_keyword!(assert_trap);
345346
custom_keyword!(assert_unlinkable);
346-
custom_keyword!(assert_uncaught_exception);
347347
custom_keyword!(before);
348348
custom_keyword!(binary);
349349
custom_keyword!(block);

crates/wast/src/ast/wast.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub enum WastDirective<'a> {
9393
module: ast::Module<'a>,
9494
message: &'a str,
9595
},
96-
AssertUncaughtException {
96+
AssertException {
9797
span: ast::Span,
9898
exec: WastExecute<'a>,
9999
},
@@ -112,7 +112,7 @@ impl WastDirective<'_> {
112112
| WastDirective::AssertExhaustion { span, .. }
113113
| WastDirective::AssertUnlinkable { span, .. }
114114
| WastDirective::AssertInvalid { span, .. }
115-
| WastDirective::AssertUncaughtException { span, .. } => *span,
115+
| WastDirective::AssertException { span, .. } => *span,
116116
WastDirective::Invoke(i) => i.span,
117117
}
118118
}
@@ -252,9 +252,9 @@ impl<'a> Parse<'a> for WastDirective<'a> {
252252
module: parser.parens(|p| p.parse())?,
253253
message: parser.parse()?,
254254
})
255-
} else if l.peek::<kw::assert_uncaught_exception>() {
256-
let span = parser.parse::<kw::assert_uncaught_exception>()?.0;
257-
Ok(WastDirective::AssertUncaughtException {
255+
} else if l.peek::<kw::assert_exception>() {
256+
let span = parser.parse::<kw::assert_exception>()?.0;
257+
Ok(WastDirective::AssertException {
258258
span,
259259
exec: parser.parens(|p| p.parse())?,
260260
})

0 commit comments

Comments
 (0)