Skip to content

Rust regex doesn't respect EcmaScript regex invalid pattern #97

Description

@edgul

The following test shows that this invalid regex input is being successfully parsed by Rust's Regex crate, but according to URLPattern spec it should fail.

 #[test]
  fn test_test() {
    let input = "((?R))"; // invalid in EcmaScript regex
    let _ = <UrlPattern>::parse(
      UrlPatternInit {
        protocol: Some(input.to_string()),
        ..Default::default()
      },
      Default::default(),
    )
    .unwrap();
  }

This currently passes because the following fragment passes:

    let input = "((?R))";
    let regexp = regex::Regex::new(input);
    regexp.unwrap();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions