Skip to content

Result of test() method does not match Chromium implementation #129

@maischus

Description

@maischus

The result of the test() method of the URLPattern interface in the Chromium implementation does not match the result of this polyfill.

import {URLPattern as URLPatternPolyfill} from "urlpattern-polyfill";

const myPathName = "/some-test/index.html";
const url1 = new URLPattern({ pathname: myPathName });
const url2 = new URLPatternPolyfill({ pathname: myPathName });

const testPathName = "/some-test/index.html#test";
console.log("Chromium:", url1.test({pathname: testPathName}));
console.log("Polyfill:", url2.test({pathname: testPathName}));

Result:

Chromium: false
Polyfill: true

This issue brakes the possibility of using hash-based routing in the Lit-Router (issue lit/lit#3517).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions