Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for relative-url=<...> #1567

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions crates/wasmparser/src/validator/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,7 @@ impl<'a> DependencyName<'a> {
}
}

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

Expand Down Expand Up @@ -649,17 +648,6 @@ impl<'a> ComponentNameParser<'a> {
self.eat_optional_hash()?;
return Ok(ParsedComponentNameKind::Url);
}
// 'relative-url=<' <nonbrackets> '>' (',' <hashname>)?
if self.eat_str("relative-url=") {
self.expect_str("<")?;
let url = self.take_up_to('>')?;
if url.contains('<') {
bail!(self.offset, "relative-url cannot contain `<`");
}
self.expect_str(">")?;
self.eat_optional_hash()?;
return Ok(ParsedComponentNameKind::Url);
}

// 'integrity=<' <integrity-metadata> '>'
if self.eat_str("integrity=") {
Expand Down
2 changes: 1 addition & 1 deletion tests/local/component-model/export.wast
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"not a valid export name")
(assert_invalid
(component (type (component (export "relative-url=<x>" (func)))))
"not a valid export name")
"not a valid extern name")
(assert_invalid
(component (type (component (export "locked-dep=<a:b>" (func)))))
"not a valid export name")
Expand Down
18 changes: 10 additions & 8 deletions tests/local/component-model/import.wast
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,23 @@
(component (import "url=<<>" (func)))
"url cannot contain `<`")

(component
(import "relative-url=<>" (func))
(import "relative-url=<a>" (func))
(import "relative-url=<a>,integrity=<sha256-a>" (func))
)
(assert_invalid
(component
(import "relative-url=<>" (func))
(import "relative-url=<a>" (func))
(import "relative-url=<a>,integrity=<sha256-a>" (func))
)
"not a valid extern name")

(assert_invalid
(component (import "relative-url=" (func)))
"expected `<` at ``")
"not a valid extern name")
(assert_invalid
(component (import "relative-url=<" (func)))
"failed to find `>`")
"not a valid extern name")
(assert_invalid
(component (import "relative-url=<<>" (func)))
"relative-url cannot contain `<`")
"not a valid extern name")

(component
(import "integrity=<sha256-a>" (func))
Expand Down