Skip to content

Commit 6797729

Browse files
authored
Remove support for relative-url=<...> (#1567)
Follows suit from WebAssembly/component-model#353
1 parent 28132cc commit 6797729

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

crates/wasmparser/src/validator/names.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ impl<'a> DependencyName<'a> {
568568
}
569569
}
570570

571-
/// A dependency on an implementation either as `url=...` or
572-
/// `relative-url=...`
571+
/// A dependency on an implementation either as `url=...`
573572
#[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
574573
pub struct UrlName<'a>(&'a str);
575574

@@ -649,17 +648,6 @@ impl<'a> ComponentNameParser<'a> {
649648
self.eat_optional_hash()?;
650649
return Ok(ParsedComponentNameKind::Url);
651650
}
652-
// 'relative-url=<' <nonbrackets> '>' (',' <hashname>)?
653-
if self.eat_str("relative-url=") {
654-
self.expect_str("<")?;
655-
let url = self.take_up_to('>')?;
656-
if url.contains('<') {
657-
bail!(self.offset, "relative-url cannot contain `<`");
658-
}
659-
self.expect_str(">")?;
660-
self.eat_optional_hash()?;
661-
return Ok(ParsedComponentNameKind::Url);
662-
}
663651

664652
// 'integrity=<' <integrity-metadata> '>'
665653
if self.eat_str("integrity=") {

tests/local/component-model/export.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"not a valid export name")
6262
(assert_invalid
6363
(component (type (component (export "relative-url=<x>" (func)))))
64-
"not a valid export name")
64+
"not a valid extern name")
6565
(assert_invalid
6666
(component (type (component (export "locked-dep=<a:b>" (func)))))
6767
"not a valid export name")

tests/local/component-model/import.wast

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,23 @@
287287
(component (import "url=<<>" (func)))
288288
"url cannot contain `<`")
289289

290-
(component
291-
(import "relative-url=<>" (func))
292-
(import "relative-url=<a>" (func))
293-
(import "relative-url=<a>,integrity=<sha256-a>" (func))
294-
)
290+
(assert_invalid
291+
(component
292+
(import "relative-url=<>" (func))
293+
(import "relative-url=<a>" (func))
294+
(import "relative-url=<a>,integrity=<sha256-a>" (func))
295+
)
296+
"not a valid extern name")
295297

296298
(assert_invalid
297299
(component (import "relative-url=" (func)))
298-
"expected `<` at ``")
300+
"not a valid extern name")
299301
(assert_invalid
300302
(component (import "relative-url=<" (func)))
301-
"failed to find `>`")
303+
"not a valid extern name")
302304
(assert_invalid
303305
(component (import "relative-url=<<>" (func)))
304-
"relative-url cannot contain `<`")
306+
"not a valid extern name")
305307

306308
(component
307309
(import "integrity=<sha256-a>" (func))

0 commit comments

Comments
 (0)